void foo(int a)
{ printf ("In foo, a = %d\n", a); }
unsigned char code[9];
* ((DWORD *) &code[0]) = 0x042444FF; /* inc dword ptr [esp+4] */
code[4] = 0xe9; /* JMP */
* ((DWORD *) &code[5]) = (DWORD) &foo - (DWORD) &code[0] - 9;
void (*pf)(int/* a*/) = (void (*)(int)) &code[0];
pf (6);
Anyone knows where in the above code 6
is incremented by 1
?