Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extrn MessageBoxA: PROC
- extrn ExitProcess: PROC
- .data
- titles db 'Win64', 0
- msg db 'Hello World!', 0
- .code
- msgbox_ready:
- sub rsp, 28h ; 32 byte for 4 arguments, 8 byte for 'call' it self
- mov rcx, 0 ; hWnd = HWND_DESKTOP
- lea rdx, msg ; LPCSTR lpText
- lea r8, titles ; LPCSTR lpCaption
- mov r9d, 0 ; uType = MB_OK
- call MessageBoxA
- mov ecx, eax
- add rsp, 28h
- ret ; Return from function
- main proc
- push rbp ; Push 8 bytes to align stack to 16 byte boundary before calling a function
- call msgbox_ready
- ; call ExitProcess ; Using ExitProcess instead of the pop rbp and ret is an option
- pop rbp ; Restore RBP and rebalance stack before returning
- ret ; Return to C startup code and exit program
- main endp
- End
Add Comment
Please, Sign In to add comment