16,472
社区成员
发帖
与我相关
我的任务
分享
#include "stdafx.h"
char c[]="caption";
char t[]="text";
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
__asm{
push MB_OK
lea si,c
push si
lea si,t
push si
push NULL
call dword ptr MessageBoxA
}
return 0;
}
#include <afx.h>
char c[]="caption";
char t[]="text";
int APIENTRY _tWinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
__asm{
push MB_OK
push OFFSET c
push OFFSET t
push NULL
call dword ptr [MessageBoxA]
}
return 0;
}
#include <windows.h>
char szAppName[] = "Test";
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nShowCmd )
{
char szHello[] = "Hello, world!";
__asm
{
push MB_OK
push OFFSET szAppName // 全局变量用OFFSET
lea EAX, szHello // 局部变量用LEA
push EAX
push 0
call DWORD PTR [MessageBoxA]
}
return 0;
}