...

/

Disassembly Output Without Optimization

Disassembly Output Without Optimization

Learn how the GDB disassembly output is used for memory dump analysis and debugging.

Example of a disassembly output: No-optimization mode

The ability to reconstruct approximate C or C++ code from code disassembly is essential in memory dump analysis and debugging.

Source code

We give a C/C++ code for our project of reconstructing a program through the GDB disassembly output in this lesson:

Press + to interact
int a, b;
int *pa, *pb;
int main(int argc, char* argv[])
{
pa = &a;
pb = &b;
*pa = 1;
*pb = 1;
*pb = *pb + *pa;
++*pa;
*pb = *pb * *pa;
return 0;
}

Here is a breakdown of the code presented above:

Explanation

  • Line 1: We declare the two integer variables.
...