Recently, I was solving one of the Codewars.com problems in NASM (x86_64/amd64 Assembly) where I had to use some of the C functions available in the standard C library. During the code refactoring and optimization, I came across a segmentation fault while trying to run the executable. The program broke …
Tag Archives: Assembly
A Radare2-based Analysis of Pointers to an Array in C
Pointers and arrays are a confusing subject in C. Pointers can be of different types, which makes possible pointer arithmetic to access necessary elements in an array in different ways. Consider the following examples:
int *A[5]; This is an array of 5 pointers to integers.…
Examining Data in GDB
The GNU Debugger (GDB) is a powerful tool to debug binary executables. It can be used to do reverse-engineering as well. Let's debug the following code written by LiveOverflow:
Writing a Minimalistic “Hello, World!” program with Position Independent Code in assembly language
I wanted to write a simple program in AMD64 assembly language which prints "Hello, World!". Here is the code:
“Signed Integer” behavior of “char” data type in C
Examining data stored in the memory of the program may be interesting to understand low-level mechanism of variable management and type conversions. Let's dump content of an integer bytewise: