Linux executable – hello world
To begin with, let's create a hello world program. Before anything else, we need to make sure that the tools required to build it are installed. Open a Terminal (the Terminal is Linux's version of Windows' Command Prompt) and enter the following command. This may require you to enter your super user password:
sudo apt install gcc
The C program compiler, gcc
, is usually pre-installed in Linux.
Open any text editor and type the lines of following code, saving it as hello.c
:
#include <stdio.h> void main(void) { printf ("hello world!\n"); }
You can use vim
as your text editor by running vi
from the Terminal.
To compile and run the program, use the following commands:
![](https://static.packt-cdn.com/products/9781788838849/graphics/13a97f68-c668-4d13-b5f0-aaf342839c55.png)
The hello
file is our Linux executable that displays a message in the console.
Now, on to reversing this program.
dlroW olleH
As an example of good practice, the process of reversing a program first needs to start with proper identification. Let's start with file
:
![](https://static.packt-cdn.com/products/9781788838849/graphics/139c82d1-bdee-46a6-baf7-615c59e982ff.png)
It is a 32-bit ELF file-type. ELF...