LOGBOOK

HELP

Quiz Entry - updated: 2026.11.27

You halt an ESP32 with JTAG at the first instruction of a function in firmware with no source and no debug symbols. Where do you look for its arguments, and where will its result be?

Step past entry, then the arguments are in a2–a7 (first argument in a2). The result will be in a2 when the function returns, and in the caller's view one window up: a10 after a call8.

The calling convention is what makes stripped firmware readable. Names and types are gone, but every compiled function still follows the register rules, so you know where to look:

  1. At the function's address, the window hasn't moved yet. The call only recorded the shift; entry performs it. Before entry, the arguments are in the caller's a10, a11, … (for a call8). Step one instruction with nexti and they appear as a2, a3, … in the callee's window.
  2. Read them with info registers or p/x $a2 in GDB. If a value looks like an address in RAM (around 0x3ffb… on the ESP32), it is probably a pointer, and x/s $a2 shows the string it points to.
  3. For the result, run to the return (finish in GDB, or a breakpoint on the retw). The value is in the callee's a2, which the caller then reads as its a10.
  4. a0 tells you where you came from, once you swap its leading 8 for a 4 (see the crash-dump card).

This is how analysts work out what an unknown function does: what goes in and what comes out, without reading every instruction in between.

Go deeper:

From Quiz: SIOT / Xtensa LX6 Registers, Calls and Branches in Assembly | Updated: Nov 27, 2026