[−][src]Struct process_memory::LocalMember
Tools for working with local memory
This module provides functions for modifying the memory of a program from within the address space of that program. This may be helpful for debug functions, or for an injected DLL.
Examples:
// We have a variable with some value let x = 4u32; // We make a `LocalMember` that has an offset referring to its location in memory let member = LocalMember::new_offset(vec![&x as *const _ as usize]); // The memory refered to is now the same assert_eq!(&x as *const _ as usize, member.get_offset().unwrap()); // The value of the member is the same as the variable assert_eq!(x, member.read().unwrap()); // We can write to and modify the value of the variable using the member member.write(&6u32).unwrap(); assert_eq!(x, 6u32);
Methods
impl<T: Sized + Copy> LocalMember<T>
[src]
#[must_use]
pub fn new() -> Self
[src]
Creates a new LocalMember
with no offsets. Any calls to
Memory::read
will attempt to read from a null pointer reference.
To set offsets, use Memory::set_offset
offset), or create the LocalMember
using
new_offset
.
#[must_use]
pub fn new_offset(offsets: Vec<usize>) -> Self
[src]
Create a new LocalMember
with a given set of offsets.
Trait Implementations
impl<T: Clone> Clone for LocalMember<T>
[src]
fn clone(&self) -> LocalMember<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Debug> Debug for LocalMember<T>
[src]
impl<T: Default> Default for LocalMember<T>
[src]
fn default() -> LocalMember<T>
[src]
impl<T: Sized + Copy> Memory<T> for LocalMember<T>
[src]
fn set_offset(&mut self, new_offsets: Vec<usize>)
[src]
fn get_offset(&self) -> Result<usize>
[src]
fn read(&self) -> Result<T>
[src]
This will only return a error if one of the offsets gives a null pointer.
fn write(&self, value: &T) -> Result<()>
[src]
This will only return a error if one of the offsets gives a null pointer.
Auto Trait Implementations
impl<T> RefUnwindSafe for LocalMember<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> !Send for LocalMember<T>
impl<T> !Sync for LocalMember<T>
impl<T> Unpin for LocalMember<T>
impl<T> UnwindSafe for LocalMember<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,