LOGBOOK

HELP

Quiz Entry - updated: 2026.07.14

How do you use GDB's x/ command to read a jump table?

Use x/Na address — the a format prints N pointer-sized values as addresses, which is exactly what a jump table holds.

(gdb) x/8a 0x402500
0x402500: 0x400e73
0x402508: 0x400e90
0x402510: 0x400ead
...

The a format shows addresses — each is a jump target for one case.

Then examine each target:

(gdb) x/5i 0x400e73

Shows the 5 instructions at that address (case 0's code).

Other useful formats for bomb labs:

Command Use case
x/s addr Read a hardcoded string
x/6d $rsp Read 6 integers from the stack
x/16wd addr Read 16 ints from a lookup table
x/7xg addr Read 7 quad-words in hex
x/Na addr Read N addresses (jump table)

Converting values:

(gdb) p 0x3b5
$1 = 949

(gdb) p/c 0x74
$2 = 116 't'

(gdb) p/t 0xf
$3 = 1111

Go deeper:

From Quiz: REVE1 / Assembly Patterns & GDB | Updated: Jul 14, 2026