Interface ILocatedInstruction
- All Superinterfaces:
IInstruction
- All Known Subinterfaces:
IDalvikInstruction
,IDInstruction
- All Known Implementing Classes:
AddressableInstruction
An addressable instruction.
-
Method Summary
Modifier and TypeMethodDescriptionCollect the list of dereferenced addresses computed by a call-to-sub instruction.Determine if an instruction breaks the flow of execution.long
Get the instruction offset or address.default long
Get the instruction address end (exclusive).long
Convenience method used to retrieve the primary target of this branching instruction.Determine if an instruction branches to (or calls into) a sub-routine.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.IInstruction
canThrow, collectIndirectCallReferences, format, getACS, getBreakingFlow, getCode, getCountOfOperands, getDefUse, getDefUse, getDefUseInfo, getInstructionFlags, getMnemonic, getOperand, getOperands, getPrefix, getPrimaryBranchAddress, getProcessorMode, getRoutineCall, getSize
-
Method Details
-
getOffset
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
-
getOffsetEnd
default long getOffsetEnd()Get the instruction address end (exclusive).- Returns:
-
getBreakingFlow
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 togetRoutineCall
.- Returns:
IFlowInformation.isBroken()
is true if the instruction breaks the current flow of execution (sub-routine call instructions are excluded) , false otherwise; if true,IFlowInformation.getTargets()
may be filled with potential addresses, and the first entry should be the fall-through instruction, if there is any- See Also:
-
getRoutineCall
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
IFlowInformation.getTargets()
. The list of targets should contain the branch address - or addresses, for example if the processor branching instruction allows branch selection.- Returns:
IFlowInformation.isBroken()
is true if the instruction calls into a sub-routine, false otherwise; if true,IFlowInformation.getTargets()
may be filled, else its contents is irrelevant- See Also:
-
collectIndirectCallReferences
IFlowInformation collectIndirectCallReferences()Collect the list of dereferenced addresses computed by a call-to-sub instruction. This method should not be confused withIInstruction.getRoutineCall(long)
.- Returns:
IFlowInformation.isBroken()
is true if the instruction indirectly calls into a sub-routine, false otherwise (in particular for direct routine calls); if true, theIFlowInformation.getTargets()
may be filled with the dereferenced addresses, else its contents is irrelevant- See Also:
-
getPrimaryBranchAddress
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
-