We are going to use FASM
for building our first assembly language program. And we will debug the executable using x64dbg
.
Using our Windows setup, download FASM from http://flatassembler.net/, then extract FASM into a folder of your choice:
Run FASMW.EXE
to bring up the FASM
GUI.
In your text editor, write down the following code, or you can simply do a Git clone of the data at https://github.com/PacktPublishing/Mastering-Reverse-Engineering/blob/master/ch3/fasmhello.asm.
format PE CONSOLE entry start include '%include%\win32a.inc' section '.data' data readable writeable message db 'Hello World!',0 msgformat db '%s',0 section '.code' code readable executable start: push message push msgformat call [printf] push 0 call [ExitProcess] section '.idata' import data readable writeable library kernel32, 'kernel32.dll', \ msvcrt, 'msvcrt.dll' import kernel32, ExitProcess, 'ExitProcess' import msvcrt, printf, ...