Struct memlib::AttachedProcess
source · [−]pub struct AttachedProcess<'a, T>where
T: GetContext,{
pub api: MaybeOwned<'a, T>,
pub context: T::Context,
}Fields
api: MaybeOwned<'a, T>context: T::ContextImplementations
Trait Implementations
sourceimpl<'a, T: Clone> Clone for AttachedProcess<'a, T>where
T: GetContext,
T::Context: Clone,
impl<'a, T: Clone> Clone for AttachedProcess<'a, T>where
T: GetContext,
T::Context: Clone,
sourcefn clone(&self) -> AttachedProcess<'a, T>
fn clone(&self) -> AttachedProcess<'a, T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresourceimpl<T> MemoryAllocate for AttachedProcess<'_, T>where
T: MemoryAllocatePid,
impl<T> MemoryAllocate for AttachedProcess<'_, T>where
T: MemoryAllocatePid,
sourcefn allocate(
&self,
size: u64,
protection: MemoryProtection
) -> Result<u64, MemoryAllocateError>
fn allocate(
&self,
size: u64,
protection: MemoryProtection
) -> Result<u64, MemoryAllocateError>
Allocates size bytes of memory in the process with the specified protection.
Returns the allocated memory or an error. Read more
sourceimpl<T> MemoryProtect for AttachedProcess<'_, T>where
T: MemoryProtectPid,
impl<T> MemoryProtect for AttachedProcess<'_, T>where
T: MemoryProtectPid,
sourcefn set_protection(
&self,
range: MemoryRange,
protection: MemoryProtection
) -> Result<MemoryProtection, MemoryProtectError>
fn set_protection(
&self,
range: MemoryRange,
protection: MemoryProtection
) -> Result<MemoryProtection, MemoryProtectError>
Sets the protection of the memory range to the specified protection.
Returns the old memory protection or an error Read more
sourceimpl<T> MemoryRead for AttachedProcess<'_, T>where
T: MemoryReadPid,
impl<T> MemoryRead for AttachedProcess<'_, T>where
T: MemoryReadPid,
sourcefn try_read_bytes_into(&self, address: u64, buffer: &mut [u8]) -> Option<()>
fn try_read_bytes_into(&self, address: u64, buffer: &mut [u8]) -> Option<()>
Reads bytes from the process at the specified address into a buffer.
Returns None if the address is not valid Read more
sourcefn try_read_bytes(&self, address: u64, len: usize) -> Option<Vec<u8>>
fn try_read_bytes(&self, address: u64, len: usize) -> Option<Vec<u8>>
Reads bytes from the process at the specified address and returns the bytes as a Vector.
Returns none if the address is not valid Read more
sourcefn dump_memory(&self, range: MemoryRange) -> Option<Vec<u8>>
fn dump_memory(&self, range: MemoryRange) -> Option<Vec<u8>>
Dumps a memory range into a Vector. If any part of the memory range is not
valid, it will return None Read more
sourcefn valid_address(&self, address: u64) -> bool
fn valid_address(&self, address: u64) -> bool
Returns true if the specified address is valid. By default reads one byte at that location
and returns the success value Read more
sourcefn try_read_string(&self, address: u64) -> Option<Result<String, FromUtf8Error>>
fn try_read_string(&self, address: u64) -> Option<Result<String, FromUtf8Error>>
Reads a string at the specified location with char length of 1.
If the address is valid or there is no null terminator
in MAX_STRING_SIZE characters, it will return None Read more
sourcefn try_read_string_wide(
&self,
address: u64
) -> Option<Result<String, FromUtf16Error>>
fn try_read_string_wide(
&self,
address: u64
) -> Option<Result<String, FromUtf16Error>>
Reads a wide string at the specified location with char length of 1.
If the address is valid or there is no null terminator
in MAX_STRING_SIZE characters, it will return None Read more
sourceimpl<T> MemoryWrite for AttachedProcess<'_, T>where
T: MemoryWritePid,
impl<T> MemoryWrite for AttachedProcess<'_, T>where
T: MemoryWritePid,
sourceimpl<T> ModuleList for AttachedProcess<'_, T>where
T: ModuleListPid,
impl<T> ModuleList for AttachedProcess<'_, T>where
T: ModuleListPid,
sourcefn get_module_list(&self) -> Vec<Module>
fn get_module_list(&self) -> Vec<Module>
Returns a list of all modules. If the implementor can only
provide a single module based on the name, this function should panic Read more
sourcefn get_module(&self, name: &str) -> Option<Module>
fn get_module(&self, name: &str) -> Option<Module>
Returns a single module by name.
If the module name does not exist, returns None Read more
sourcefn get_main_module(&self) -> Module
fn get_main_module(&self) -> Module
Gets the main module from the process.
sourceimpl<T> ProcessInfo for AttachedProcess<'_, T>where
T: ProcessInfoPid,
impl<T> ProcessInfo for AttachedProcess<'_, T>where
T: ProcessInfoPid,
fn process_name(&self) -> String
fn peb_base_address(&self) -> u64
fn pid(&self) -> u32
Auto Trait Implementations
impl<'a, T> RefUnwindSafe for AttachedProcess<'a, T>where
T: RefUnwindSafe,
<T as GetContext>::Context: RefUnwindSafe,
impl<'a, T> Send for AttachedProcess<'a, T>where
T: Send + Sync,
<T as GetContext>::Context: Send,
impl<'a, T> Sync for AttachedProcess<'a, T>where
T: Sync,
<T as GetContext>::Context: Sync,
impl<'a, T> Unpin for AttachedProcess<'a, T>where
T: Unpin,
<T as GetContext>::Context: Unpin,
impl<'a, T> UnwindSafe for AttachedProcess<'a, T>where
T: UnwindSafe + RefUnwindSafe,
<T as GetContext>::Context: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> MemoryReadExt for Twhere
T: MemoryRead,
impl<T> MemoryReadExt for Twhere
T: MemoryRead,
sourcefn try_read<T: Pod>(&self, address: u64) -> Option<T>
fn try_read<T: Pod>(&self, address: u64) -> Option<T>
Reads bytes from the process at the specified address into a value of type T.
Returns None if the address is not valid Read more
sourceunsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T>
unsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T>
Reads any type T from the process without the restriction of Pod
sourcefn read<T: Pod>(&self, address: u64) -> T
fn read<T: Pod>(&self, address: u64) -> T
Reads bytes from the process at the specified address into a value of type T.
Panics if the address is not valid Read more
sourcefn try_read_bytes_const<const LEN: usize>(
&self,
address: u64
) -> Option<[u8; LEN]>
fn try_read_bytes_const<const LEN: usize>(
&self,
address: u64
) -> Option<[u8; LEN]>
Reads a const number of bytes from the process returning a stack allocated array.