|
decompiler 1.0.0
|
A container for an expression manipulating a bitfield. More...
#include <expression.hh>
Public Member Functions | |
| const Varnode * | recoverStructurePointer (const Varnode *vn, int4 offset) |
| Recover the Varnode holding the pointer to the parent structure. | |
| bool | isValid (void) const |
| Is this a valid bitfield expression. | |
Static Public Member Functions | |
| static const TypeBitField * | getPullField (const PcodeOp *pull) |
| Get field description corresponding to given ZPULL or SPULL. | |
Public Attributes | |
| TypeStruct * | theStruct |
| Parent structure containing the bitfield. | |
| const TypeBitField * | bitfield |
| Formal bitfield description. | |
| int4 | byteRangeOffset |
| Offset of byte range into encompassStruct. | |
| int4 | offsetToBitStruct |
| Offset of structure containing bitfield in encompassStruct. | |
Protected Member Functions | |
| void | getStructures (Datatype *dt, int4 initByteOff, int4 leastBitOff, bool isBigEndian) |
| Recover the structure(s) holding the bitfield. | |
A container for an expression manipulating a bitfield.
The expression centers around either a CPUI_INSERT or a CPUI_EXTRACT op but encompasses multiple p-code ops that represent either a single read of or single write to a bitfield within a structure. This class recovers the expected elements of the expression. The method isValid() returns true if the expression has the expected form and can be interpreted as a single read or write.
|
static |
Get field description corresponding to given ZPULL or SPULL.
| pull | is the given ZPULL or SPULL |
References byteRangeOffset, ghidra::TypeStruct::findMatchingBitField(), ghidra::PcodeOp::getIn(), ghidra::Varnode::getOffset(), ghidra::Varnode::getSize(), ghidra::Varnode::getSpace(), getStructures(), ghidra::Varnode::getTypeReadFacing(), ghidra::AddrSpace::isBigEndian(), offsetToBitStruct, and theStruct.
Referenced by ghidra::RulePullAbsorb::absorbCompZero().
|
protected |
Recover the structure(s) holding the bitfield.
Find the structure immediately containing the byte range described by the given data-type. Then, given the least significant bit of the bitfield, find the structure immediately containing the bitfield, which may be a different structure.
| dt | is the data-type describing the byte range |
| initByteOff | is the initial offset of the byte range within the data-type (may be -1) |
| leastBitOff | is the least significant bit of the bitfield within the byte range |
| isBigEndian | is true if the data-type is stored in big endian memory |
References ghidra::Datatype::getMetatype(), ghidra::TypePartialStruct::getOffset(), ghidra::TypePartialStruct::getParent(), ghidra::Datatype::getSize(), ghidra::Datatype::getSubType(), ghidra::TYPE_PARTIALSTRUCT, and ghidra::TYPE_STRUCT.
Referenced by getPullField().