Ghidra Decompiler Analysis Engine
|
An active container for a set of p-code operations that can be injected into data-flow. More...
#include <pcodeinject.hh>
Public Types | |
enum | { CALLFIXUP_TYPE = 1, CALLOTHERFIXUP_TYPE = 2, CALLMECHANISM_TYPE = 3, EXECUTABLEPCODE_TYPE = 4 } |
Public Member Functions | |
virtual void | inject (InjectContext &context, PcodeEmit &emit) const =0 |
virtual void | restoreXml (const Element *el) |
Restore this payload from an XML stream. More... | |
virtual void | printTemplate (ostream &s) const =0 |
Print the p-code ops of the injection to a stream (for debugging) | |
virtual string | getSource (void) const =0 |
Return a string describing the source of the injection (.cspec, prototype model, etc.) | |
Protected Member Functions | |
void | orderParameters (void) |
Assign an index to parameters. More... | |
Static Protected Member Functions | |
static void | readParameter (const Element *el, string &name, uint4 &size) |
Read in an <input> or <output> XML tag describing an injection parameter. More... | |
Protected Attributes | |
string | name |
Formal name of the payload. | |
int4 | type |
Type of this payload: CALLFIXUP_TYPE, CALLOTHERFIXUP_TYPE, etc. | |
bool | dynamic |
True if the injection is generated dynamically. | |
bool | incidentalCopy |
True if injected COPYs are considered incidental. | |
int4 | paramshift |
Number of parameters shifted in the original call. | |
vector< InjectParameter > | inputlist |
List of input parameters to this payload. | |
vector< InjectParameter > | output |
List of output parameters. | |
An active container for a set of p-code operations that can be injected into data-flow.
This is an abstract base class. Derived classes manage details of how the p-code is stored. The methods provide access to the input/output parameter information, and the main injection is performed with inject().
anonymous enum |
|
pure virtual |
Perform the injection of this payload into data-flow.
P-code operations representing this payload are copied into the controlling analysis context. The provided PcodeEmit object dictates exactly where the PcodeOp and Varnode objects are inserted and to what container. An InjectContext object specifies how placeholder elements become concrete Varnodes in the appropriate context.
context | is the provided InjectConject object |
emit | is the provovided PcodeEmit object |
Implemented in InjectPayloadDynamic, ExecutablePcodeSleigh, ExecutablePcodeGhidra, InjectPayloadGhidra, and InjectPayloadSleigh.
|
protected |
Assign an index to parameters.
Input and output parameters are assigned a unique index.
|
staticprotected |
Read in an <input> or <output> XML tag describing an injection parameter.
el | is the XML element |
name | is used to pass back the parameter name |
size | is used to pass back the parameter size |
|
virtual |
Restore this payload from an XML stream.
The base class version of this method restores from a <pcode> tag. Derived classes may restore from a parent tag and then invoke the base class method.
el | is the XML element |
Reimplemented in ExecutablePcodeSleigh, ExecutablePcodeGhidra, InjectPayloadCallother, InjectCallotherGhidra, InjectPayloadCallfixup, InjectCallfixupGhidra, InjectPayloadGhidra, and InjectPayloadSleigh.