Struct Pointer

Source
pub struct Pointer {
    pub debug: bool,
    /* private fields */
}
Expand description

Represents a pointer path that is dynamically resolved each read/write operation. This ensures that the pointer is always valid. Race conditions can occur and the pointer could encounter a null pointer along the path. Should always be constructed via the Process struct.

§Example

use mem_rs::prelude::*;

let mut process = Process::new("name_of_process.exe");
process.refresh()?;
let pointer = process.create_pointer(0x1234, vec![0]);
let data = pointer.read_u8_rel(Some(0x1234));

Fields§

§debug: bool

Set this to true to print each memory address while resolving the pointer path.

Implementations§

Source§

impl Pointer

Source

pub fn get_base_address(&self) -> usize

Get the base address of this pointer, without resolving offsets.

Trait Implementations§

Source§

impl BaseReadWrite for Pointer

Source§

fn read_memory_rel(&self, offset: Option<usize>, buffer: &mut [u8]) -> bool

Read memory relative to the object’s location in memory. Supports an optional offset. Read more
Source§

fn write_memory_rel(&self, offset: Option<usize>, buffer: &[u8]) -> bool

Write memory relative to the object’s location in memory. Supports an optional offset. Read more
Source§

fn read_memory_abs(&self, address: usize, buffer: &mut [u8]) -> bool

Read memory from an absolute address Read more
Source§

fn write_memory_abs(&self, address: usize, buffer: &[u8]) -> bool

Write memory to an absolute address Read more
Source§

fn read_with_handle( &self, handle: HANDLE, address: usize, buffer: &mut [u8], ) -> bool

Read memory into a buffer from a process handle
Source§

fn write_with_handle( &self, handle: HANDLE, address: usize, buffer: &[u8], ) -> bool

Write from a buffer ino memory from a process handle
Source§

impl Default for Pointer

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl ReadWrite for Pointer

Source§

fn read_i8_rel(&self, address: Option<usize>) -> i8

Relatively read an i8 from an optional offset Read more
Source§

fn read_i32_rel(&self, address: Option<usize>) -> i32

Relatively read an i32 from an optional offset Read more
Source§

fn read_i64_rel(&self, address: Option<usize>) -> i64

Relatively read an i64 from an optional offset Read more
Source§

fn read_u8_rel(&self, address: Option<usize>) -> u8

Relatively read an u8 from an optional offset Read more
Source§

fn read_u32_rel(&self, address: Option<usize>) -> u32

Relatively read an u32 from an optional offset Read more
Source§

fn read_u64_rel(&self, address: Option<usize>) -> u64

Relatively read an u64 from an optional offset Read more
Source§

fn read_f32_rel(&self, address: Option<usize>) -> f32

Relatively read an f32 from an optional offset Read more
Source§

fn read_f64_rel(&self, address: Option<usize>) -> f64

Relatively read an f64 from an optional offset Read more
Source§

fn read_bool_rel(&self, address: Option<usize>) -> bool

Relatively read a bool from an optional offset. A single byte is read from the resolved address, the value of the bool is true if this byte is non-zero. Read more
Source§

fn write_i8_rel(&self, address: Option<usize>, value: i8)

Relatively write an i8 to an optional offset Read more
Source§

fn write_i32_rel(&self, address: Option<usize>, value: i32)

Relatively write an i32 to an optional offset Read more
Source§

fn write_i64_rel(&self, address: Option<usize>, value: i64)

Relatively write an i64 to an optional offset Read more
Source§

fn write_u8_rel(&self, address: Option<usize>, value: u8)

Relatively write an u8 to an optional offset Read more
Source§

fn write_u32_rel(&self, address: Option<usize>, value: u32)

Relatively write an u32 to an optional offset Read more
Source§

fn write_u64_rel(&self, address: Option<usize>, value: u64)

Relatively write an u64 to an optional offset Read more
Source§

fn write_f32_rel(&self, address: Option<usize>, value: f32)

Relatively write an f32 to an optional offset Read more
Source§

fn write_f64_rel(&self, address: Option<usize>, value: f64)

Relatively write an f64 to an optional offset Read more

Auto Trait Implementations§

§

impl Freeze for Pointer

§

impl !RefUnwindSafe for Pointer

§

impl !Send for Pointer

§

impl !Sync for Pointer

§

impl Unpin for Pointer

§

impl !UnwindSafe for Pointer

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.