[][src]Trait falcon::loader::Loader

pub trait Loader: Debug + Send + Sync {
    fn memory(&self) -> Result<Memory>;
fn function_entries(&self) -> Result<Vec<FunctionEntry>>;
fn program_entry(&self) -> u64;
fn architecture(&self) -> &dyn Architecture;
fn as_any(&self) -> &dyn Any;
fn symbols(&self) -> Vec<Symbol>; fn function(&self, address: u64) -> Result<Function> { ... }
fn symbols_map(&self) -> HashMap<u64, Symbol> { ... }
fn program(&self) -> Result<Program> { ... }
fn program_verbose(
        &self
    ) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error> { ... }
fn program_recursive(&self) -> Result<Program> { ... }
fn program_recursive_verbose(
        &self
    ) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error> { ... } }

Generic trait for all loaders

Required methods

fn memory(&self) -> Result<Memory>

Get a model of the memory contained in the binary

fn function_entries(&self) -> Result<Vec<FunctionEntry>>

Get addresses for known function entries

fn program_entry(&self) -> u64

The address program execution should begin at

fn architecture(&self) -> &dyn Architecture

Get the architecture of the binary

fn as_any(&self) -> &dyn Any

Cast loader to Any

fn symbols(&self) -> Vec<Symbol>

Get the symbols for this loader

Loading content...

Provided methods

fn function(&self, address: u64) -> Result<Function>

Lift just one function from the executable

fn symbols_map(&self) -> HashMap<u64, Symbol>

Get the symbols as a hashmap by address

fn program(&self) -> Result<Program>

Lift executable into an il::Program.

Individual functions which fail to lift are omitted and ignored.

fn program_verbose(
    &self
) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error>

Lift executable into an il::Program.

Errors encountered while lifting specific functions are collected, and returned with the FunctionEntry identifying the function. Only catastrophic errors should cause this function call to fail.

fn program_recursive(&self) -> Result<Program>

Lift executable into an il::Program, while recursively resolving branch targets into functions.

program_recursive silently drops any functions that cause lifting errors. If you care about those, use program_recursive_verbose.

fn program_recursive_verbose(
    &self
) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error>

Lift executable into an il::Program, while recursively resolving branch targets into functions.

Works in a similar manner to program_recursive

Loading content...

Implementors

impl Loader for Elf[src]

impl Loader for ElfLinker[src]

impl Loader for Json[src]

impl Loader for Pe[src]

Loading content...