Interface IEEmulatorHooks
- All Superinterfaces:
IPriorityBasedHooks
Evaluation (execution) hooks.
-
Method Summary
Modifier and TypeMethodDescriptiondefault Boolean
evaluateAt
(EEmulator emu, long addr, IInstruction hintNativeStm) This hook is called before a native instruction is converted and evaluated.default Boolean
evaluateExternal
(EEmulator emu, String routineName, INativeMethodItem routine) This higher-level hook is called when an external method (e.g.default Long
evaluateSyscall
(EEmulator emu, long addr, IInstruction nativeStm, int syscallNum, String syscallName, INativeMethodItem syscallRoutine, List<Long> args) This higher-level hook is called when a system call type instruction is about to be executed.default Boolean
evaluateUntranslated
(EEmulator emu, IEUntranslatedInstruction stm, IInstruction nativeStm) This hook is called when an instruction conversion produced anIEUntranslatedInstruction
IR.default void
monitorHLSpecial
(EEmulator emu, int code, List<Object> params) Reserved for internal use.default void
postEvaluateAt
(EEmulator emu, long addr, IInstruction hintNativeStm, long reqid, boolean result) default void
postEvaluateExternal
(EEmulator emu, String routineName, INativeMethodItem routine, long reqid, boolean result) default void
postEvaluateSyscall
(EEmulator emu, long addr, IInstruction nativeStm, int syscallNum, String syscallName, INativeMethodItem syscallRoutine, List<Long> args, long reqid, long result) default void
postEvaluateUntranslated
(EEmulator emu, IEUntranslatedInstruction stm, IInstruction nativeStm, long reqid, Boolean result) Methods inherited from interface com.pnfsoftware.jeb.core.units.IPriorityBasedHooks
getPriority
-
Method Details
-
evaluateAt
This hook is called before a native instruction is converted and evaluated. The hook has a chance to examine and modify the emulator state (provide a custom evaluation) if it wants to. If a hook succeeded (returned: true), it is expected that the PC was updated to point to the next instruction to be executed,. The emulator will proceed at the then-current PC.- Parameters:
emu
- the emulatoraddr
- native address (current PC)hintNativeStm
- (optional) instruction parsed at the current PC- Returns:
- null means nothing was done, check the next hooks; true means the hooks was successful, the emulator should proceed with the next cycle; false means the hook failed, the next hooks should not be checked
-
postEvaluateAt
default void postEvaluateAt(EEmulator emu, long addr, IInstruction hintNativeStm, long reqid, boolean result) -
evaluateSyscall
default Long evaluateSyscall(EEmulator emu, long addr, IInstruction nativeStm, int syscallNum, String syscallName, INativeMethodItem syscallRoutine, List<Long> args) This higher-level hook is called when a system call type instruction is about to be executed. The hook has a chance to examine and modify the emulator state (provide a custom evaluation) if it wants to. If a hook succeeded (returned: non-null), the emulator will update the PC to point to the next instruction, i.e. the implementor does not need to update the PC itself.- Parameters:
emu
- the emulatoraddr
- native address (current PC)nativeStm
- the system call instructionsyscallNum
- the system call number, always providedsyscallName
- system call name (optional)syscallRoutine
- system routine to be executed (optional)args
- the arguments to the system call- Returns:
- the return value, or null if nothing was done, in which case the next hook will be attempted
-
postEvaluateSyscall
default void postEvaluateSyscall(EEmulator emu, long addr, IInstruction nativeStm, int syscallNum, String syscallName, INativeMethodItem syscallRoutine, List<Long> args, long reqid, long result) -
evaluateExternal
This higher-level hook is called when an external method (e.g. a library method) is about to be executed. The PC when this method is called is on the routine entry-point. The hook has a chance to provide a custom evaluation if it wants to. If a hook succeeded (returned: true), it is expected that the PC (along with other execution environment attributes, such as the stack) was updated to the return address provided to the routine. The emulator will proceed at the then-current PC.- Parameters:
emu
- the emulatorroutineName
- mandatory routine nameroutine
- optional routine reference- Returns:
- null means nothing was done, check the next hooks; true means the hooks was successful, the emulator should proceed with the next cycle; false means the hook failed, the next hooks should not be checked
-
postEvaluateExternal
default void postEvaluateExternal(EEmulator emu, String routineName, INativeMethodItem routine, long reqid, boolean result) -
evaluateUntranslated
default Boolean evaluateUntranslated(EEmulator emu, IEUntranslatedInstruction stm, IInstruction nativeStm) This hook is called when an instruction conversion produced anIEUntranslatedInstruction
IR. The hook has a chance to provide a custom evaluation is it can. Else, the emulator is very likely to fail and the emulation will stop. If a hook succeeded (returned: true), it is expected that the PC was updated to point to the next instruction to be executed,. The emulator will proceed at the then-current PC.- Parameters:
emu
- the emulatorstm
- untranslated IR statementnativeStm
- source native instruction- Returns:
- null means nothing was done, check the next hooks; true means the hooks was successful, the emulator should proceed with the next cycle; false means the hook failed, the next hooks should not be checked
-
postEvaluateUntranslated
default void postEvaluateUntranslated(EEmulator emu, IEUntranslatedInstruction stm, IInstruction nativeStm, long reqid, Boolean result) -
monitorHLSpecial
Reserved for internal use.- Parameters:
emu
- the emulatorcode
- a monitoring codeparams
- the associated parameters (depends on code)
-