|
decompiler 1.0.0
|
An exported value of a sub-constructor in a SLEIGH specification. More...
#include <semantics.hh>
Public Member Functions | |
| HandleTpl (void) | |
| Construct an uninitialized HandleTpl. | |
| HandleTpl (const VarnodeTpl *vn) | |
| Construct HandleTpl representing the given VarnodeTpl. More... | |
| HandleTpl (const ConstTpl &spc, const ConstTpl &sz, const VarnodeTpl *vn, AddrSpace *t_space, uintb t_offset) | |
| Construct a dynamic HandleTpl. More... | |
| const ConstTpl & | getSpace (void) const |
| Get the address space. | |
| const ConstTpl & | getPtrSpace (void) const |
| Get the pointer address space. | |
| const ConstTpl & | getPtrOffset (void) const |
| Get the offset (or the pointer offset) | |
| const ConstTpl & | getPtrSize (void) const |
| Get the pointer size. | |
| const ConstTpl & | getSize (void) const |
| Get the size. | |
| const ConstTpl & | getTempSpace (void) const |
| Get the temporary register address space. | |
| const ConstTpl & | getTempOffset (void) const |
| Get the temporary register offset. | |
| void | setSize (const ConstTpl &sz) |
| Set the size. | |
| void | setPtrSize (const ConstTpl &sz) |
| Set the pointer size. | |
| void | setPtrOffset (uintb val) |
| Set the pointer offset. | |
| void | setTempOffset (uintb val) |
| Set the temporary register offset. | |
| void | fix (FixedHandle &hand, const ParserWalker &walker) const |
| Calculate final fixed values for this. More... | |
| void | changeHandleIndex (const vector< int4 > &handmap) |
| Remap any handle indices for this. More... | |
| void | encode (Encoder &encoder) const |
| Encode this HandleTpl to an output stream. More... | |
| void | decode (Decoder &decoder) |
| Decode this HandleTpl from a stream. More... | |
Private Attributes | |
| ConstTpl | space |
| The address space of the value. | |
| ConstTpl | size |
| The size of the value. | |
| ConstTpl | ptrspace |
| (If dynamic) the address space of the pointer | |
| ConstTpl | ptroffset |
| If dynamic, the offset of the pointer, or the offset of the value otherwise. | |
| ConstTpl | ptrsize |
| (If dynamic) the size of the pointer | |
| ConstTpl | temp_space |
| (If dynamic) the address space of the temporary register holding the final value | |
| ConstTpl | temp_offset |
| (If dynamic) the offset of the temporary register | |
An exported value of a sub-constructor in a SLEIGH specification.
For an output value that is equivalent to a VarnodeTpl, space, ptroffset, and size correspond to Varnode::space, Varnode::offset, and Varnode::size. But a HandleTpl can also represent a dynamic value loaded at run-time. In this case, the final value is stored in a temporary register specified by temp_space, temp_offset (and size), and the pointer used to load the final value is specified by ptrspace, ptroffset, and ptrsize.
| ghidra::HandleTpl::HandleTpl | ( | const VarnodeTpl * | vn | ) |
Construct HandleTpl representing the given VarnodeTpl.
The constructed HandleTpl is not dynamic and matches the given VarnodeTpl
| vn | is the given VarnodeTpl |
References ghidra::VarnodeTpl::getOffset(), ghidra::VarnodeTpl::getSize(), ghidra::VarnodeTpl::getSpace(), ptroffset, ptrspace, ghidra::ConstTpl::real, size, and space.
| ghidra::HandleTpl::HandleTpl | ( | const ConstTpl & | spc, |
| const ConstTpl & | sz, | ||
| const VarnodeTpl * | vn, | ||
| AddrSpace * | t_space, | ||
| uintb | t_offset | ||
| ) |
Construct a dynamic HandleTpl.
| spc | is the address space |
| sz | is the size |
| vn | is the varnode representing the dynamic pointer |
| t_space | is the address space of the temporary register |
| t_offset | is the offset of the temporary register |
| void ghidra::HandleTpl::changeHandleIndex | ( | const vector< int4 > & | handmap | ) |
Remap any handle indices for this.
This is used to help reorder sub-constructors. For each piece of this, if it is a handle, its index is translated by looking up a new value in the given array of indices.
| handmap | is the given array of new handle indices |
References ghidra::ConstTpl::changeHandleIndex(), ptroffset, ptrsize, ptrspace, size, space, temp_offset, and temp_space.
Referenced by ghidra::ConstructTpl::changeHandleIndex().
| void ghidra::HandleTpl::decode | ( | Decoder & | decoder | ) |
Decode this HandleTpl from a stream.
| decoder | is the input stream |
References ghidra::Decoder::closeElement(), ghidra::ConstTpl::decode(), ghidra::Decoder::openElement(), ptroffset, ptrsize, ptrspace, size, space, temp_offset, and temp_space.
Referenced by ghidra::ConstructTpl::decode().
| void ghidra::HandleTpl::encode | ( | Encoder & | encoder | ) | const |
Encode this HandleTpl to an output stream.
| encoder | is the output stream |
References ghidra::Encoder::closeElement(), ghidra::ConstTpl::encode(), ghidra::Encoder::openElement(), ptroffset, ptrsize, ptrspace, size, space, temp_offset, and temp_space.
Referenced by ghidra::ConstructTpl::encode().
| void ghidra::HandleTpl::fix | ( | FixedHandle & | hand, |
| const ParserWalker & | walker | ||
| ) | const |
Calculate final fixed values for this.
The final constant values for this are computed in context and stored in the given FixedHandle object.
| hand | is FixedHandle holding the final handle constants |
| walker | is the context used to fix constants |
References ghidra::AddrSpace::addressToByte(), ghidra::ConstTpl::fillinOffset(), ghidra::ConstTpl::fillinSpace(), ghidra::ConstTpl::fix(), ghidra::ConstTpl::fixSpace(), ghidra::ConstTpl::getType(), ghidra::AddrSpace::getType(), ghidra::AddrSpace::getWordSize(), ghidra::IPTR_CONSTANT, ghidra::FixedHandle::offset_offset, ghidra::FixedHandle::offset_size, ghidra::FixedHandle::offset_space, ptroffset, ptrsize, ptrspace, ghidra::ConstTpl::real, ghidra::FixedHandle::size, size, ghidra::FixedHandle::space, space, ghidra::FixedHandle::temp_offset, temp_offset, ghidra::FixedHandle::temp_space, temp_space, and ghidra::AddrSpace::wrapOffset().
Referenced by ghidra::Sleigh::resolveHandles().