Class FollowFlow

java.lang.Object
ghidra.program.model.block.FollowFlow

public class FollowFlow extends Object
FollowFlow follows the program's code flow either forward or backward from an initial address set. It adds the flow addresses to the initial address set by flowing "from" the initial addresses in the forward direction or by flowing "to" the initial addresses when used in the backward direction. The flow can be limited by indicating the flow types (i.e. unconditional call, computed jump, etc.) that we do NOT want to follow.
  • Constructor Details

    • FollowFlow

      public FollowFlow(Program program, AddressSetView addressSet, FlowType[] doNotFollow)
      Constructor Note: flow into existing functions will be included Note: flow into un-disassembled locations will be included
      Parameters:
      program - the program whose flow we are following.
      addressSet - the initial addresses that should be flowed from or flowed to.
      doNotFollow - array of flow types that are not to be followed. null or empty array indicates follow all flows. The following are valid flow types for the doNotFollow array:
      FlowType.COMPUTED_CALL
      FlowType.CONDITIONAL_CALL
      FlowType.UNCONDITIONAL_CALL
      FlowType.COMPUTED_JUMP
      FlowType.CONDITIONAL_JUMP
      FlowType.UNCONDITIONAL_JUMP
      FlowType.INDIRECTION
    • FollowFlow

      public FollowFlow(Program program, AddressSetView addressSet, FlowType[] doNotFollow, boolean followIntoFunctions)
      Constructor Note: flow into un-disassembled locations will be included
      Parameters:
      program - the program whose flow we are following.
      addressSet - the initial addresses that should be flowed from or flowed to.
      doNotFollow - array of flow types that are not to be followed. null or empty array indicates follow all flows. The following are valid flow types for the doNotFollow array:
      FlowType.COMPUTED_CALL
      FlowType.CONDITIONAL_CALL
      FlowType.UNCONDITIONAL_CALL
      FlowType.COMPUTED_JUMP
      FlowType.CONDITIONAL_JUMP
      FlowType.UNCONDITIONAL_JUMP
      FlowType.INDIRECTION
      followIntoFunctions - true if flows into (or back from) defined functions should be followed.
    • FollowFlow

      public FollowFlow(Program program, AddressSet addressSet, FlowType[] doNotFollow, boolean followIntoFunctions, boolean includeData)
      Constructor
      Parameters:
      program - the program whose flow we are following.
      addressSet - the initial addresses that should be flowed from or flowed to.
      doNotFollow - array of flow types that are not to be followed. null or empty array indicates follow all flows. The following are valid flow types for the doNotFollow array:
      FlowType.COMPUTED_CALL
      FlowType.CONDITIONAL_CALL
      FlowType.UNCONDITIONAL_CALL
      FlowType.COMPUTED_JUMP
      FlowType.CONDITIONAL_JUMP
      FlowType.UNCONDITIONAL_JUMP
      FlowType.INDIRECTION
      followIntoFunctions - true if flows into (or back from) defined functions should be followed.
      includeData - true if instruction flows into un-disassembled data should be included
    • FollowFlow

      public FollowFlow(Program program, Address address, FlowType[] doNotFollow, boolean followIntoFunctions, boolean includeData, boolean restrictSingleAddressSpace)
      Constructor
      Parameters:
      program - the program whose flow we are following.
      address - the initial address that should be flowed from or flowed to.
      doNotFollow - array of flow types that are not to be followed.
      followIntoFunctions - true if flows into (or back from) defined functions should be followed.
      includeData - true if instruction flows into un-disassembled data should be included
      restrictSingleAddressSpace - if true collected flows should be restricted to a single address space identified by address. null or empty array indicates follow all flows. The following are valid flow types for the doNotFollow array:
      FlowType.COMPUTED_CALL
      FlowType.CONDITIONAL_CALL
      FlowType.UNCONDITIONAL_CALL
      FlowType.COMPUTED_JUMP
      FlowType.CONDITIONAL_JUMP
      FlowType.UNCONDITIONAL_JUMP
      FlowType.INDIRECTION
  • Method Details

    • getFlowAddressSet

      public AddressSet getFlowAddressSet(TaskMonitor monitor)
      Determines the address set that flows from the addresses in this FollowFlow object's initialAddresses set. The address set is determined by what addresses were provided when the FollowFlow was constructed and the type of flow requested. This method follows flows in the forward direction.
      Parameters:
      monitor - a cancellable task monitor, may be null
      Returns:
      code unit flow represented by an address set as determined by the flow options. An empty address set will be returned if cancelled.
    • getFlowToAddressSet

      public AddressSet getFlowToAddressSet(TaskMonitor monitor)
      Determines the address set that flows to the addresses in this FollowFlow object's initialAddresses set. The address set is determined by what addresses were provided when the FollowFlow was constructed and the type of flow requested. The constructor indicated the flow types not to be followed. All others will be traversed in the backwards direction to determine the addresses that are flowing to those in the initial set.
      Parameters:
      monitor - a cancellable task monitor, may be null
      Returns:
      code unit flow represented by an address set as determined by the flow options. An empty address set will be returned if cancelled.