logo
pub struct Analysis<'a, E: UserDefinedError, I: InstructionMeter> {
    pub executable: &'a Executable<E, I>,
    pub instructions: Vec<Insn>,
    pub functions: BTreeMap<usize, (u32, String)>,
    pub cfg_nodes: BTreeMap<usize, CfgNode>,
    pub topological_order: Vec<usize>,
    pub entrypoint: usize,
    pub super_root: usize,
    pub dfg_forward_edges: BTreeMap<DfgNode, BTreeSet<DfgEdge>>,
    pub dfg_reverse_edges: BTreeMap<DfgNode, BTreeSet<DfgEdge>>,
}
Expand description

Result of the executable analysis

Fields

executable: &'a Executable<E, I>

The program which is analyzed

instructions: Vec<Insn>

Plain list of instructions as they occur in the executable

functions: BTreeMap<usize, (u32, String)>

Functions in the executable

cfg_nodes: BTreeMap<usize, CfgNode>

Nodes of the control-flow graph

topological_order: Vec<usize>

Topological order of cfg_nodes

entrypoint: usize

CfgNode where the execution starts

super_root: usize

Virtual CfgNode that reaches all functions

dfg_forward_edges: BTreeMap<DfgNode, BTreeSet<DfgEdge>>

Data flow edges (the keys are DfgEdge sources)

dfg_reverse_edges: BTreeMap<DfgNode, BTreeSet<DfgEdge>>

Data flow edges (the keys are DfgEdge destinations)

Implementations

Analyze an executable statically

Splits the sequence of instructions into basic blocks

Also links the control-flow graph edges between the basic blocks.

Gives the basic blocks names

Generates labels for assembler code

Generates assembler code for the analyzed executable

Iterates over the cfg_nodes while providing the PC range of the function they belong to.

Generates a graphviz DOT of the analyzed executable

Finds the strongly connected components

Generates a topological order as by-product.

Finds the dominance hierarchy of the control-flow graph

Uses the Cooper-Harvey-Kennedy algorithm.

Connect the dependencies between the instructions inside of the basic blocks

Connect the dependencies inbetween the basic blocks

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.