Dynamically calls NtProtectVirtualMemory. It will return the NTSTATUS value returned by the call.
(handle: HANDLE, base_address: *mut PVOID, size: *mut usize, new_protection: u32, old_protection: *mut u32)
| 711 | /// |
| 712 | /// It will return the NTSTATUS value returned by the call. |
| 713 | pub fn nt_protect_virtual_memory (handle: HANDLE, base_address: *mut PVOID, size: *mut usize, new_protection: u32, old_protection: *mut u32) -> i32 { |
| 714 | |
| 715 | unsafe |
| 716 | { |
| 717 | let ret; |
| 718 | let func_ptr: data::NtProtectVirtualMemory; |
| 719 | let ntdll = get_module_base_address(&lc!("ntdll.dll")); |
| 720 | dynamic_invoke!(ntdll,&lc!("NtProtectVirtualMemory"),func_ptr,ret,handle,base_address,size,new_protection,old_protection); |
| 721 | |
| 722 | match ret { |
| 723 | Some(x) => return x, |
| 724 | None => return -1, |
| 725 | } |
| 726 | } |
| 727 | } |
| 728 | |
| 729 | /// Dynamically calls NtQueryInformationProcess. |
| 730 | /// |
no test coverage detected