Intro to RE: C : part-4

When an operating system (OS) runs a program, the program is first loaded into main memory. Memory is utilized for both program’s machine instructions and program’s data…this includes parameters, dynamic variables, (un)initialized variables, and so on. Most computers today use paged memory allocations, which allow the amount of memory assigned to a program to increase/decrease as the needs of the application change. Memory is allocated to the program and reclaimed by the operating system in fixed-size chunks known as pages....

May 1, 2023 · 14 min · 2938 words · ayedaemon

Intro to RE: C : A Simple Calculator

We covered a wide range of topics in earlier articles that were helpful in comprehending how many lower-level processes operate. This blog will concentrate on applying those ideas to recreate C program after reverse engineering a simple calculator binary. It is always a good idea to observe how the target software responds to various inputs. This gives you a sense of the internal logic that might be operating. If we run this program without any arguments, we will get an error message stating that we need to pass more arguments as well as the usage guide is printed....

April 3, 2023 · 16 min · 3378 words · ayedaemon

Intro to RE: C : part-3

In the previous blog, I discussed some of the basic C program’s disassembly structures, concentrating on the variables and their memory layouts. This article, a follow-up to the previous one, focuses on basic operations and functions in C programs. In the previous blogs, we have seen what an empty C program looks like void main() {} Disassembly: main: push rbp mov rbp, rsp nop pop rbp ret Arithmatic operators Now if we want to work with operations, we’ll have to add 2 local variables to the function....

April 1, 2023 · 24 min · 4930 words · ayedaemon

Intro to RE: C : part-2

Reverese engineering is a powerful tool for any software developer. However, as with any tool, it is only as good as the person using it. Understanding reverse engineering and how to use it is essential for both novices and seasoned developers. According to wikipedia, Reverse engineering, also called back engineering, is the process by which a man-made object is deconstructed to reveal its designs, architecture, or to extract knowledge from the object; similar to scientific research, the only difference being that scientific research is about a natural phenomenon....

March 19, 2023 · 16 min · 3306 words · ayedaemon

Intro to RE: C : part-1

Steps to generate a binary When we write a program using a language like C, it is not C source code which really gets executed. This C code passes through many steps and finally a binary file is generated out of it. This binary file is what gets executed on any computer. There are many steps through which a C code is converted into a binary file:- Pre-processing Compilation Assemble Linking Let’s follow these steps one by one to understand what they do to the C code and how a binary is generated via this....

September 21, 2022 · 40 min · 8439 words · ayedaemon