您的位置:首页 > 其它

win32 asm Hello World Demo

2011-06-21 22:01 381 查看
编译和链接选项

ml.exe /c /coff /nologo /Fo

link.exe /SUBSYSTEM:WINDOWS /nologo /OUT

Hello World Demo Compiled with MASMPlus

.386
.model flat, stdcall
option casemap :none
include windows.inc
include user32.inc
include kernel32.inc
include masm32.inc
include gdi32.inc
includelib gdi32.lib
includelib user32.lib
includelib kernel32.lib
includelib masm32.lib
include macro.asm
.data
szTitle db 'Title',0
szMessage db 'Hello World',0
.code
START:
;1.push and call
push MB_OK or MB_ICONINFORMATION
push offset szTitle
push offset szMessage
push NULL
call MessageBox
;2.invoke伪指令
;invoke MessageBox,NULL,offset szMessage,offset szTitle,MB_OK or MB_ICONINFORMATION
invoke ExitProcess,0
end START


  

此段反汇编结果:程序入口点在0x401000,先是4个push,然后是call MessageBoxA

返回值到EAX,为ID_OK=1,从图中寄存器可见。

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: