windows - Push an argument into stack? -
i know first 4 arguments in register (rcx
, rdx
, r8
, r9
), , additional arguments pushed on stack.
question:
how push argument onto stack? tried (push 0) not work?
code (masm64)
extrn exitprocess: proc extrn messageboxexa: proc .data caption db '64-bit hello!', 0 message db 'hello world!', 0 .code start proc sub rsp, 38h mov rcx, 0 ; hwnd = hwnd_desktop lea rdx, message ; lpcstr lptext lea r8, caption ; lpcstr lpcaption mov r9d, 0 ; utype = mb_ok push 0 ; wlanguageid call messageboxexa mov ecx, eax add rsp, 38h call exitprocess start endp end
i'm know messagebox
, messageboxex
work same way, im trying use messageboxex
because need 1 parameter passed (for learning purpose).
i know i've asked similar question, more related vb.net while not.
my assembly little rusty, under impression arguments went onto stack (in reverse order) - i'd have thought want pushing r8 , rdx in other arguments. frankly though might keep doing lea rax, param
, push rax
each of arguments pointers.
Comments
Post a Comment