
The nasm tool reads the assembly code and generates an object file of the type “elf ”
that will contain the executable bits.The object file, which automatically gets the .o
extension, is then used as input for the linker to make the executable. After executing
the commands, you will have an executable named “hello”.You can execute it to see the
result:
bash-2.05b$ ./hello
Hello, world !
bash-2.05b$
The following example uses a different method to test the shellcode/assembly exam-
ples.That C program reads the output file of nasm into a memory buffer and executes
this buffer as though it is a function. So why not use the linker to make an executable?
Well, ...