InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Follow publication

GDB Baby Step 4: Decoding Multiplication in Assembly with GDB — StackZero

StackZero
InfoSec Write-ups
Published in
6 min readJul 10, 2023

--

This article was originally published at https://www.stackzero.net/gdb-baby-step-4/

Welcome to the next stage of our adventure into the fascinating world of GNU Debugger (GDB) — “GDB Baby Step 4: Decoding Multiplication in Assembly with GDB”. This installment delves deeper into the functional mechanisms of GDB, unraveling how it uncovers operations within program registers. Our focus for this exercise is to identify a specific multiplication constant utilized in a function call, only with a twist: we seek the constant in its decimal form. Ready for the challenge? Let’s dive in.

Preceding Steps: Revisiting GDB Baby Steps 1, 2 and 3

Before we take on the Baby Step 4 challenge, a quick recap of our past adventures is in order. Each step of our journey so far — from the introductory lessons of GDB, setting breakpoints, and examining registers to understand program execution flow — has been meticulously preparing us for the task.

GDB Baby Step 1 introduced us to the GDB environment and disassemble executables, Step 2 guided us on examining specific register contents at a function end, and Step 3 steered us towards understanding how memory addresses store values. All these valuable skills will come into play in Baby Step 4. If you missed the previous steps or need a refresher, revisit GDB Baby Step 1, GDB Baby Step 2, and GDB Baby Step 3.

This foundational knowledge will undoubtedly make Baby Step 4 a smoother ride.

If you are really a beginner in reverse engineering, I suggest you start with:

Stepping Over vs. Stepping Into: The GDB Navigation Basics

A crucial step in our journey is to understand two fundamental GDB instructions: Step Over” (ni) and “Step Into” (si).
Both commands are about navigating through the program, but they operate differently.

  • “Step Over” (ni) executes the current line of…

--

--

Published in InfoSec Write-ups

A collection of write-ups from the best hackers in the world on topics ranging from bug bounties and CTFs to vulnhub machines, hardware challenges and real life encounters. Subscribe to our weekly newsletter for the coolest infosec updates: https://weekly.infosecwriteups.com/

Written by StackZero

I have a passion for sharing my knowledge and helping others stay safe online. I just want to share tips and advice useful for me.

No responses yet