java.lang.Object | |
↳ | com.pnfsoftware.jeb.core.units.code.AddressableInstruction<InsnType extends com.pnfsoftware.jeb.core.units.code.IInstruction> |
Decorator that makes address-less
instructions addressable
.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
AddressableInstruction(long address, InsnType insn)
Wrap an instruction and attach an address to it.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean |
canThrow()
Determine if the instruction can throw an exception.
| ||||||||||
String |
format(Object context)
Format the instruction for printing
| ||||||||||
IFlowInformation |
getBreakingFlow(long instructionAddress)
Determine if an instruction breaks the flow of execution.
| ||||||||||
IFlowInformation |
getBreakingFlow()
Determine if the instruction breaks the execution flow.
| ||||||||||
byte[] |
getCode()
Get the binary code that makes up this instruction.
| ||||||||||
void |
getDefUse(List<Integer> def, List<Integer> use, Object context)
Determine the registers defined and used by the instruction.
| ||||||||||
IFlowInformation |
getIndirectRoutineCall()
Determine if the instruction is calling into a sub-routine using memory dereferencing.
| ||||||||||
IFlowInformation |
getIndirectRoutineCall(long instructionAddress)
Determine if an instruction indirectly branches to (or calls into) a sub-routine.
| ||||||||||
InsnType |
getInstruction()
Get the underlying instruction.
| ||||||||||
String |
getMnemonic()
The instruction mnemonic.
| ||||||||||
long |
getOffset()
Get the instruction offset or address.
| ||||||||||
IInstructionOperand[] |
getOperands()
Get the list of operands for this instruction.
| ||||||||||
String |
getPrefix()
Get the instruction's optional prefix(es).
| ||||||||||
int |
getProcessorMode()
Get the mode the processor was in when it parsed and created this instruction.
| ||||||||||
IFlowInformation |
getRoutineCall(long instructionAddress)
Determine if an instruction branches to (or calls into) a sub-routine.
| ||||||||||
IFlowInformation |
getRoutineCall()
Determine if the instruction is calling into a sub-routine.
| ||||||||||
int |
getSize()
Get the instruction size in bytes.
| ||||||||||
boolean |
isConditional()
Determine if the instruction executes conditionally.
| ||||||||||
String | toString() |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Wrap an instruction and attach an address to it.
address | the address |
---|
Determine if the instruction can throw an exception.
Format the instruction for printing
context | optional context, used to provide a better representation of the instruction (for instance, resolving strings or method names.) The implementor should do its best to return a decent result even if context is null. |
---|
Determine if an instruction breaks the flow of execution. Sub-routine calls should not be
regarded as flow-breakers by this method. Refer to getRoutineCall
.
instructionAddress | the address of the current instruction |
---|
isBroken()
is true if the instruction breaks the current
flow of execution (sub-routine call instructions are excluded) , false otherwise; if
true, the getTargets()
may be filled with potential
addresses, and the first entry should be the fall-through instruction, if there is
any
Determine if the instruction breaks the execution flow.
isBroken()
returns true). If true, the list of next offsets (addresses) is returned (
getTargets()
)The implementing class MUST return the
fall-through offset, if any, first.
Get the binary code that makes up this instruction.
Determine the registers defined and used by the instruction.
def | Output, the list of registers defined by the instruction. |
---|---|
use | Output, the list of registers used by the instruction. |
context | Optional context, implementation specific. |
Determine if the instruction is calling into a sub-routine using memory dereferencing.
Determine if an instruction indirectly branches to (or calls into) a sub-routine. Such routine calls first dereference an address to find the actual called address.
Warning: the addresses returned are the dereferenced addresses, not the final address executed.
instructionAddress | the address of the current instruction |
---|
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
Get the underlying instruction.
The instruction mnemonic.
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.
Get the list of operands for this instruction.
Get the instruction's optional prefix(es).
Get the mode the processor was in when it parsed and created this instruction. Refer to
IProcessor
MODE_xxx
.
Determine if an instruction branches to (or calls into) a sub-routine.
Under normal circumstances, those instructions save the return value (eg, on a stack or in a
register). Therefore, the fall-through address is implied and should not be returned by the
caller in the getTargets()
. That array should contain the branch
address - or addresses, for example if the processor branching instruction allows branch
selection.
instructionAddress | the address of the current instruction |
---|
isBroken()
is true if the instruction calls into a
sub-routine, false otherwise; if true, the getTargets()
may
be filled, else its contents is irrelevant
Determine if the instruction is calling into a sub-routine.
Get the instruction size in bytes.
Determine if the instruction executes conditionally. Note that this method only checks the instruction itself, and not the surrounding code.