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§
Sourcefn function_entries(&self) -> Result<Vec<FunctionEntry>, Error>
fn function_entries(&self) -> Result<Vec<FunctionEntry>, Error>
Get addresses for known function entries
Sourcefn program_entry(&self) -> u64
fn program_entry(&self) -> u64
The address program execution should begin at
Sourcefn architecture(&self) -> &dyn Architecture
fn architecture(&self) -> &dyn Architecture
Get the architecture of the binary
Provided Methods§
Sourcefn function(&self, address: u64) -> Result<Function, Error>
fn function(&self, address: u64) -> Result<Function, Error>
Lift just one function from the executable
Sourcefn function_extended(
&self,
address: u64,
options: &Options,
) -> Result<Function, Error>
fn function_extended( &self, address: u64, options: &Options, ) -> Result<Function, Error>
Lift just one function from the executable, while also supplying translator options.
Sourcefn symbols_map(&self) -> HashMap<u64, Symbol>
fn symbols_map(&self) -> HashMap<u64, Symbol>
Get the symbols as a hashmap by address
Sourcefn program(&self) -> Result<Program, Error>
fn program(&self) -> Result<Program, Error>
Lift executable into an il::Program.
Individual functions which fail to lift are omitted and ignored.
Sourcefn program_verbose(
&self,
options: &Options,
) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error>
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.
Sourcefn program_recursive(&self) -> Result<Program, Error>
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.
Sourcefn program_recursive_verbose(
&self,
options: &Options,
) -> Result<(Program, Vec<(FunctionEntry, Error)>), Error>
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