|
decompiler
1.0.0
|
P-code emitter that dumps its raw Varnodes and PcodeOps to an in memory cache. More...
#include <emulate.hh>
Public Member Functions | |
| PcodeEmitCache (vector< PcodeOpRaw * > &ocache, vector< VarnodeData * > &vcache, const vector< OpBehavior * > &in, uintb uniqReserve) | |
| Constructor. More... | |
| virtual void | dump (const Address &addr, OpCode opc, VarnodeData *outvar, VarnodeData *vars, int4 isize) |
| The main pcode emit method. More... | |
Public Member Functions inherited from PcodeEmit | |
| virtual | ~PcodeEmit (void) |
| Virtual destructor. | |
| void | restoreXmlOp (const Element *el, const AddrSpaceManager *trans) |
| Emit pcode directly from an XML tag. More... | |
| const uint1 * | restorePackedOp (const Address &addr, const uint1 *ptr, const AddrSpaceManager *trans) |
| Emit pcode directly from a packed byte stream. More... | |
Private Member Functions | |
| VarnodeData * | createVarnode (const VarnodeData *var) |
| Clone and cache a raw VarnodeData. More... | |
Private Attributes | |
| vector< PcodeOpRaw * > & | opcache |
| The cache of current p-code ops. | |
| vector< VarnodeData * > & | varcache |
| The cache of current varnodes. | |
| const vector< OpBehavior * > & | inst |
| Array of behaviors for translating OpCode. | |
| uintm | uniq |
| Starting offset for defining temporaries in unique space. | |
Additional Inherited Members | |
Public Types inherited from PcodeEmit | |
| enum | { unimpl_tag = 0x20, inst_tag = 0x21, op_tag = 0x22, void_tag = 0x23, spaceid_tag = 0x24, addrsz_tag = 0x25, end_tag = 0x60 } |
Static Public Member Functions inherited from PcodeEmit | |
| static const uint1 * | unpackOffset (const uint1 *ptr, uintb &off) |
| Helper function for unpacking an offset from a pcode byte stream. More... | |
| static const uint1 * | unpackVarnodeData (const uint1 *ptr, VarnodeData &v, const AddrSpaceManager *trans) |
| Helper function for unpacking a varnode from a pcode byte stream. More... | |
P-code emitter that dumps its raw Varnodes and PcodeOps to an in memory cache.
This is used for emulation when full Varnode and PcodeOp objects aren't needed
| PcodeEmitCache::PcodeEmitCache | ( | vector< PcodeOpRaw * > & | ocache, |
| vector< VarnodeData * > & | vcache, | ||
| const vector< OpBehavior * > & | in, | ||
| uintb | uniqReserve | ||
| ) |
Constructor.
Provide the emitter with the containers that will hold the cached p-code ops and varnodes.
| ocache | is the container for cached PcodeOpRaw |
| vcache | is the container for cached VarnodeData |
| in | is the map of OpBehavior |
| uniqReserve | is the starting offset for temporaries in the unique space |
References uniq.
|
private |
Clone and cache a raw VarnodeData.
Create an internal copy of the VarnodeData and cache it.
| var | is the incoming VarnodeData being dumped |
References varcache.
Referenced by dump().
|
virtual |
The main pcode emit method.
A single pcode instruction is returned to the application via this method. Particular applications override it to tailor how the operations are used.
| addr | is the Address of the machine instruction |
| opc | is the opcode of the particular pcode instruction |
| outvar | if not null is a pointer to data about the output varnode |
| vars | is a pointer to an array of VarnodeData for each input varnode |
| isize | is the number of input varnodes |
Implements PcodeEmit.
References PcodeOpRaw::addInput(), createVarnode(), inst, opcache, PcodeOpRaw::setBehavior(), PcodeOpRaw::setOutput(), PcodeOpRaw::setSeqNum(), and uniq.
1.8.11