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

Function nt_allocate_virtual_memory

dumpy/dinvoke/src/lib.rs:640–654  ·  view source on GitHub ↗

Dynamically calls NtAllocateVirtualMemory. It will return the NTSTATUS value returned by the call.

(handle: HANDLE, base_address: *mut PVOID, zero_bits: usize, size: *mut usize, allocation_type: u32, protection: u32)

Source from the content-addressed store, hash-verified

638///
639/// It will return the NTSTATUS value returned by the call.
640pub fn nt_allocate_virtual_memory (handle: HANDLE, base_address: *mut PVOID, zero_bits: usize, size: *mut usize, allocation_type: u32, protection: u32) -> i32 {
641
642 unsafe
643 {
644 let ret;
645 let func_ptr: data::NtAllocateVirtualMemory;
646 let ntdll = get_module_base_address(&lc!("ntdll.dll"));
647 dynamic_invoke!(ntdll,&lc!("NtAllocateVirtualMemory"),func_ptr,ret,handle,base_address,zero_bits,size,allocation_type,protection);
648
649 match ret {
650 Some(x) => return x,
651 None => return -1,
652 }
653 }
654}
655
656/// Dynamically calls NtProtectVirtualMemory.
657///

Callers

nothing calls this directly

Calls 1

get_module_base_addressFunction · 0.85

Tested by

no test coverage detected