public interface

ICodeResolver

com.pnfsoftware.jeb.core.units.code.asm.simulator.ICodeResolver<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction>

Class Overview

A resolver attempts to determine the actual value of symbols and items used by instruction artifacts. They can be: branch targets, register values, operand values, flags and other processor state data, etc.

Summary

Public Methods
abstract ICodePointer determineNextAddress(IMachineContext context, InsnType instruction)
Determine the next value of the program counter (PC).
abstract IResolvedOperandValue determineOperandValue(IMachineContext context, InsnType instruction, int index)
Determine the actual values of an instruction operand.

Public Methods

public abstract ICodePointer determineNextAddress (IMachineContext context, InsnType instruction)

Determine the next value of the program counter (PC). Note that the instruction is provided optionally (the context has enough data to parse the instruction at the current PC); however, in practice, the instruction at PC has very likely been decoded already, and is provided by the caller. In such a case, the implementor is free to check the consistency between the provided instruction and the context (eg, performing a basic byte match). An IllegalArgumentException can be raised if a mismatch is detected.

Parameters
context mandatory context
instruction optional instruction
Returns
  • the next address as well as any possible relevant information about the processor state when that next address is executed (eg, processor mode change)
Throws
ProcessorException if the value cannot be determined

public abstract IResolvedOperandValue determineOperandValue (IMachineContext context, InsnType instruction, int index)

Determine the actual values of an instruction operand. Note that the instruction is provided optionally (the context has enough data to parse the instruction at the current PC); however, in practice, the instruction at PC has very likely been decoded already, and is provided by the caller. In such a case, the implementor is free to check the consistency between the provided instruction and the context (eg, performing a basic byte match). An IllegalArgumentException can be raised if a mismatch is detected.

Parameters
context mandatory context
instruction optional instruction
index the operand index
Returns
  • the operand value
Throws
ProcessorException if a value cannot be determined