// testjmp.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <stdio.h>
void test()
{
__asm
{
pop edi
pop esi
pop ebx
pop ebp
jmp DWORD ptr[esp]
}
}
int main(int argc, char* argv[])
{
test();
printf("Hello World!\n");
return 0;
}
/////////////////////////
// 输出
/*
Hello World!
Hello World!
Press any key to continue
*/
/* 反汇编内容
00401000 $ 55 push ebp
00401001 . 8BEC mov ebp, esp
00401003 . 53 push ebx
00401004 . 56 push esi
00401005 . 57 push edi
00401006 . 8BE5 mov esp, ebp
00401008 . 5D pop ebp
00401009 . FF2424 jmp dword ptr [esp]
0040100C . 5F pop edi
0040100D . 5E pop esi
0040100E . 5B pop ebx
0040100F . 5D pop ebp
00401010 . C3 retn