win_mem::process

Struct Process

Source
pub struct Process { /* private fields */ }
Expand description

Represents a system process, posses a PID, name and an open HANDLE

Implementations§

Source§

impl Process

Source

pub fn find(name: &str) -> WinResult<Self>

Find a Process from it’s executable’s name [Reference(s)]: https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32firstw https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-process32nextw https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/ns-tlhelp32-processentry32w

Source

pub fn find_module(&self, name: &str) -> WinResult<Module>

Find a process’s module (dll) by it’s name [Reference(s)]: https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-module32firstw https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/nf-tlhelp32-module32nextw https://docs.microsoft.com/en-us/windows/win32/api/tlhelp32/ns-tlhelp32-moduleentry32w

Source

pub fn write_mem<T>(&self, buffer: &T, address: DWORD) -> WinResult<()>

Write to a process’s memory, not relative to module offset [Reference]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-writeprocessmemory

Source

pub fn write_mem_relative<T>( &self, buffer: &T, module_name: &str, address: DWORD, ) -> WinResult<()>

Write to a process’s memory relative to the offset of a module

Source

pub fn read_mem<T>(&self, address: DWORD) -> WinResult<T>

Read a process’s memory, not relative to module offset [Reference]: https://docs.microsoft.com/en-us/windows/win32/api/memoryapi/nf-memoryapi-readprocessmemory

Source

pub fn read_mem_relative<T>( &self, module_name: &str, address: DWORD, ) -> WinResult<T>

Read a process’s memory address relative to the offset of a module

Source

pub fn name(&self) -> &str

Source

pub fn pid(&self) -> DWORD

Source

pub fn handle(&self) -> HANDLE

Trait Implementations§

Source§

impl Drop for Process

Close Process HANDLE when Process goes out of scope or the program exits/panics

Source§

fn drop(&mut self)

Executes the destructor for this type. 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, 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.