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

Function nt_protect_virtual_memory

dumpy/dinvoke/src/lib.rs:659–673  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

657///
658/// It will return the NTSTATUS value returned by the call.
659pub fn nt_protect_virtual_memory (handle: HANDLE, base_address: *mut PVOID, size: *mut usize, new_protection: u32, old_protection: *mut u32) -> i32 {
660
661 unsafe
662 {
663 let ret;
664 let func_ptr: data::NtProtectVirtualMemory;
665 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
666 dynamic_invoke!(ntdll,&lc!("NtProtectVirtualMemory"),func_ptr,ret,handle,base_address,size,new_protection,old_protection);
667
668 match ret {
669 Some(x) => return x,
670 None => return -1,
671 }
672 }
673}
674
675/// Dynamically calls NtQueryInformationProcess.
676///

Callers

nothing calls this directly

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected