lief::runtime::windows

Struct Module

pub struct Module { /* private fields */ }
Expand description

This structure represents a Windows-specific module

Implementations§

§

impl Module

pub fn handle(&self) -> *const c_void

Return the HMODULE handle as an opaque pointer.

Return a nullptr if the function fails or if the handler can’t be found

pub fn dlsym(&self, name: String) -> *const c_void

Resolve the symbol with the given name for the current module

pub fn parse_from_path(&self) -> Option<Binary>

Parse the PE module from its path on the filesystem

pub fn parse_from_path_with_config( &self, config: &ParserConfig, ) -> Option<Binary>

Parse the PE module from its path on the filesystem and given the parser configuration

pub fn parse_from_memory(&self) -> Option<Binary>

Parse the PE module from memory

pub fn parse_from_memory_with_config( &self, config: &ParserConfig, ) -> Option<Binary>

Parse the PE module from memory with the given configuration

Trait Implementations§

§

impl Module for Module

§

fn name(&self) -> String

Name of the module (e.g. libc.so.6, kernel32.dll, libsystem_c.dylib)
§

fn path(&self) -> String

Absolute path to the module file
§

fn imagebase(&self) -> u64

Base address where the module is loaded in memory
§

fn size(&self) -> u64

Virtual size of the current module
§

fn end(&self) -> u64

End address of the module
§

fn contains(&self, addr: u64) -> bool

Check if the current module contains the given address
§

fn dump(&self) -> Vec<u8>

Return the content of the module as it is currently mapped in memory. Read more
§

fn dump_to_file<P: AsRef<Path>>(&self, path: P) -> Vec<u8>

Same as Module::dump but also write the content into the file located at path.

Auto Trait Implementations§

§

impl Freeze for Module

§

impl RefUnwindSafe for Module

§

impl !Send for Module

§

impl !Sync for Module

§

impl Unpin for Module

§

impl UnwindSafe for Module

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.