Analysing a simple "Hello World" Program

Craze.X

VIP Member
Original poster
PAID MEMBERSHIP
Jul 21, 2020
9,201
3,563
113
Credits
53,227
Hey nulled! Today we will be writing a simple hello world program in C, compiling it, then analyzing the disassembled binary.





The code will be compiled with gcc and disassembled using gdb; if you are using Windows, you can get Dev-C++ that comes with all the gcc utilities, including gdb.



Bear in mind that if you compile the source code yourself, your assembly code may be slightly different from mine due to variations in the different versions of gcc (I am using gcc v3.3.5 on Linux and v3.4.2 on Windows).



Also, your memory addresses probably won’t match mine, but this is normal as they will be different when compiled on different systems.



GDB Basics

GDB is both a debugger and a disassembler. In this example, we will be using gdb as a disassembler to perform a static analysis of our code. Gdb has many commands, but for our purposes there are just a few we will be using:

https://cache.This link is not allowed to post/9405f491b3aef6982903ff41512d5678df49260f/?url=http%3A%2F%2Fpuu.sh%2FkX2MF%2Fa7183b94b5.png



Hello World!




You'll be able to see the hidden content once you reply to this topic or upgrade your account.
 

Sueur13

Member
Registered User
Apr 9, 2021
137
1
18
Credits
104
Hey nulled! Today we will be writing a simple hello world program in C, compiling it, then analyzing the disassembled binary.





The code will be compiled with gcc and disassembled using gdb; if you are using Windows, you can get Dev-C++ that comes with all the gcc utilities, including gdb.



Bear in mind that if you compile the source code yourself, your assembly code may be slightly different from mine due to variations in the different versions of gcc (I am using gcc v3.3.5 on Linux and v3.4.2 on Windows).



Also, your memory addresses probably won’t match mine, but this is normal as they will be different when compiled on different systems.



GDB Basics

GDB is both a debugger and a disassembler. In this example, we will be using gdb as a disassembler to perform a static analysis of our code. Gdb has many commands, but for our purposes there are just a few we will be using:

https://cache.This link is not allowed to post/9405f491b3aef6982903ff41512d5678df49260f/?url=http%3A%2F%2Fpuu.sh%2FkX2MF%2Fa7183b94b5.png



Hello World!




[Hidden content]
Thankx