It works!

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, 'printf'

Save it by clicking on File->Save as..., then click on Run->Compile:

The executable file will be located where the source was saved:

If "Hello World!" did not show up, one thing to note is that this is a console program. You'll have to open up a command terminal and run the executable from there:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.130.24