Struct LdrProxy

Source
pub struct LdrProxy<'a> {
    pub module: &'a str,
}
Expand description

A helper struct to interact with dynamic module loading with Windows APIs via Proxy.

The LdrProxy struct provides methods to queue work items and manage operations involving dynamic libraries using Windows APIs.

Fields§

§module: &'a str

The name of the module to be loaded or operated on.

Implementations§

Source§

impl<'a> LdrProxy<'a>

Source

pub fn new(module: &'a str) -> Self

Creates a new Loader instance for a given module.

§Arguments
  • module - The name of the module (e.g., "kernel32.dll") to be handled by this loader.
§Return
  • A new instance of the LdrProxy struct.
Source

pub fn work(&self) -> Option<NTSTATUS>

Queues a work item to load the specified module asynchronously.

This method wraps the RtlQueueWorkItem Windows API, dynamically resolving the function and scheduling the specified module to be loaded.

§Returns
  • Some(NTSTATUS) - Status code returned by the RtlQueueWorkItem API if successful.
  • None - If the function or module cannot be resolved.
Source

pub fn timer(&self) -> Option<NTSTATUS>

Schedules a timer to execute the loading of the specified module.

This method uses the RtlCreateTimer API to create a timer queue and schedule the execution of the LoadLibraryA function.

§Returns
  • Some(NTSTATUS) - Status code returned by the RtlCreateTimer API if successful.
  • None - If the function or module cannot be resolved.
Source

pub fn register_wait(&self) -> Option<NTSTATUS>

Registers a wait event to execute the loading of the specified module.

This method uses the RtlRegisterWait API to register an event-based callback that triggers the execution of the LoadLibraryA function.

  • Some(NTSTATUS) - Status code returned by the RtlRegisterWait API if successful.
  • None - If the function or module cannot be resolved.

Auto Trait Implementations§

§

impl<'a> Freeze for LdrProxy<'a>

§

impl<'a> RefUnwindSafe for LdrProxy<'a>

§

impl<'a> Send for LdrProxy<'a>

§

impl<'a> Sync for LdrProxy<'a>

§

impl<'a> Unpin for LdrProxy<'a>

§

impl<'a> UnwindSafe for LdrProxy<'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.