MCPcopy Create free account
hub / github.com/Kudaes/Dumpy / nt_write_virtual_memory

Function nt_write_virtual_memory

dumpy/dinvoke/src/lib.rs:620–635  ·  view source on GitHub ↗

Dynamically calls NtWriteVirtualMemory. It will return the NTSTATUS value returned by the call.

(handle: HANDLE, base_address: PVOID, buffer: PVOID, size: usize, bytes_written: *mut usize)

Source from the content-addressed store, hash-verified

618///
619/// It will return the NTSTATUS value returned by the call.
620pub fn nt_write_virtual_memory (handle: HANDLE, base_address: PVOID, buffer: PVOID, size: usize, bytes_written: *mut usize) -> i32 {
621
622 unsafe
623 {
624 let ret;
625 let func_ptr: data::NtWriteVirtualMemory;
626 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
627 dynamic_invoke!(ntdll,&lc!("NtWriteVirtualMemory"),func_ptr,ret,handle,base_address,buffer,size,bytes_written);
628
629 match ret {
630 Some(x) => return x,
631 None => return -1,
632 }
633 }
634
635}
636
637/// Dynamically calls NtAllocateVirtualMemory.
638///

Callers

nothing calls this directly

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected