Skip to content

Field notes

These quick notes are intended to help diagnose a symptom. Verify each answer against the binary and debugger version you are using.

The debugger view is a snapshot printed when execution stopped. Step or continue to a new stop, then inspect again. Use x/24gx $rsp for raw words or telescope $rsp for a pointer-aware view.

Use the same cyclic subsequence length (n) in generation and lookup. Check the exact bytes in the saved return slot, account for little-endian display, and make sure the input was not cut off at a newline or NUL.

Why does the address work once and fail on the next run?

Section titled “Why does the address work once and fail on the next run?”

ASLR or PIE may have changed the mapping. Obtain a runtime base for the current process and calculate the address from that base. A static file offset is not necessarily a runtime pointer.

Why does p variable say the symbol is unknown?

Section titled “Why does p variable say the symbol is unknown?”

The binary may be stripped or optimized. Inspect registers, disassembly, and memory instead, or use Ghidra to relate the value to a source-level variable.

Why does sendline() stop at an unexpected place?

Section titled “Why does sendline() stop at an unexpected place?”

The target might use a fixed-length read, a line-based function, or a formatted input routine. Check whether it expects a newline, how many bytes it accepts, and whether a NUL terminates its operation. sendline() always appends one newline byte.

Check the arguments, resolved addresses, libc match, and x86-64 stack alignment. Inspect RSP at the function entry. Under System V AMD64, the stack is 16-byte aligned immediately before a call; at a normal function entry, the pushed return address means RSP is 8 modulo 16.

Why did the process stop in __stack_chk_fail?

Section titled “Why did the process stop in __stack_chk_fail?”

A stack canary check detected a changed guard. Confirm where the input crosses the guard and whether a permitted challenge primitive provides the information needed to reason about it. Do not mistake this for a successful instruction-pointer overwrite.

Full RELRO makes relocation entries read-only after loading. The GOT can still be useful to read for an address disclosure, but choose a different destination for a write primitive.

Why does my format string print a different index?

Section titled “Why does my format string print a different index?”

The format argument position depends on the calling convention, wrapper, and how input reaches the formatting function. Find it empirically in the local challenge and use the observed offset. Do not reuse an index from another binary.

After the next debugger stop, run telescope $rsp 24 or x/24gx $rsp. The stack pointer can move after calls, returns, pushes, pops, and local-space allocation. See the stack refresher and pwndbg state guide.