Skip to content

Instantly share code, notes, and snippets.

@un4ckn0wl3z
Last active June 1, 2024 13:22
Show Gist options
  • Save un4ckn0wl3z/bbd9add2dddb0497178c727fbb671be8 to your computer and use it in GitHub Desktop.
Save un4ckn0wl3z/bbd9add2dddb0497178c727fbb671be8 to your computer and use it in GitHub Desktop.
; MessageBoxA_Masm.asm by un4ckn0wl3z
.code
COMMENT @
int MessageBoxA(
[in, optional] HWND hWnd,
[in, optional] LPCSTR lpText,
[in, optional] LPCSTR lpCaption,
[in] UINT uType
);
@
externdef MessageBoxA:proc
main proc
xor rcx, rcx ; HWND hWnd
mov rdx, offset msg ; LPCSTR lpText
mov r8, offset caption ; LPCSTR lpCaption
mov r9, 4h ; UINT uType
sub rsp, 40 ; preserve shadow spill
call MessageBoxA ; call MessageBoxA
add rsp, 40 ; restore shadow spill
ret ; return to caller
main endp
.data
caption db "Hello Assembly", 0
msg db "This is a cool app!", 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment