public interface

ILocatedInstruction

implements IInstruction
com.pnfsoftware.jeb.core.units.code.ILocatedInstruction
Known Indirect Subclasses

Class Overview

An addressable instruction.

Summary

Public Methods
abstract IFlowInformation collectIndirectCallReferences()
Collect the list of dereferenced addresses computed by a call-to-sub instruction.
abstract IFlowInformation getBreakingFlow()
Determine if an instruction breaks the flow of execution.
abstract long getOffset()
Get the instruction offset or address.
abstract long getOffsetEnd()
Get the instruction address end (exclusive).
abstract long getPrimaryBranchAddress()
Convenience method used to retrieve the primary target of this branching instruction.
abstract IFlowInformation getRoutineCall()
Determine if an instruction branches to (or calls into) a sub-routine.
[Expand]
Inherited Methods
From interface com.pnfsoftware.jeb.core.units.code.IInstruction

Public Methods

public abstract IFlowInformation collectIndirectCallReferences ()

Collect the list of dereferenced addresses computed by a call-to-sub instruction. This method should not be confused with getRoutineCall(long).

Returns
  • isBroken() is true if the instruction indirectly calls into a sub-routine, false otherwise (in particular for direct routine calls); if true, the getTargets() may be filled with the dereferenced addresses, else its contents is irrelevant

public abstract IFlowInformation getBreakingFlow ()

Determine if an instruction breaks the flow of execution. Examples: jump instructions, conditional jumps, return-to-caller instructions, etc. Sub-routine calls should not be regarded as flow-breakers by this method. Refer to getRoutineCall.

Returns
  • isBroken() is true if the instruction breaks the current flow of execution (sub-routine call instructions are excluded) , false otherwise; if true, getTargets() may be filled with potential addresses, and the first entry should be the fall-through instruction, if there is any

public abstract long getOffset ()

Get the instruction offset or address. The offset may be relative to a base, or absolute in the case of a memory address. The choice is up to the implementor.

Returns
  • the instruction offset/address

public abstract long getOffsetEnd ()

Get the instruction address end (exclusive).

public abstract long getPrimaryBranchAddress ()

Convenience method used to retrieve the primary target of this branching instruction. If the instruction is not branching, or if the target cannot be determined, -1 is returned. If the instruction has multiple branches, only one is returned.

Returns
  • the target address, or -1 on error

public abstract IFlowInformation getRoutineCall ()

Determine if an instruction branches to (or calls into) a sub-routine.

Under normal circumstances, those instructions save the return address (e.g., on a stack or in a register). Therefore, the fall-through address is implied and should not be returned by getTargets(). The list of targets should contain the branch address - or addresses, for example if the processor branching instruction allows branch selection.

Returns
  • isBroken() is true if the instruction calls into a sub-routine, false otherwise; if true, getTargets() may be filled, else its contents is irrelevant