Answer the question
In order to leave comments, you need to log in
What is the code for FASM?
This is the FASM code
format PE64 GUI
sub rsp,8*5
mov r9,0
lea r8,[_caption]
lea rdx,[_message]
mov rcx,0
call [MessageBoxA]
add rsp,40
sub rsp,16
mov ecx,eax
call [ExitProcess]
_caption db 'Win64 assembly program',0
_message db 'Hello World!',0
section '.idata' import data readable writeable
dd 0,0,0,RVA kernel_name,RVA kernel_table
dd 0,0,0,RVA user_name,RVA user_table
kernel_table:
ExitProcess dq RVA _ExitProcess
dq 0
user_table:
MessageBoxA dq RVA _MessageBoxA
dq 0
kernel_name db 'KERNEL32.DLL',0
user_name db 'USER32.DLL',0
_ExitProcess dw 0
db 'ExitProcess',0
_MessageBoxA dw 0
db 'MessageBoxA',0
sub rsp,8*5
add rsp,40
sub rsp,16
section '.idata' import data readable writeable
dd 0,0,0,RVA kernel_name,RVA kernel_table
dd 0,0,0,RVA user_name,RVA user_table
kernel_table:
ExitProcess dq RVA _ExitProcess
dq 0
ExitProcess dq RVA _ExitProcess
dq 0
_ExitProcess dw 0
db 'ExitProcess',0
Answer the question
In order to leave comments, you need to log in
sub rsp,8*5 add rsp,40 sub rsp,16
I know it's a stack backup and restore, but why is this necessary?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question