Interface ILocatedInstruction

All Superinterfaces:
IInstruction
All Known Subinterfaces:
IDalvikInstruction, IDInstruction
All Known Implementing Classes:
AddressableInstruction

@Ser public interface ILocatedInstruction extends IInstruction
An addressable instruction.
  • 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 to getRoutineCall.
      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 with IInstruction.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, the IFlowInformation.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