Skip to main content

Process

Struct Process 

Source
pub struct Process {
    pub name: String,
    pub id: u32,
    pub architecture: Architecture,
}

Fields§

§name: String§id: u32§architecture: Architecture

Implementations§

Source§

impl Process

Source

pub fn fetch_loaded_modules(&self) -> Vec<Module>

Iterates over each loaded module inside of the process

§Returns

A Vec<Module> containing a Module for each loaded module, or an empty Vec if enumeration fails.

§Example
use win_iter::{fetch_loaded_modules, fetch_process};

fn main() {
    let proc = fetch_process("brave.exe");
    for loaded_mod in proc.fetch_loaded_modules().iter() {
        println!("Found module: {}, base address: {:#X}",
            loaded_mod.name, loaded_mod.base_address as usize
        );
    }
}
Source

pub fn fetch_loaded_module(&self, module_name: &str) -> Option<Module>

Iterates over each loaded module inside of the process to find the target.

§Arguments
  • module_name - The module name to search for.
§Returns

An Option<Module> if the module was found or None.

§Example
use win_iter::{fetch_loaded_module, fetch_process};

fn main() {
    let proc = fetch_process("brave.exe");
    if let Some(ntdll) = proc.fetch_loaded_module("ntdll.dll") {
        println!("ntdll: {:#X}", ntdll.base_address as usize);
    } else {
        println!("ntdll.dll wasn't found!");
    }
}

Trait Implementations§

Source§

impl Display for Process

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.