fraternal twins: one program, built twice
huntress ctf 2026, day 29 · binary reverse engineering · all three modes
tools used: binary analysis and timed-attempt pipeline.
"two binaries, same source, different compiler moods. diff the variants, account for every optimization, and prove they're semantically the same program." the day's tag was two elf builds of one source in the evidence zip, one compiled without optimization and one at the highest level, and fourteen questions about them inside the cumulative bundle of every earlier tag.
the key insight is that nothing about the pair was new to read. every one of the fourteen sentences was a recipe shape our readers learned on day 28: a selector ("the unique member whose basename ends ...", "decode both members and require their config objects to be byte-for-byte equal") and an operation (a digest, the container format, the machine field, a configuration value). the optimizer moves and strips code; it does not touch the configuration record both builds carry, so the pair agreed and the first run of every mode read all 406 fields.
challenge shape
single 406 fields the cumulative tags of days 1-29; 14 on the d29 tag
time trial 406 fields the same on a fresh zip
mastery 5278 fields the same over thirteen sets
the d29 fields are each member's sha-256, the container format and e_machine of each build, the pair's four common configuration values (campaign, domain, mutex, url, read only when both decoded records are byte-for-byte equal) and the optimized build's four values read from it alone.
artifact anatomy
the two d29 members are elf executables of the same size whose names end in the optimization level they were built at: d29--sample-O0.elf and d29--sample-O3.elf. the record sits right where the section header table ends, appended past the last section. both carry the family's configuration record, laid out as the question spells it: the four magic bytes, a version byte, a one-byte xor key, a little-endian u16 payload length, a little-endian crc32 of the decoded payload, and the payload xored with the key into utf-8 json. the question says where to look: scan backward from the end of the member for the magic and accept the first record whose crc verifies.
what differs between the builds is the code around the record: the unoptimized one keeps every function and its frame, the optimized one inlines, reorders and drops what it can. the record and its json survive both, byte for byte, which is why the pair question could demand equality.
extraction method
the binary analysis readers parse each question into a recipe before they look at its field name, as on day 28. day 29 added no code: the selectors already covered "the unique d29-- member whose basename ends o3.elf" (optimized_* fields; O0.elf for unoptimized_*) and the byte-for-byte pair ("decode both d29-- role members and require their config objects to be byte-for-byte equal before using the common value"), and the operations already covered the format enum, the base-10 machine field and the configuration values.
recipe = parse(question) # selector + operation from the sentence
members = recipe.select(zip_members)
if recipe.pair: # "require their config objects to be equal"
a, b = (decode_config(m) for m in members)
if a != b:
raise ValueError("the pair's configuration records differ")
value = recipe.op(members, a)
the configuration decode is the backward scan for the magic, the crc check over the decoded payload, and the json field by name; the format and machine readers dispatch on the member's own header, not on the question's wording.
validation and answer formatting
every rendering is spelled by the question: digests as sixty-four lowercase hex digits, e_machine as an unsigned base-10 integer (both builds are x86-64, EM_X86_64's decimal value), the container format from the listed enum (elf for both builds in every set), configuration values as the json stores them. a pair whose records differ is an error, never a guess, and a member with no crc-valid record is reported as such. the single's builds: sha-256 1a13ecc77afe95575bdd5bd3dbb6d73c0f54815b6cd579f05dc7cf95bee00690 for the O0 build and 1b6435084b335ddbca8e93be4f55489bd3fd5ac08cc691e54072bf4c171e95a6 for the O3 build, format elf and machine 62 for both, and campaign BR29-000, domain variant-000.day29.example.invalid, mutex Global\HuntressBR29-000_000 and url https://variant-000.day29.example.invalid/v/BR29-000 from the pair, the optimized build's own four values the same, as in every set; the time trial's pair named campaign BR29-07FB25EE, and the mastery's thirteen sets BR29-CD71BF18, BR29-F07FFB97, BR29-5E5E950E and ten more.
failed approaches and pivots
none on day 29.
automation across modes
the solve took 0.78 seconds on the single, 0.36 on the time trial and under two seconds for the mastery's thirteen sets, most of it overlapped with their download. the mastery's window was dominated by the download, about seven seconds for its evidence zips, not by the reading.
lessons
- two builds of one source differ in code, not in the data they carry; a configuration record read by its magic and crc is the same in both.
- a question-recipe interpreter pays off on the day after it is written: new selectors on old operations need no new code.
- "prove they're semantically the same program" was a story, not a field; read the questions before writing a differ.
solve times
public scoreboard · day 29 finish: below top 10
- 0:07.7singlefirst blood, +0.26 s
- 0:11.9time trial#2 of 141 solvers
- 0:24.5mastery#2 of 138 solvers
- #61team day finishof 116 teams that cleared it, in 34:38.6
- #4single orderof the day's 7, by our flag time
from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.
from the mode's first start on the game master to its correct submit.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 4.9s | 1 | 0 |
| time trial | 2.1s | 1 | 0 |
| mastery | 9.8s | 1 | 0 |
the clock
server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.
| mode | time available | time used | time left |
|---|---|---|---|
| time trial | 80.0s | 2.1s | 77.9s |
| mastery | 620.0s | 9.8s | 610.2s |
where we got stuck
- nowhere on day 29: the first run of every mode read all 406 fields; the only time of note was the mastery's seven-second download.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}