Zig Zag - Day 10 (binary-reverse-engineering)
GM id: binary-reverse-engineering-day-10-zig-cross-platform-services
Prompt
Zig promises one binary for every platform. Compare the ELF and PE service descriptors side by side and prove they're the same program wearing different uniforms.
Result - all three modes CORRECT (solver: Blandman3)
- single_solve: Tokenfb10f5c652dd44838d1b3d36a32abca7
- time_trial: Tokenaf42050939cf70f2d541a216d3a03bbd
- mastery: Tokenff8b4e412f027b787ef449b646aafdaa
Family
dual_format_re - the recurring multi-field forensic inventory of a per-day zip of mixed binaries (ELF / native PE / managed .NET PE / JAR), each asked for header facts, section + symbol tables, a recover_code constant, demangled C++ names, vtable/typeinfo, and an embedded single-byte-XOR HCFG config record. Solved by the banked spine challenges/_lib/autosolve_binary.py; the single solve autosolved 99/100 at claim.
The evidence zip (AES pw infected) carried d01..d10 members: 7 .elf, 1 managed .dll (+.runtimeconfig.json), 2 .jar, and the Day 10 d10 Zig binary.
Today's new layer (Zig) and the two fields the spine did not yet handle
1. d10_analysis_has_hcfg_section (enum true/false) - NEW field
The Zig d10 ELF carries a named .hcfg PROGBITS section (section [23]) in its section header table holding the single-byte-XOR config record. The spine had no handler for the analysis_has_hcfg_section suffix. Added one: true iff a named .hcfg section exists in the ELF section header table (fallback: a successful HCFG header parse for any kind). d10 ELF => true.
2. d10_analysis_machine - INTEGER-kind, and d10 rotates ELF <-> native PE per attempt
The crux of the "cross-platform" theme. d10's delivered binary is mutated per attempt: sometimes an ELF (d10--variant-NNN.elf (challenge artifact, not published), e_machine 0x3e), sometimes a native Windows PE (d10--variant-NNN.exe (challenge artifact, not published), COFF machine 0x8664). The question's own answer_format is kind: integer (base-10), so the grader wants the raw numeric machine id, not a text token:
- ELF x86-64 => e_machine
0x3e= 62 - native PE amd64 => COFF machine
0x8664= 34404
The spine's integer-kind machine handler only covered ELF (the Day 8/9 lesson). For the PE variant it was falling through to the string machine path and emitting x86-64 (and later probe tokens amd64/x86_64/AMD64), all of which the integer grader rejected. Fix: when ikind == "integer" and the file is a PE, return str(pe_machine(main)) (the decimal COFF machine) - the same integer contract the ELF branch already honored.
GM / timed-route gotchas resolved (banked for the team)
- A timed route can return
409 timed_intent_not_availablefor the ranked (run_for_time:true) pool while a plainop=starton the same route succeeds. Do NOT auto-escalate a plain-start failure torun_for_time. - An expired-but-not-yet-retired timed attempt occupies the single timed-intent slot and makes a fresh
op=start409.op=retryboth retires it AND provisions a fresh attempt, returning the full start-shaped payload (attempt_id, questions, download, deadline) - use that return directly; callingop=startagain would 409 anew. Patched intoctf_gm.GM.start.
Method (fully automated, one shot per timed window)
claim_next.pyautosolved the single solve to 99/100 at claim.- Identified the lone unresolved field (
d10_analysis_has_hcfg_section) viaanalyse(); added the.hcfg-section handler => single_solve 100/100 CORRECT. - First timed attempt banked 99 and flagged
d10_analysis_machinewrong; inspected the saved attempt bytes, found d10 was a native PE and the field is integer-kind, and fixed the PE integer-machine handler. - Drove
autosolve_binary.run()directly for time_trial and mastery (start->download-> analyse->submit in one tight process, well inside the window): both CORRECT.
Files
- Extended spine:
challenges/_lib/autosolve_binary.py(.hcfg-section handler + PE integer-kind machine). - GM self-heal:
challenges/_lib/ctf_gm.py(timed_intent_not_available-> retry-as-start). - Solver copy:
challenges/Day 10/Zig Zag/scripts/solve_zig.py.