Layered Protections (Day 30, mobile-android) - Writeup
All three modes CORRECT (Single, Time Trial, Mastery 14/14).
Flags (GM-accepted)
- single_solve: Tokenf7736cc0ff855cbc4c85236882736930 (answer AnswerANS-3F023201F46243CA)
- time_trial: Tokenc3ef458b571eb464b258e897e9a5da96
- mastery: Tokencfcf0f2994157de20266e6e7b7fb66ef
Single Solve: puzzle codec layered
APK with assets/huntress_puzzle.json: {"schema":"huntress.mobile.puzzle.v1","day":30,"codec":"layered","data":"TU49OyInJlUlJSQkKilcKDFOUF4=","key":12} Derivation (static): base64-decode data (20 bytes) -> XOR byte i with (key + i) & 0xFF -> reverse. AC34264F102320F3-SNA reversed = AnswerANS-3F023201F46243CA. Fix: _layered() in the solver clone's DECODERS (returns only when exactly one distinct ANS reading exists).
Time Trial / Mastery: codec analysis (v2 schema, no data field)
The answer is computed by the dex itself (classes LayerKit, Mix, PeelStack, Release, Util; methods like peelPeela0(J)J). The clone's DEX interpreter (static emulation, nothing executed) already covered this family; two gaps:
- Time Trial:
unsupported opcode 0xC0(and-long/2addr). Added 0xC0, plus sub-long 0x9C / sub-long/2addr 0xBC. - Mastery delivery 7 (a day-16 JNI Boundary build,
lib/x86_64/libarena.so(challenge artifact, not published),nativeShare): the x86-64 leaf emulator (_x86_run) rejected 32-bit / branching code:cmp ecx,0xffff; jle; movzx esi,cx; cmp esi,0xa3ca; jne; ... ; xor eax,eax; ret. Added: cmp r/m,imm (0x81/0x83 /7), cmp r,r (0x39/0x3B), test (0x85), jcc rel8 (0x70-0x7F, signed/unsigned conditions, after a cmp), movzx (0F B6/B7), 32-bit forms (no REX.W) of mov/ALU ops with zero-extended result, mov r32,imm32, a step cap. All 14 Mastery APKs were decoded locally before the rerun (13 unchanged, delivery 7 newly decoded), then the runner submitted: CORRECT.
Lessons + D+1
- Single: missing codec
layered(base64 -> positional XOR key+i -> reverse). Stall ~2 min. Keep in clone; port_layeredto shared autosolve_mobile.py (candidate for other stacked/index-keyed variants). - TT: dex opcode 0xC0 (and-long/2addr) missing from the interpreter. Stall ~3 min (TT start already fell back to untimed after the HELD, then a fresh variant solved it after the patch). Port 0x9C/0xBC/0xC0 to the shared interpreter.
- MM: native x86-64 emulator lacked cmp/jcc/movzx/32-bit forms for the day-16
nativeSharegate. Stall ~6 min (Mastery HELD before submit, so no variant was spent). Port the extended_x86_runto shared; D+1 pre-test: decode every Mastery APK locally (puzzles_in + decode_puzzle) as soon as the downloads exist - it found the single failing delivery in seconds. - Process: check the full mastery_*.bin set offline before a timed rerun; the Mastery pool reused earlier-day builds (d01..d27), so old-day native/dex shapes can reappear.
Recommendations for the Commander (D+1)
What would have solved this deterministically and faster (each item = a stall I actually hit):
- SS
layered(~2 min): add a bounded op-stack search to the shared autosolve_mobile fallbacks: depth <= 3 over {b64/hex decode, reverse, xor k, xor k+i, xor k*i, add/sub k, add/sub k+i, rotate}, accept only a unique ANS-<16 hex> hit. The existing _fallbacks only had constant-key xor and single transforms, so a positional key (k+i) plus a reverse never matched. My .tmp/a5_brute.py is a working prototype (found it on the first run). - TT opcode 0xC0 (~3 min): complete the Dalvik arithmetic table in the shared interpreter (all 0x90-0xE2 int/long/2addr/lit forms, including and/sub/div/rem/neg/not and conversions) and add a static pre-scan that lists any dex opcode missing from _DVM_OPS. One missing member of a closed opcode family should never be discovered live.
- MM x86 emulator (~6 min): extend _x86_run to cmp/test + jcc + movzx + 32-bit forms (done in the clone) and add a pre-scan for unsupported x86 opcodes in lib//.so before any timed submit.
- Predictable Mastery shapes: the MM question text names each delivery's package (com.huntress.mobile.dNN.v...), so the source day of every delivery is known from the free contract before any start. Run the shared adapter over the archived APKs of those days (d01, d03, d05, ... d30) ahead of time; delivery 7 was a day-16 JNI build and would have failed there.
- Timed-window readiness: the readiness gate printed "HELD: gate unavailable ... not staged" but is ADVISORY, so TT and MM were started anyway, and each then raised a DEX HELD after the GM had confirmed the ranked attempt and fell back to untimed. I cannot tell from the logs whether a ranked Hall-of-Fame time counted for either mode; the Commander should check. Fix: make "gate unavailable" fail-closed when the adapter has not passed items 2-4 on the corpus above, since the policy is to never open a timed window before a solver is ready.
- Local pre-check before any rerun: loop puzzles_in + decode_puzzle over every downloaded mastery_*.bin (my .tmp/a5_test3.py). It found the single failing delivery in seconds instead of one runner cycle per fix.
- Agent/tooling friction: (a) Git Bash cannot cd to /mnt/c paths and a bare python3 is blocked, which cost me two failed commands; put "use the Read tool for files under challenges/, wsl only via the RUN prefix" next to the claim output. (b)
$varinsidewsl bash -c '...'is expanded away; write a .sh/.py file and run that. (c) The monitor filter should drop the repeated ADVISORY prediction/readiness lines (about 8 of the 16 events were advisory noise). Keep-in-clone vs port: all three fixes are in scripts/mobile_wip.py only; port _layered, the opcode additions and the x86 additions to shared.