include \masm32\include64\masm64rt.inc
.data
.data?
.code
entry_point proc
invoke MessageBox,0,"Hello World","Title",MB_OK
invoke ExitProcess, 0
entry_point endp
end
disassembles to this: (x64dbg.exe)
.code
00007FF60F181000 | enter 80,0 |
00007FF60F181004 | sub rsp,60 |
00007FF60F181008 | mov rcx,0 |
00007FF60F18100F | mov rdx,qword ptr ds:[7FF60F18306C] | rdx:EntryPoint, 00007FF60F18306C:&"Hello World"
00007FF60F181016 | mov r8,qword ptr ds:[7FF60F183086] | 00007FF60F183086:&"Title"
00007FF60F18101D | mov r9,0 | r9:EntryPoint
00007FF60F181024 | call qword ptr ds:[<&MessageBoxA>] |
00007FF60F18102A | mov rcx,0 |
00007FF60F181031 | call qword ptr ds:[<&ExitProcess>] |
.data
00007FF60F183000 0D 0A 00 00 30 18 0F F6 7F 00 00 0D 0A 00 0B 30 ....0..ö.......0
00007FF60F183010 18 0F F6 7F 00 00 09 00 16 30 18 0F F6 7F 00 00 ..ö......0..ö...
00007FF60F183020 22 00 20 30 18 0F F6 7F 00 00 3C 00 2A 30 18 0F ". 0..ö...<.*0..
00007FF60F183030 F6 7F 00 00 3E 00 34 30 18 0F F6 7F 00 00 21 00 ö...>.40..ö...!.
00007FF60F183040 3E 30 18 0F F6 7F 00 00 28 00 48 30 18 0F F6 7F >0..ö...(.H0..ö.
00007FF60F183050 00 00 29 00 52 30 18 0F F6 7F 00 00 00 00 00 00 ..).R0..ö.......
00007FF60F183060 48 65 6C 6C 6F 20 57 6F 72 6C 64 00 60 30 18 0F Hello World.`0..
00007FF60F183070 F6 7F 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ö...............
00007FF60F183080 54 69 74 6C 65 00 80 30 18 0F F6 7F 00 00 00 00 Title..0..ö.....
So, the converting of the arguments to registers is automatically done by the ?? preprocessor?
And what about the text strings, how and when are they put into the data section. I don't
fully understand.
Ooops, I see that I didn't put a "ret"