, . , stdlib.h C, , malloc, 32 . , , , .
tristopia, . .
C, ,
a.c
call_test1()
{
char* temp;
temp = (char *)test1();
}
b.c
include stdlib.h
char* test1()
{
char *str;
test = (char *)malloc(60);
return str;
}
str test1(), 64- ( rx ( ) windbg "r rx" ), temp, 32- ).
-
a.c
char * test1();
call_test1()
{
char* temp;
temp = test1();
}
b.c
include stdlib.h
char* test1()
{
char *str;
test = (char *)malloc(60);
return str;
}
, .
64
- % p % lx 64- .
- Windows,
C/++ 64- EXE DLL, AllocationPreference.
To force allocation of allocations from higher addresses to lower addresses for testing purposes, specify the following registry value MEM_TOP_DOWNwhen calling VirtualAllocor set the parameter 0x100000:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Memory Management\AllocationPreference
source
share