Package ghidra.pcode.emulate
Class EmulateInstructionStateModifier
java.lang.Object
ghidra.pcode.emulate.EmulateInstructionStateModifier
EmulateInstructionStateModifier
defines a language specific
handler to assist emulation with adjusting the current execution state,
providing support for custom pcodeop's (i.e., CALLOTHER).
The implementation of this interface must provide a public constructor which
takes a single Emulate argument.-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Execute a CALLOTHER opvoid
initialExecuteCallback
(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) Emulation callback immediately before the first instruction is executed.void
postExecuteCallback
(Emulate emulate, Address lastExecuteAddress, PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress) Emulation callback immediately following execution of the lastExecuteAddress.protected final void
registerPcodeOpBehavior
(String opName, OpBehaviorOther pcodeOpBehavior) Register a pcodeop behavior corresponding to a CALLOTHER opcode.
-
Field Details
-
emu
-
language
-
-
Constructor Details
-
EmulateInstructionStateModifier
-
-
Method Details
-
registerPcodeOpBehavior
Register a pcodeop behavior corresponding to a CALLOTHER opcode.- Parameters:
opName
- name as defined within language via "define pcodeop"pcodeOpBehavior
-
-
executeCallOther
Execute a CALLOTHER op- Parameters:
op
-- Returns:
- true if corresponding pcodeop was registered and emulation support is performed, or false if corresponding pcodeop is not supported by this class.
- Throws:
LowlevelError
-
initialExecuteCallback
public void initialExecuteCallback(Emulate emulate, Address current_address, RegisterValue contextRegisterValue) throws LowlevelError Emulation callback immediately before the first instruction is executed. This callback permits any language specific initializations to be performed.- Parameters:
emulate
-current_address
- intial execute addresscontextRegisterValue
- initial context value or null if not applicable or unknown- Throws:
LowlevelError
-
postExecuteCallback
public void postExecuteCallback(Emulate emulate, Address lastExecuteAddress, PcodeOp[] lastExecutePcode, int lastPcodeIndex, Address currentAddress) throws LowlevelError Emulation callback immediately following execution of the lastExecuteAddress. One use of this callback is to modify the flowing/future context state.- Parameters:
emulate
-lastExecuteAddress
-lastExecutePcode
-lastPcodeIndex
- pcode index of last op or -1 if no pcode or fall-through occurred.currentAddress
-- Throws:
LowlevelError
-