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)
| 672 | /// |
| 673 | /// It will return the NTSTATUS value returned by the call. |
| 674 | pub 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 | /// |
no test coverage detected