...

/

Disassembly Output Without Optimization

Disassembly Output Without Optimization

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

Example of disassembly output: no optimization mode

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

Source code

Below is a C/C++ code that will help us reconstruct a program through GDB disassembly output.

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;
}

Explanation

  • Line 1: Declares the two integer variables.
  • Line 2: Declares the two integer pointers.
  • Line 6–7: Initializes an integer pointer with the address of an integer variable.
  • Line 9–10
...