pub struct Process {
pub name: String,
pub id: u32,
pub architecture: Architecture,
}Fields§
§name: String§id: u32§architecture: ArchitectureImplementations§
Source§impl Process
impl Process
Sourcepub fn fetch_loaded_modules(&self) -> Vec<Module>
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
);
}
}Sourcepub fn fetch_loaded_module(&self, module_name: &str) -> Option<Module>
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§
Auto Trait Implementations§
impl Freeze for Process
impl RefUnwindSafe for Process
impl Send for Process
impl Sync for Process
impl Unpin for Process
impl UnsafeUnpin for Process
impl UnwindSafe for Process
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more