PUBLIC EXERCISE / ELF X86-64
r9 · Meet in the middle of a recurrence
Reconstruct an XOR mask and find a printable input that reaches an exact 32-bit state.
Original puzzle at the reviewed revision · All five public exercises
01 Identify the program and the standard library call
Open r9 and verify its SHA-256 in File Details. Analyze main and check_password. Main has no observed random seeding call before the check. The puzzle imports random from the Linux C library, so the replay uses the standard glibc stream starting from its default seed.

02 Count the XOR rounds
Find the first call to random. The checker keeps its low eight bits for the round count. In the glibc model the first output is 1804289383, so the low byte is 103. That tells you how many passes over the input to model.

03 Reduce all passes to one mask per position
Each pass XORs a new byte into the same input position. Combine all those mask bytes with XOR, then apply the result to the original input once. The order of random draws still matters. For the chosen length of six, the modeled mask is E6 74 EA 22 BA 1C.

04 Read the accumulator in the direction the code uses
The checker starts at 0x1337. It reads the transformed input from right to left, treats each byte as signed, multiplies the current accumulator by it, and adds 0x31337. The calculation keeps just 32 bits. Treating a byte such as 0xE6 as 230 would give the wrong product because its signed value is minus 26.

05 Find a shared middle state
Make a table of the states reached by the rightmost three printable bytes. Work backward from the target for the leftmost three bytes. For this search use odd multipliers on the backward half, because each has an inverse in 32-bit wraparound arithmetic. Match a backward state to the forward table. This replaces one huge search with two much smaller ones.

06 Replay the exact candidate
Run the equations forward for the selected six input bytes. Track the accumulator after every multiplication to catch a reversed order or wrong signed byte. The independent replay reaches 0xFD0970E7 exactly, the constant in the final comparison.

Reveal the solution
!UQ=hn
The replay reads the original ELF bytes and applies the recovered check to this input. Open the receipt for the exact byte ranges and verification values.