Ghidra Decompiler Analysis Engine
|
Go to the documentation of this file.
19 #ifndef __CPUI_EMUTREE__
20 #define __CPUI_EMUTREE__
113 vector<PcodeOpRaw *> opList;
114 vector<VarnodeData *> varList;
115 map<uintb,uintb> tempValues;
127 uintb getLoadImageValue(
AddrSpace *spc,uintb offset,int4 sz)
const;
128 virtual void executeUnary(
void);
129 virtual void executeBinary(
void);
130 virtual void executeLoad(
void);
131 virtual void executeStore(
void);
132 virtual void executeBranch(
void);
133 virtual bool executeCbranch(
void);
134 virtual void executeBranchind(
void);
135 virtual void executeCall(
void);
136 virtual void executeCallind(
void);
137 virtual void executeCallother(
void);
138 virtual void executeMultiequal(
void);
139 virtual void executeIndirect(
void);
140 virtual void executeSegmentOp(
void);
141 virtual void executeCpoolRef(
void);
142 virtual void executeNew(
void);
143 virtual void fallthruOp(
void);
uintb getTempValue(uintb offset) const
Retrieve a temporary register value directly.
Definition: emulateutil.cc:386
Architecture * glb
The underlying Architecture for the program being emulated.
Definition: emulateutil.hh:43
Abstract class for emitting pcode to an application.
Definition: translate.hh:76
A region where processor data is stored.
Definition: space.hh:73
virtual void executeMultiequal(void)
Standard behavior for a MULTIEQUAL (phi-node)
Definition: emulateutil.cc:94
bool emu_halted
Set to true if the emulator is halted.
Definition: emulate.hh:170
virtual void executeNew(void)
Standard behavior for (low-level) NEW op.
Definition: emulateutil.cc:142
virtual void executeCpoolRef(void)
Standard behavior for a CPOOLREF (constant pool reference) op.
Definition: emulateutil.cc:136
Emulation based on (existing) PcodeOps and Varnodes.
Definition: emulateutil.hh:41
virtual void executeIndirect(void)
Standard behavior for an INDIRECT op.
Definition: emulateutil.cc:110
void resetMemory(void)
Reset the emulation snippet.
Definition: emulateutil.hh:154
PcodeOp * currentOp
Current PcodeOp being executed.
Definition: emulateutil.hh:44
void setCurrentOp(int4 i)
Set the current executing p-code op by index.
Definition: emulateutil.hh:163
Lowest level operation of the p-code language.
Definition: op.hh:58
Manager for all the major decompiler subsystems.
Definition: architecture.hh:119
uintb getVarnodeValue(VarnodeData *vn) const
Retrieve the value of a Varnode from the current machine state.
Definition: emulateutil.cc:363
A pcode-based emulator interface.
Definition: emulate.hh:168
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
const Address & getAddr(void) const
Get address of this operation.
Definition: pcoderaw.hh:166
virtual bool executeCbranch(void)
Check if the conditional of a CBRANCH is true.
Definition: emulateutil.cc:85
bool checkForLegalCode(void) const
Check for p-code that is deemed illegal for a snippet.
Definition: emulateutil.cc:325
void setCurrentOp(PcodeOp *op)
Establish the current PcodeOp being emulated.
Definition: emulateutil.hh:79
EmulatePcodeOp(Architecture *g)
Constructor.
Definition: emulateutil.cc:20
virtual Address getExecuteAddress(void) const
Get the address of the current instruction being executed.
Definition: emulateutil.hh:80
Emulate a snippet of PcodeOps out of a functional context.
Definition: emulateutil.hh:111
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
PcodeOp * lastOp
Last PcodeOp that was executed.
Definition: emulateutil.hh:45
void setVarnodeValue(uintb offset, uintb val)
Set a temporary register value in the machine state.
Definition: emulateutil.hh:170
virtual uintb getVarnodeValue(Varnode *vn) const =0
Given a specific Varnode, retrieve the current value for it from the machine state.
virtual void executeUnary(void)
Execute a unary arithmetic/logical operation.
Definition: emulateutil.cc:45
The PcodeOp and PcodeOpBank classes.
Classes for emulating p-code.
virtual void setExecuteAddress(const Address &addr)
Set the address of the next instruction to emulate.
Definition: emulateutil.hh:147
virtual uintb getLoadImageValue(AddrSpace *spc, uintb offset, int4 sz) const
Pull a value from the load-image given a specific address.
Definition: emulateutil.cc:28
OpBehavior * currentBehave
Behavior of the next op to execute.
Definition: emulate.hh:171
OpBehavior * getBehavior(void) const
Retrieve the behavior for this op.
Definition: pcoderaw.hh:126
A low-level representation of a single pcode operation.
Definition: pcoderaw.hh:94
PcodeEmit * buildEmitter(const vector< OpBehavior * > &inst, uintb uniqReserve)
Provide the caller with an emitter for building the p-code snippet.
Definition: emulateutil.cc:310
virtual void executeSegmentOp(void)
Behavior for a SEGMENTOP.
Definition: emulateutil.cc:120
Data defining a specific memory location.
Definition: pcoderaw.hh:33
virtual Address getExecuteAddress(void) const
Get the address of the current instruction being executed.
Definition: emulateutil.hh:148
virtual void executeBinary(void)
Execute a binary arithmetic/logical operation.
Definition: emulateutil.cc:54
virtual void executeStore(void)
Standard behavior for a p-code STORE.
Definition: emulateutil.cc:76
virtual void executeLoad(void)
Standard behavior for a p-code LOAD.
Definition: emulateutil.cc:64
virtual void setVarnodeValue(Varnode *vn, uintb val)=0
Given a specific Varnode, set the given value for it in the current machine state.
virtual ~EmulateSnippet(void)
Destructor.
Definition: emulateutil.cc:293