Skip to main content

Loader

Trait Loader 

Source
pub trait Loader:
    Debug
    + Send
    + Sync {
Show 13 methods // Required methods fn memory(&self) -> Result<Memory, Error>; fn function_entries(&self) -> Result<Vec<FunctionEntry>, Error>; fn program_entry(&self) -> u64; fn architecture(&self) -> &dyn Architecture; fn as_any(&self) -> &dyn Any; fn symbols(&self) -> Vec<Symbol>; // Provided methods fn function(&self, address: u64) -> Result<Function, Error> { ... } fn function_extended( &self, address: u64, options: &Options, ) -> Result<Function, Error> { ... } fn symbols_map(&self) -> HashMap<u64, Symbol> { ... } fn program(&self) -> Result<Program, Error> { ... } fn program_verbose( &self, options: &Options, ) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error> { ... } fn program_recursive(&self) -> Result<Program, Error> { ... } fn program_recursive_verbose( &self, options: &Options, ) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error> { ... }
}
Expand description

Generic trait for all loaders

Required Methods§

Source

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

Get a model of the memory contained in the binary

Source

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

Get addresses for known function entries

Source

fn program_entry(&self) -> u64

The address program execution should begin at

Source

fn architecture(&self) -> &dyn Architecture

Get the architecture of the binary

Source

fn as_any(&self) -> &dyn Any

Cast loader to Any

Source

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

Get the symbols for this loader

Provided Methods§

Source

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

Lift just one function from the executable

Source

fn function_extended( &self, address: u64, options: &Options, ) -> Result<Function, Error>

Lift just one function from the executable, while also supplying translator options.

Source

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

Get the symbols as a hashmap by address

Source

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

Lift executable into an il::Program.

Individual functions which fail to lift are omitted and ignored.

Source

fn program_verbose( &self, options: &Options, ) -> 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.

Source

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

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.

Source

fn program_recursive_verbose( &self, options: &Options, ) -> 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

Implementors§