2004-10-21 04:48:46 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <windows.h>
|
|
|
|
|
|
|
|
int main()
|
|
|
|
{
|
2009-01-18 06:31:44 +00:00
|
|
|
PBYTE Base;
|
2004-10-21 04:48:46 +00:00
|
|
|
PVOID Ret;
|
2005-05-07 21:24:31 +00:00
|
|
|
|
2004-10-21 04:48:46 +00:00
|
|
|
Base = VirtualAlloc(NULL,
|
|
|
|
1048576,
|
|
|
|
MEM_RESERVE,
|
|
|
|
PAGE_READWRITE);
|
|
|
|
if (Base == NULL)
|
|
|
|
{
|
|
|
|
printf("VirtualAlloc failed 1\n");
|
|
|
|
}
|
2005-05-07 21:24:31 +00:00
|
|
|
|
2004-10-21 04:48:46 +00:00
|
|
|
Ret = VirtualAlloc(Base + 4096,
|
|
|
|
4096,
|
|
|
|
MEM_COMMIT,
|
|
|
|
PAGE_READWRITE);
|
|
|
|
if (Ret == NULL)
|
|
|
|
{
|
|
|
|
printf("VirtualAlloc failed 2\n");
|
|
|
|
}
|
2005-05-07 21:24:31 +00:00
|
|
|
|
2004-10-21 04:48:46 +00:00
|
|
|
Ret = VirtualAlloc(Base + 12288,
|
|
|
|
4096,
|
|
|
|
MEM_COMMIT,
|
|
|
|
PAGE_READWRITE);
|
|
|
|
if (Ret == NULL)
|
|
|
|
{
|
|
|
|
printf("VirtualAlloc failed 3\n");
|
|
|
|
}
|
2005-05-07 21:24:31 +00:00
|
|
|
|
2004-10-21 04:48:46 +00:00
|
|
|
Ret = VirtualAlloc(Base + 20480,
|
|
|
|
4096,
|
|
|
|
MEM_COMMIT,
|
|
|
|
PAGE_READWRITE);
|
|
|
|
if (Ret == NULL)
|
|
|
|
{
|
|
|
|
printf("VirtualAlloc failed 4\n");
|
|
|
|
}
|
2005-05-07 21:24:31 +00:00
|
|
|
|
2004-10-21 04:48:46 +00:00
|
|
|
Ret = VirtualAlloc(Base + 4096,
|
|
|
|
28672,
|
|
|
|
MEM_RESERVE,
|
|
|
|
PAGE_READWRITE);
|
|
|
|
if (Ret == NULL)
|
|
|
|
{
|
|
|
|
printf("VirtualAlloc failed 5\n");
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|