AttachedProcess

Struct 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::Context

Implementations§

Source§

impl<'a, T> AttachedProcess<'a, T>
where T: GetContext,

Source

pub fn new_owned(api: T, context: T::Context) -> Self

Source

pub fn new(api: &'a T, context: T::Context) -> Self

Source

pub fn api(&self) -> &T

Source

pub fn context(&self) -> &T::Context

Trait Implementations§

Source§

impl<'a, T> Clone for AttachedProcess<'a, T>
where T: GetContext + Clone, T::Context: Clone,

Source§

fn clone(&self) -> AttachedProcess<'a, T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T> MemoryAllocate for AttachedProcess<'_, T>

Source§

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.
Source§

fn free(&self, base: u64, size: u64) -> Result<(), MemoryAllocateError>

Frees allocated memory at the specified address and size.
Source§

impl<T> MemoryProtect for AttachedProcess<'_, T>

Source§

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
Source§

impl<T> MemoryRead for AttachedProcess<'_, T>
where T: MemoryReadPid,

Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

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
Source§

impl<T> MemoryWrite for AttachedProcess<'_, T>
where T: MemoryWritePid,

Source§

fn try_write_bytes(&self, address: u64, buffer: &[u8]) -> Option<()>

Writes bytes from the buffer into the process at the specified address. Returns None if the address is not valid
Source§

impl<T> ModuleList for AttachedProcess<'_, T>
where T: ModuleListPid,

Source§

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
Source§

fn get_module(&self, name: &str) -> Option<Module>

Returns a single module by name. If the module name does not exist, returns None
Source§

fn get_main_module(&self) -> Module

Gets the main module from the process.
Source§

impl<T> ProcessInfo for AttachedProcess<'_, T>
where T: ProcessInfoPid,

Auto Trait Implementations§

§

impl<'a, T> Freeze for AttachedProcess<'a, T>
where <T as GetContext>::Context: Freeze, T: Freeze,

§

impl<'a, T> RefUnwindSafe for AttachedProcess<'a, T>

§

impl<'a, T> Send for AttachedProcess<'a, T>
where <T as GetContext>::Context: Send, T: Send + Sync,

§

impl<'a, T> Sync for AttachedProcess<'a, T>
where <T as GetContext>::Context: Sync, T: Sync,

§

impl<'a, T> Unpin for AttachedProcess<'a, T>
where <T as GetContext>::Context: Unpin, T: Unpin,

§

impl<'a, T> UnwindSafe for AttachedProcess<'a, T>

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> MemoryReadExt for T
where T: MemoryRead,

Source§

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
Source§

unsafe fn try_read_unchecked<T>(&self, address: u64) -> Option<T>

Reads any type T from the process without the restriction of Pod
Source§

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
Source§

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.
Source§

fn try_read_bytes_into_chunked<const CHUNK_SIZE: usize>( &self, address: u64, buf: &mut [u8], ) -> Option<()>

Reads bytes from the process in chunks with the specified size
Source§

fn try_read_bytes_into_chunked_fallible<const CHUNK_SIZE: usize>( &self, address: u64, buf: &mut [u8], ) -> Option<usize>

Reads bytes from the process in chunks with the specified size. The function will return Some(n) with the number of bytes read unless every single chunk fails
Source§

impl<T> MemoryWriteExt for T
where T: MemoryWrite,

Source§

fn try_write<T: Pod>(&self, address: u64, buffer: &T) -> Option<()>

Returns None if the address is not valid
Source§

unsafe fn try_write_unchecked<T>(&self, address: u64, buffer: &T) -> Option<()>

Writes any type T to the process without the restriction of Pod
Source§

fn write<T: Pod>(&self, address: u64, buffer: &T)

Writes bytes to the process at the specified address with the value of type T. Panics if the address is not valid
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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.