ModuleQuery

Struct ModuleQuery 

Source
pub struct ModuleQuery<'a> { /* private fields */ }
Expand description

module query builder

Implementations§

Source§

impl<'a> ModuleQuery<'a>

Source

pub fn new(peb: &'a Peb) -> Self

create new query for given PEB

Source

pub fn find_by_name(&self, name: &str) -> Result<Module<'a>>

find module by name (case-insensitive)

searches by base name (e.g., “ntdll.dll”, not full path)

Source

pub fn find_by_hash(&self, hash: u32) -> Result<Module<'a>>

find module by hash of name (for API hashing)

hash is computed lowercase

Source

pub fn find_by_address(&self, address: usize) -> Result<Module<'a>>

find module containing an address

Source

pub fn find_by_base(&self, base: usize) -> Result<Module<'a>>

find module by base address (exact match)

Source

pub fn find_by_path_contains(&self, substring: &str) -> Result<Module<'a>>

find module by partial path match

Source

pub fn ntdll(&self) -> Result<Module<'a>>

get ntdll.dll module

Source

pub fn kernel32(&self) -> Result<Module<'a>>

get kernel32.dll module

Source

pub fn kernelbase(&self) -> Result<Module<'a>>

get kernelbase.dll module

Source

pub fn current_module(&self) -> Result<Module<'a>>

get current executable module

Source

pub fn find_all<F>(&self, predicate: F) -> Result<Vec<Module<'a>>>
where F: Fn(&Module<'_>) -> bool,

find all modules matching a predicate

Source

pub fn is_loaded(&self, name: &str) -> bool

check if a module is loaded

Auto Trait Implementations§

§

impl<'a> Freeze for ModuleQuery<'a>

§

impl<'a> RefUnwindSafe for ModuleQuery<'a>

§

impl<'a> Send for ModuleQuery<'a>

§

impl<'a> Sync for ModuleQuery<'a>

§

impl<'a> Unpin for ModuleQuery<'a>

§

impl<'a> UnwindSafe for ModuleQuery<'a>

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.