$ cat writeup.md…
$ cat writeup.md…
fortid2026
Task: A patched Doom RNG hides 256 secret bits in its lookup table, while a gameplay video exposes two screen wipes. Solution: Fit each wipe's paired-pixel columns to the Doom melt algorithm, merge recovered RNG residues, and verify the one ambiguous bit against a pristine patched Git blob.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
watch how I rip and tear through E1M1
The supplied Chocolate Doom patch replaces the vanilla RNG table's low bits with the bits of a 32-byte secret. A gameplay video is the observable oracle; recover the secret from the game behavior without treating the short hash in the patch as a standalone cracking target.
The patch initializes rndtable[i] ^= (secret[i // 8] >> (7 - i % 8)) & 1 for all 256 entries. M_Random() advances its index before reading the table. In src/doom/f_wipe.c, wipe_initMelt() makes one M_Random() % 16 call for the first column and then one M_Random() % 3 call for each of 159 successive paired-pixel columns. Each latter value produces an initial vertical step of -1, 0, or 1, clipped at the source's -15 and 0 limits. The new image descends over a displaced copy of the old image; the descent is governed by wipe_doMelt() and its per-tick advances 1, 2, 4, 8, 16, 32, 8, ... (cumulative advances 0, 1, 3, 7, 15, 31, 39, ...).
Thus a recovered step determines an RNG residue, and the vanilla table determines whether that table entry was flipped: compare observed % 3 with vanilla[index] % 3. Flipping one low bit changes an integer by one, so the two residues cannot coincide. At a clipped boundary, keep both admissible residues instead of guessing a bit.
...
$ grep --similar