public class

FlowInformation

extends Object
implements IFlowInformation
java.lang.Object
   ↳ com.pnfsoftware.jeb.core.units.code.FlowInformation

Class Overview

Default IFlowInformation implementation

Summary

Fields
public static final FlowInformation NONE Signifies there is no flow information.
Public Constructors
FlowInformation()
Create an object with an empty target list, no post-compute fall-through, and no delay-slot (default).
FlowInformation(boolean computeFallThrough, int delaySlotCount)
Create an object with an empty target list.
Public Methods
void addTarget(IEntryPointDescription entryPoint)
Add a target to the list of possible targets.
void addTargets(Collection<? extends IEntryPointDescription> entryPoints)
Add a collection of targets to the list of possible targets.
int getDelaySlotCount()
Get the number of instructions in the delay slot.
List<IEntryPointDescription> getTargets()
Get the a list of targets.
static boolean isAddressInTargets(IFlowInformation flowinfo, long address)
boolean isBroken()
Determine if this object does contain flow information.
boolean isBrokenKnown()
Determine if this object does contain flow information and all targets are known.
boolean isBrokenUnknown()
Determine if this object does contain flow information but has no known targets.
boolean mustComputeFallThrough()
Indicate if the flow information includes a fall-through address (relative to the current instruction) that is not present in the FlowInfo object itself.
void setComputeFallThrough(boolean computeFallThrough)
void setDelaySlotCount(int delaySlotCount)
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.pnfsoftware.jeb.core.units.code.IFlowInformation

Fields

public static final FlowInformation NONE

Signifies there is no flow information. When attached to an instruction, that means the instruction does not modify the flow of execution.

Public Constructors

public FlowInformation ()

Create an object with an empty target list, no post-compute fall-through, and no delay-slot (default). Note: this object indicates that the flow is changing, regardless of whether of not the target list will be populated. To indicate no-change in flow, a user should use NONE.

public FlowInformation (boolean computeFallThrough, int delaySlotCount)

Create an object with an empty target list. Note: this object indicates that the flow is changing, regardless of whether of not the target list will be populated. To indicate no-change in flow, a user should use NONE.

Public Methods

public void addTarget (IEntryPointDescription entryPoint)

Add a target to the list of possible targets.

public void addTargets (Collection<? extends IEntryPointDescription> entryPoints)

Add a collection of targets to the list of possible targets.

public int getDelaySlotCount ()

Get the number of instructions in the delay slot.

Returns
  • number of instructions in delay slot

public List<IEntryPointDescription> getTargets ()

Get the a list of targets. Be careful, this list does not include the fall-through target if it is implied (eg, when flow-info is returned by getRoutineCall(long)) or when its calculation was requested dynamically (via mustComputeFallThrough()).

Returns
  • the list of addresses that must be checked, possibly empty. A null value signifies no-flow information.

public static boolean isAddressInTargets (IFlowInformation flowinfo, long address)

public boolean isBroken ()

Determine if this object does contain flow information.

Returns
  • true is the flow is broken (eg, generic branch)

public boolean isBrokenKnown ()

Determine if this object does contain flow information and all targets are known.

Returns
  • true if the flow is broken and all targets are known

public boolean isBrokenUnknown ()

Determine if this object does contain flow information but has no known targets.

IMPORTANT: if this flow info object is mixed (it specifies having unknown target(s), and also bears known targets), this method returns false.

Returns
  • true if the flow is broken but no targets are known

public boolean mustComputeFallThrough ()

Indicate if the flow information includes a fall-through address (relative to the current instruction) that is not present in the FlowInfo object itself. If this method returns true, the caller must dynamically calculate the fall-through address itself.

Note that the creator of a flowinfo object may decide to add the fall-through (if any) in the flowinfo object target list. However, in some cases, such as branching instructions with delay slot(s), it is simpler to indicate that the branching instruction allows a fall-through flow, but that it should be computer by the client/user, instead of stored or computer by the flowinfo object.

Voluntarily broke JavaBeans convention: named `must` instead of `is`.

Returns
  • true if the flow info does not include a fall-through address, false otherwise

public void setComputeFallThrough (boolean computeFallThrough)

public void setDelaySlotCount (int delaySlotCount)

public String toString ()