# Interface: com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.IEEmulatorHooks

Evaluation \(execution\) hooks.

## Method: evaluateAt
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `addr`, type: `long`
- parameter: `hintNativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- return type: `java.lang.Boolean`

Description: 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.
parameter: emu: the emulator
parameter: addr: native address \(current PC\)
parameter: hintNativeStm: \(optional\) instruction parsed at the current PC
return: 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

## Method: evaluateExternal
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `routineName`, type: `java.lang.String`
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- return type: `java.lang.Boolean`

Description: 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.
parameter: emu: the emulator
parameter: routineName: mandatory routine name
parameter: routine: optional routine reference
return: 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

## Method: evaluateSyscall
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `addr`, type: `long`
- parameter: `nativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- parameter: `syscallNum`, type: `int`
- parameter: `syscallName`, type: `java.lang.String`
- parameter: `syscallRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `args`, type: `java.util.List<java.lang.Long>`
- return type: `java.lang.Long`

Description: 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.
parameter: emu: the emulator
parameter: addr: native address \(current PC\)
parameter: nativeStm: the system call instruction
parameter: syscallNum: the system call number, always provided
parameter: syscallName: system call name \(optional\)
parameter: syscallRoutine: system routine to be executed \(optional\)
parameter: args: the arguments to the system call \(non\-null, non\-empty\)
return: \- the return value, or null if nothing was done, in which case the next hook will be         attempted \(with the exception of the caveat below\)
         \- if null is returned and args\[0\] was set to null by the hook, the hook manager         considers the execution a success but will not update the PC, and         [#postEvaluateSyscall](#postEvaluateSyscall) will not be executed\)

## Method: evaluateUntranslated
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEUntranslatedInstruction`
- parameter: `nativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- return type: `java.lang.Boolean`

Description: This hook is called when an instruction conversion produced an [IEUntranslatedInstruction](IEUntranslatedInstruction) 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.
parameter: emu: the emulator
parameter: stm: untranslated IR statement
parameter: nativeStm: source native instruction
return: 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

## Method: monitorHLSpecial
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `code`, type: `int`
- parameter: `params`, type: `java.util.List<java.lang.Object>`

Description: Reserved for internal use.
parameter: emu: the emulator
parameter: code: a monitoring code
parameter: params: the associated parameters \(depends on code\)

## Method: postEvaluateAt
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `addr`, type: `long`
- parameter: `hintNativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- parameter: `reqid`, type: `long`
- parameter: `result`, type: `boolean`


## Method: postEvaluateExternal
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `routineName`, type: `java.lang.String`
- parameter: `routine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `reqid`, type: `long`
- parameter: `result`, type: `boolean`


## Method: postEvaluateSyscall
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `addr`, type: `long`
- parameter: `nativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- parameter: `syscallNum`, type: `int`
- parameter: `syscallName`, type: `java.lang.String`
- parameter: `syscallRoutine`, type: `com.pnfsoftware.jeb.core.units.code.asm.items.INativeMethodItem`
- parameter: `args`, type: `java.util.List<java.lang.Long>`
- parameter: `reqid`, type: `long`
- parameter: `result`, type: `long`


## Method: postEvaluateUntranslated
- parameter: `emu`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.emulator.EEmulator`
- parameter: `stm`, type: `com.pnfsoftware.jeb.core.units.code.asm.decompiler.ir.IEUntranslatedInstruction`
- parameter: `nativeStm`, type: `com.pnfsoftware.jeb.core.units.code.IInstruction`
- parameter: `reqid`, type: `long`
- parameter: `result`, type: `java.lang.Boolean`


