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)
| 618 | /// |
| 619 | /// It will return the NTSTATUS value returned by the call. |
| 620 | pub 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 | /// |
nothing calls this directly
no test coverage detected