Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::InjectContext Class Referenceabstract

Context needed to emit a p-code injection as a full set of p-code operations. More...

#include <pcodeinject.hh>

Inheritance diagram for ghidra::InjectContext:
[legend]
Collaboration diagram for ghidra::InjectContext:
[legend]

Public Member Functions

virtual ~InjectContext (void)
 Destructor.
 
virtual void clear (void)
 Release resources (from last injection)
 
virtual void encode (Encoder &encoder) const =0
 Encode this context to a stream as a <context> element.
 

Public Attributes

Architectureglb
 Architecture associated with the injection.
 
Address baseaddr
 Address of instruction causing inject.
 
Address nextaddr
 Address of following instruction.
 
Address calladdr
 If the instruction being injected is a call, this is the address being called.
 
vector< VarnodeDatainputlist
 Storage location for input parameters.
 
vector< VarnodeDataoutput
 Storage location for output.
 

Detailed Description

Context needed to emit a p-code injection as a full set of p-code operations.

P-code injection works by passing a pre-built template of p-code operations (ConstructTpl) to an emitter (PcodeEmit), which makes the final resolution SLEIGH concepts like inst_next to concrete Varnodes. This class contains the context dependent data to resolve:

  • inst_start – the address where the injection occurs
  • inst_next – the address of the instruction following (the instruction being injected)
  • inst_next2 – the address of the instruction after the next instruction (Not Supported)
  • inst_dest – Original destination of CALL being injected
  • inst_ref – Target of reference on injected instruction
  • <input> – Input Varnode of the injection referenced by name
  • <output> – Output Varnode of the injection referenced by name

Member Function Documentation

◆ encode()

virtual void ghidra::InjectContext::encode ( Encoder encoder) const
pure virtual

Encode this context to a stream as a <context> element.

Parameters
encoderis the stream encoder

Implemented in ghidra::InjectContextGhidra.

Referenced by ghidra::ArchitectureGhidra::getPcodeInject().


The documentation for this class was generated from the following file: