smallwolf
May 20th, 2010, 01:07 AM
hello:
i am new in assembly language, and i want to test the "jmp" instruction, try to jmp to the function that i define, and failed. what's wrong with my code?
here's the code:
using wxDevC++, windows xp sp3
void ShowMessage();
int main(int argc, char *argv[])
{
printf("%p",ShowMessage);
printf("\n");
asm(
"jmp 0x00401332;"
);
// 0x00401332 is ShowMessage address
system("PAUSE");
return 0;
}
void ShowMessage()
{
MessageBox (0, "ShowMessage()!\n", "Hi", MB_ICONINFORMATION);
}
i am new in assembly language, and i want to test the "jmp" instruction, try to jmp to the function that i define, and failed. what's wrong with my code?
here's the code:
using wxDevC++, windows xp sp3
void ShowMessage();
int main(int argc, char *argv[])
{
printf("%p",ShowMessage);
printf("\n");
asm(
"jmp 0x00401332;"
);
// 0x00401332 is ShowMessage address
system("PAUSE");
return 0;
}
void ShowMessage()
{
MessageBox (0, "ShowMessage()!\n", "Hi", MB_ICONINFORMATION);
}