|
decompiler 1.0.0
|
A debugging placeholder for a payload that changes depending on context. More...
#include <inject_sleigh.hh>
Public Member Functions | |
| InjectPayloadDynamic (Architecture *g, InjectPayload *base) | |
| Constructor for use with decode. | |
| void | decodeEntry (Decoder &decoder) |
| Decode a specific p-code sequence and the context in which it applied. | |
| virtual void | inject (InjectContext &context, PcodeEmit &emit) const |
| virtual void | decode (Decoder &decoder) |
| Decode this payload from a stream. | |
| virtual void | printTemplate (ostream &s) const |
| Print the p-code ops of the injection to a stream (for debugging) | |
| virtual string | getSource (void) const |
| Return a string describing the source of the injection (.cspec, prototype model, etc.) | |
Public Member Functions inherited from ghidra::InjectPayload | |
| InjectPayload (const string &nm, int4 tp) | |
| Construct for use with decode. | |
| int4 | getParamShift (void) const |
| Get the number of parameters shifted. | |
| bool | isDynamic (void) const |
| Return true if p-code in the injection is generated dynamically. | |
| bool | isIncidentalCopy (void) const |
| Return true if any injected COPY is considered incidental. | |
| int4 | sizeInput (void) const |
| Return the number of input parameters. | |
| int4 | sizeOutput (void) const |
| Return the number of output parameters. | |
| InjectParameter & | getInput (int4 i) |
| Get the i-th input parameter. | |
| InjectParameter & | getOutput (int4 i) |
| Get the i-th output parameter. | |
| virtual | ~InjectPayload (void) |
| Destructor. | |
| string | getName (void) const |
| Return the name of the injection. | |
| int4 | getType (void) const |
| Return the type of injection (CALLFIXUP_TYPE, CALLOTHERFIXUP_TYPE, etc.) | |
Private Attributes | |
| Architecture * | glb |
| The architecture owning this payload. | |
| map< Address, Document * > | addrMap |
| Map from address to specific inject. | |
Additional Inherited Members | |
Public Types inherited from ghidra::InjectPayload | |
| enum | { CALLFIXUP_TYPE = 1 , CALLOTHERFIXUP_TYPE = 2 , CALLMECHANISM_TYPE = 3 , EXECUTABLEPCODE_TYPE = 4 } |
Protected Member Functions inherited from ghidra::InjectPayload | |
| void | orderParameters (void) |
| Assign an index to parameters. | |
| void | decodePayloadAttributes (Decoder &decoder) |
| Parse the attributes of the current <pcode> tag. | |
| void | decodePayloadParams (Decoder &decoder) |
| Parse any <input> or <output> children of current <pcode> tag. | |
Static Protected Member Functions inherited from ghidra::InjectPayload | |
| static void | decodeParameter (Decoder &decoder, string &name, uint4 &size) |
| Parse an <input> or <output> element describing an injection parameter. | |
Protected Attributes inherited from ghidra::InjectPayload | |
| 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. | |
A debugging placeholder for a payload that changes depending on context.
Implemented as a simple map from an Address to an XML description of the p-code sequence to inject. This is used internally by PcodeInjectLibrarySleigh in a debug environment to hold multiple payloads for objects where InjectPayload::isDynamic() returns true.
| ghidra::InjectPayloadDynamic::InjectPayloadDynamic | ( | Architecture * | g, |
| InjectPayload * | base | ||
| ) |
Constructor for use with decode.
| g | is the Architecture |
| base | is original InjectPayload object whose dynamic payloads are being cached |
References ghidra::InjectPayload::dynamic, ghidra::InjectPayload::getInput(), ghidra::InjectPayload::getOutput(), ghidra::InjectPayload::getParamShift(), glb, ghidra::InjectPayload::incidentalCopy, ghidra::InjectPayload::inputlist, ghidra::InjectPayload::isIncidentalCopy(), ghidra::InjectPayload::output, ghidra::InjectPayload::paramshift, ghidra::InjectPayload::sizeInput(), and ghidra::InjectPayload::sizeOutput().
|
inlinevirtual |
Decode this payload from a stream.
Implements ghidra::InjectPayload.
| void ghidra::InjectPayloadDynamic::decodeEntry | ( | Decoder & | decoder | ) |
Decode a specific p-code sequence and the context in which it applied.
Decode the Address for a specific context and then elements for the specific p-code ops.
| decoder | is the stream to pull from |
References addrMap, ghidra::Decoder::closeElement(), ghidra::Address::decode(), ghidra::Decoder::openElement(), ghidra::Decoder::readString(), and ghidra::xml_tree().
Referenced by ghidra::PcodeInjectLibrarySleigh::decodeDebug().
|
inlinevirtual |
Return a string describing the source of the injection (.cspec, prototype model, etc.)
Implements ghidra::InjectPayload.
|
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 |
Implements ghidra::InjectPayload.
References addrMap, ghidra::InjectContext::baseaddr, ghidra::XmlDecode::closeElement(), ghidra::Address::decode(), ghidra::PcodeEmit::decodeOp(), glb, ghidra::XmlDecode::openElement(), ghidra::XmlDecode::peekElement(), and ghidra::Architecture::translate.
|
inlinevirtual |
Print the p-code ops of the injection to a stream (for debugging)
Implements ghidra::InjectPayload.