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

Function nt_write_virtual_memory

dinvoke/src/lib.rs:674–689  ·  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

672///
673/// It will return the NTSTATUS value returned by the call.
674pub fn nt_write_virtual_memory (handle: HANDLE, base_address: PVOID, buffer: PVOID, size: usize, bytes_written: *mut usize) -> i32 {
675
676 unsafe
677 {
678 let ret;
679 let func_ptr: data::NtWriteVirtualMemory;
680 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
681 dynamic_invoke!(ntdll,&lc!("NtWriteVirtualMemory"),func_ptr,ret,handle,base_address,buffer,size,bytes_written);
682
683 match ret {
684 Some(x) => return x,
685 None => return -1,
686 }
687 }
688
689}
690
691/// Dynamically calls NtAllocateVirtualMemory.
692///

Callers 1

mainFunction · 0.85

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected