LOGBOOK

HELP

Quiz Entry - updated: 2026.07.06

How do you recognize a string comparison in assembly?

Look for a hardcoded string address loaded into a register, a call to a compare routine, then test %eax, %eax + a conditional jump on the result.

mov  $0x402490, %esi
mov  %rbx, %rdi
call <strings_not_equal>
test %eax, %eax
je   success_label

The pattern:

  1. One register gets a hardcoded address ($0x402490) — this points to an expected string in .rodata
  2. Another register holds user input (often %rdi)
  3. A comparison function is called (returns 0 if equal)
  4. test %eax, %eax + je = "jump if they matched"

How to extract the string in GDB:

(gdb) x/s 0x402490
0x402490: "Brownie, you are doing a heck of a job."

Go deeper:

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