19 #ifndef __CPUI_EMUTREE__ 20 #define __CPUI_EMUTREE__ 113 vector<PcodeOpRaw *> opList;
114 vector<VarnodeData *> varList;
115 map<uintb,uintb> tempValues;
156 PcodeEmit *buildEmitter(
const vector<OpBehavior *> &inst,uintb uniqReserve);
157 bool checkForLegalCode(
void)
const;
172 uintb getTempValue(uintb offset)
const;
const Address & getAddr(void) const
Get address of this operation.
Definition: pcoderaw.hh:166
A region where processor data is stored.
Definition: space.hh:73
virtual void executeCallother(void)=0
Standard behavior for a user-defined p-code op.
const Address & getAddr(void) const
Get the instruction address associated with this op.
Definition: op.hh:151
Abstract class for emitting pcode to an application.
Definition: translate.hh:76
OpBehavior * getBehavior(void) const
Get the behavior associated with the op-code.
Definition: typeop.hh:59
virtual void executeBranchind(void)=0
Standard behavior for a BRANCHIND.
virtual bool executeCbranch(void)
Check if the conditional of a CBRANCH is true.
Definition: emulateutil.cc:85
PcodeOp * currentOp
Current PcodeOp being executed.
Definition: emulateutil.hh:44
A pcode-based emulator interface.
Definition: emulate.hh:168
virtual void executeIndirect(void)
Standard behavior for an INDIRECT op.
Definition: emulateutil.cc:110
virtual void executeLoad(void)
Standard behavior for a p-code LOAD.
Definition: emulateutil.cc:64
OpBehavior * getBehavior(void) const
Retrieve the behavior for this op.
Definition: pcoderaw.hh:126
virtual void executeMultiequal(void)
Standard behavior for a MULTIEQUAL (phi-node)
Definition: emulateutil.cc:94
void resetMemory(void)
Reset the emulation snippet.
Definition: emulateutil.hh:154
void setCurrentOp(int4 i)
Set the current executing p-code op by index.
Definition: emulateutil.hh:163
EmulatePcodeOp(Architecture *g)
Constructor.
Definition: emulateutil.cc:20
A low-level representation of a single pcode operation.
Definition: pcoderaw.hh:94
void setVarnodeValue(uintb offset, uintb val)
Set a temporary register value in the machine state.
Definition: emulateutil.hh:170
Architecture * getArch(void) const
Get the underlying Architecture.
Definition: emulateutil.hh:149
Lowest level operation of the p-code language.
Definition: op.hh:58
virtual void executeCallind(void)=0
Standard behavior for a CALLIND.
A low-level machine address for labelling bytes and data.
Definition: address.hh:46
virtual Address getExecuteAddress(void) const
Get the address of the current instruction being executed.
Definition: emulateutil.hh:80
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
OpBehavior * currentBehave
Behavior of the next op to execute.
Definition: emulate.hh:171
Manager for all the major decompiler subsystems.
Definition: architecture.hh:117
EmulateSnippet(Architecture *g)
Constructor.
Definition: emulateutil.hh:145
A low-level variable or contiguous set of bytes described by an Address and a size.
Definition: varnode.hh:65
virtual void executeStore(void)
Standard behavior for a p-code STORE.
Definition: emulateutil.cc:76
virtual void setVarnodeValue(Varnode *vn, uintb val)=0
Given a specific Varnode, set the given value for it in the current machine state.
PcodeOp * lastOp
Last PcodeOp that was executed.
Definition: emulateutil.hh:45
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
Emulation based on (existing) PcodeOps and Varnodes.
Definition: emulateutil.hh:41
virtual Address getExecuteAddress(void) const
Get the address of the current instruction being executed.
Definition: emulateutil.hh:148
virtual void setExecuteAddress(const Address &addr)
Set the address of the next instruction to emulate.
Definition: emulateutil.hh:147
bool emu_halted
Set to true if the emulator is halted.
Definition: emulate.hh:170
TypeOp * getOpcode(void) const
Get the opcode for this op.
Definition: op.hh:212
virtual void executeBranch(void)=0
Standard behavior for a BRANCH.
Architecture * glb
The underlying Architecture for the program being emulated.
Definition: emulateutil.hh:43
virtual void executeBinary(void)
Execute a binary arithmetic/logical operation.
Definition: emulateutil.cc:54
Classes for emulating p-code.
virtual void executeCpoolRef(void)
Standard behavior for a CPOOLREF (constant pool reference) op.
Definition: emulateutil.cc:136
virtual void executeCall(void)=0
Standard behavior for a p-code CALL.
The PcodeOp and PcodeOpBank classes.
virtual void fallthruOp(void)=0
Standard p-code fall-thru semantics.
Emulate a snippet of PcodeOps out of a functional context.
Definition: emulateutil.hh:111
virtual void executeNew(void)
Standard behavior for (low-level) NEW op.
Definition: emulateutil.cc:142
void setCurrentOp(PcodeOp *op)
Establish the current PcodeOp being emulated.
Definition: emulateutil.hh:79
Data defining a specific memory location.
Definition: pcoderaw.hh:33
virtual void executeSegmentOp(void)
Behavior for a SEGMENTOP.
Definition: emulateutil.cc:120