pub trait ProcessMemory {
    // Required method
    fn read(&self, addr: usize, buf: &mut [u8]) -> Result<(), Error>;

    // Provided methods
    fn copy(&self, addr: usize, length: usize) -> Result<Vec<u8>, Error> { ... }
    fn copy_struct<T>(&self, addr: usize) -> Result<T, Error> { ... }
    fn copy_pointer<T>(&self, ptr: *const T) -> Result<T, Error> { ... }
    fn copy_vec<T>(&self, addr: usize, length: usize) -> Result<Vec<T>, Error> { ... }
}

Required Methods§

source

fn read(&self, addr: usize, buf: &mut [u8]) -> Result<(), Error>

Copies memory from another process into an already allocated byte buffer

Provided Methods§

source

fn copy(&self, addr: usize, length: usize) -> Result<Vec<u8>, Error>

Copies a series of bytes from another process. Main difference with ‘read’ is that this will allocate memory for you

source

fn copy_struct<T>(&self, addr: usize) -> Result<T, Error>

Copies a structure from another process

source

fn copy_pointer<T>(&self, ptr: *const T) -> Result<T, Error>

Given a pointer that points to a struct in another process, returns the struct

source

fn copy_vec<T>(&self, addr: usize, length: usize) -> Result<Vec<T>, Error>

Copies a series of bytes from another process into a vector of structures of type T.

Object Safety§

This trait is not object safe.

Implementors§