Why doesn't this code print "test"?
#include <stdio.h>
#include <stdlib.h>
void foo ( void ) {
printf("test\n");
}
__declspec(naked)
void bar ( void ) {
asm {
push 0x000FFFFF
call malloc
pop ecx
push eax
add eax, 0x000EFFFF
mov ecx, esp
mov esp, eax
push ecx
call foo
pop esp
call free
pop ecx
ret
}
}
int main(int argc, char* argv[])
{
bar();
return 0;
}