/// Evaluates the pointer chain and attempts to write the datum.
/// Returns `None` if either the evaluation or the write failed.
Evaluates the pointer chain and attempts to write the datum.
Returns `None` if either the evaluation or the write failed.
Evaluates the pointer chain and attempts to write the datum . Returns ` None ` if either the evaluation or the write failed .
pub fn write(&self, mut value: T) -> Option<()> {
    if let Some(ptr) = self.eval() {
      let result = unsafe {
        WriteProcessMemory(
          self.proc as _,
          ptr as _,
          &mut value as *mut _ as _,
          std::mem::size_of::<T>(),
          null_mut(),
        )
      };
      match result {
        0 => None,
        _ => Some(()),
      }
    } else {
      None
    }
  }
pub fn write ( & self , mut value : T ) -> Option < ( ) > { if let Some ( ptr ) = self . eval ( ) { let result = unsafe { WriteProcessMemory ( self . proc as _ , ptr as _ , & mut value as * mut _ as _ , std :: mem :: size_of :: < T > ( ) , null_mut ( ) , ) } ; match result { 0 => None , _ => Some ( ( ) ) , } } else { None } }
Evaluates the pointer chain and attempts to write the datum.
Evaluates the pointer chain and attempts to write the datum .
&self
value
T