Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

VirtualAllocExNuma (kernel32)
 
.
Summary
The VirtualAllocExNuma API - Reserves, commits, or changes the state of a region of memory within the virtual address space of the specified process, and specifies the NUMA node for the physical memory.

C# Signature:

[DllImport("kernel32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAllocExNuma(IntPtr hProcess, IntPtr lpAddress,uint dwSize, UInt32 flAllocationType, UInt32 flProtect, UInt32 nndPreferred);

VB Signature:

None.

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

None.

Tips & Tricks:

Please add some!

Sample Code:

    LPVOID mem;
    //virtualallocexnuma is used for bypass sandbox. As this api is not present inside sandox environmrnt.
    mem = VirtualAllocExNuma(GetCurrentProcess(), NULL, 1000, MEM_COMMIT | MEM_RESERVE, 0x4, 0);

Please add some!

    // if inside sandbox then virtualallocexnuma will fail and mem will be null. if inside normal machine then it will return address within current process adress space.
    // Therefore effectively we are preventing execution of out exploit in AV's sandbox
    if (!mem)
    {
        exit(0);
    }

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions