Class FlowGraphBuilder<TInstruction>
- Namespace
- Echo.ControlFlow.Construction
- Assembly
- Echo.ControlFlow.dll
Provides a base for control flow graph builders that depend on a single traversal of the instructions.
public abstract class FlowGraphBuilder<TInstruction> : IFlowGraphBuilder<TInstruction> where TInstruction : notnull
Type Parameters
TInstructionThe type of instructions to store in the control flow graph.
- Inheritance
-
FlowGraphBuilder<TInstruction>
- Implements
-
IFlowGraphBuilder<TInstruction>
- Derived
- Inherited Members
- Extension Methods
Properties
Architecture
Gets the architecture of the instructions to graph.
public abstract IArchitecture<TInstruction> Architecture { get; }
Property Value
- IArchitecture<TInstruction>
Methods
CollectInstructions(long, IEnumerable<long>)
Traverses the instructions and records block headers and successor information about each traversed instruction.
protected abstract IInstructionTraversalResult<TInstruction> CollectInstructions(long entrypoint, IEnumerable<long> knownBlockHeaders)
Parameters
entrypointlongThe address of the first instruction to traverse.
knownBlockHeadersIEnumerable<long>A list of known block headers that should be included in the traversal.
Returns
- IInstructionTraversalResult<TInstruction>
An object containing the result of the traversal, including the block headers and successors of each instruction.
ConstructFlowGraph(long, IEnumerable<long>)
Constructs a control flow graph, starting at the provided entrypoint address.
public ControlFlowGraph<TInstruction> ConstructFlowGraph(long entrypoint, IEnumerable<long> knownBlockHeaders)
Parameters
entrypointlongThe address of the first instruction to traverse.
knownBlockHeadersIEnumerable<long>A list of known block headers that should be included in the traversal.
Returns
- ControlFlowGraph<TInstruction>
The constructed control flow graph, with the entrypoint set to the node containing the entrypoint address provided in
entrypoint.