mobile arena gauntlet: the lane's primitives composed in one dex
huntress ctf 2026, day 31 · mobile android · all three modes
tools used: android apk toolkit and timed-attempt pipeline.
"complete a mass-generated multi-app campaign that composes every released mobile primitive under one aggregate clock." on the last mobile day the single lost its puzzle data too. its apk carried a schema v2 puzzle with codec analysis, a build id and nothing to decode: the answer is whatever the app's dalvik code computes. from day 23 to day 30 that was true of the timed modes only, and every single still stored its code under a named codec. the mastery was fifteen computed-code apps, one each for fifteen mobile days from day 2 to day 31, two of them with a native library and one that loads a second dex from its assets.
the key insight is that composition costs an interpreter nothing. the day-31 app chains five stages in Release.token() (a 64-bit mixer, four bounded brute-force searches, a table-driven state walk, a byte peel under a walking xor key with a byte reversal, and a second mixer), mixes the result twice more and prints sixteen nibbles behind ANS-. each stage is a few dozen dalvik instructions of integer arithmetic (the searches loop at most 4,096 times each), so the interpreter we wrote for day 23 runs Release.code from its first instruction to its return-object and hands back the string the app would show. no stage has to be recognised or inverted, and the solver answered every mode on its first run.
challenge shape
single 1 field the code a computed-code app releases (schema v2, codec analysis)
time trial 1 field the same on a fresh day-31 app
mastery 15 fields one code per set: fifteen computed-code apps, one per mobile day
each question names a case and the package to read, for example "for case MOB-31-3480CA08CF in package com.huntress.mobile.d31.v3480ca08cf24", and asks for ANS- followed by exactly sixteen uppercase hex digits, normalization exact.
artifact anatomy
the single's apk is 12,704 bytes: a binary manifest, a 6,460-byte classes.dex, three signature files and the puzzle, stored uncompressed:
{"schema":"huntress.mobile.puzzle.v2","day":31,"codec":"analysis","build":"cb29756b5715"}
the manifest declares the question's package, two exported activities, a deep link huntress31://mobile-arena-gauntlet/unlock and a meta-data entry huntress.mechanic with the value cumulative multi-control gauntlet. none of them carries the answer. the dex holds nine classes; the ones on the answer's path:
Release code(Context) -> String, token() -> long, proof(Context) -> String
Mix f1(long)
Core, Guard, Util 64-bit stages with generated names (mixGauntletdc, scanTrial4d, ...)
Probe s1, s2, s3: brute-force searches over 0..4095
MobileArenaGauntlet gauntlet(int, int, int, int), gateLane00(int, int, int)
Release.code is the only method that loads the ANS- string. its call tree, in order:
token() seed 560087273163026930
-> Guard.mixGauntletdc add, multiply, rotate left 44, xors, two xorshifts
-> Guard.scanTrial4d four Probe searches, gauntlet() of their results
-> Core.sessionGauntlet4b two 8-entry tables, six rounds of a state walk
-> Guard.peelArena94 byte i xor (89 + i), bytes reversed, gateLane00
-> Core.mixFinal40 xors, multiply, rotate 21, add, rotate 40
code() Core.finFinalcc(Mix.f1(token())) xor a constant
-> "ANS-" + "0123456789ABCDEF"[(v >>> s) & 15] for s = 60, 56, ..., 0
three stages are more than mixing:
- the searches.
Probe.s2(a, b, c, t)tries every x from 0 to 4095 and returns the first with((x ^ c) * a + b) & 4095 == t, or -1.s1tests((x * a + b) ^ c) & 4095, ands3rotatesx ^ cleft inside twelve bits bya % 11 + 1before addingb.scanTrial4dcalls them with constants (s2(1333, 302, 237, 353)first), xors each result times its own 64-bit constant into the state, multiplies, addsgauntlet(a, b, c, d) = (((a ^ b) + c) ^ d) % 31times another constant and mixes again. the single's four searches return 1066, 1926, 1992 and 1665, and the gauntlet of those is 8. - the state walk.
sessionGauntlet4bfills twoint[8]arrays, a next-state table and a byte table, starts in state 7 and runs six rounds: xor in(86 << 16 | table[state] << 8 | round + 1)times a constant, rotate the long left by 16, xor it with itself shifted right by 18, then move tonext[(state + (v & 3)) & 7]. the path through the tables depends on the value, so the round words are only known by running it. - the peel.
peelArena94xors byte i of the long with89 + i, the walking key of day 29'stableand day 30'slayeredcodecs, then reverses the eight bytes, the other half oflayered. a gate over the three low bytes,((b0 + b1) ^ b2) & 255, is multiplied by a constant and added back.
four more methods (Release.proof, Core.sealArena62, Guard.sealArena31, Util.sealLane40) are never reached from Release.code, so the interpreter never runs them.
the time trial's app is the same design under new names and constants: Core.mixFinal04, Core.scanArenafe, Guard.sessionLanee6, Util.peelFinal86 (its walk starts at 179) and Guard.mixTrial94, with the gate gateArena2d computing (a * 3 ^ b ^ c) & 255. the mastery's fifteen deliveries each carry the mechanic of the day they stand for in the same meta-data entry:
set day huntress.mechanic beyond classes.dex
1 2 permissive scheme, host, and path validation
2 4 mutable PendingIntent relay
3 5 backup-admitted SharedPreferences
4 7 JavaScript interface origin trust
5 9 permissive X509 trust manager
6 11 locally stored synthetic credential
7 15 challenge-owned JNI shared library lib/x86_64/libarena.so
8 16 Java-to-native validation mismatch lib/x86_64/libarena.so
9 18 runtime string decryption
10 20 secondary DEX loading assets/payload.dex
11 22 synthetic root detection
12 25 challenge-owned integrity statement
13 27 reachable challenge-owned dependency
14 29 clean-room table transformation
15 31 cumulative multi-control gauntlet
every one is schema v2, codec analysis, with its own Release.token() chain. set 7's chain passes through NativeLibrarySecrets.nativeShare, a native method whose export Java_com_huntress_mobile_d15_v8368c58d4d8b_NativeLibrarySecrets_nativeShare sits in the x86-64 library. set 10's Guard.lateLate79 reads payload.dex through the asset manager, wraps it in a ByteBuffer, hands it to an InMemoryDexClassLoader, loads the class named after the colon of LoadedLater.moduleContract() (assets/payload.dex:com.huntress.arena.payload.Module) and calls its share(long) by reflection.
extraction method
by hand, every stage is a few lines of python over 64-bit wrapping integers. two of them, the search and the peel:
M = 2**64 - 1
def s2(a: int, b: int, c: int, t: int) -> int:
for x in range(4096):
if (((x ^ c) * a) + b) & 4095 == t:
return x
return -1
def peel(v: int) -> int:
x = 0
for i in range(8):
x |= (((v >> 8 * i) & 0xFF) ^ (89 + i)) << 8 * i
v = int.from_bytes(x.to_bytes(8, "little"), "big") # the byte reversal
b0, b1, b2 = v & 0xFF, v >> 8 & 0xFF, v >> 16 & 0xFF
return (v + (((b0 + b1) ^ b2) & 0xFF) * -9154326994242983275) & M
transcribing every stage this way (about a hundred lines, with java's remainder sign for the % 31) reproduces the single's code, ANS-271111025BA7746E. the solver does not transcribe anything. the apk toolkit reads the puzzle first, and analysis in the codec says there is nothing to decode, so the app goes straight to the dalvik interpreter from day 23:
- the dex parser builds the class table of every dex in the app, restricted to the package the question names.
- candidates are the methods that return a
String, take no primitive parameter and load theANS-string, a method some other method calls ranked first. in the single that isRelease.codealone. - the interpreter runs the candidate instruction by instruction with java's semantics: 64-bit wraparound, wide values in register pairs, arithmetic and logical shifts with six-bit counts,
rem-inttruncating toward zero. theContextargument is a stand-in for the launcher activity, andStringBuilderandString.charAtare python implementations of the java classes. - a million-instruction cap bounds each candidate, and the returned string must match
ANS-[0-9A-F]{16}in full to count.
the four probe loops are nearly all of the instructions the interpreter runs: the single's searches take 1,067, 1,927, 1,993 and 1,666 passes of eight to eleven instructions each before they hit, against a few hundred instructions for every other stage together.
the mastery's special sets use what the interpreter gained on day 23. a call to a native method is looked up as its Java_<class>_<method> export in lib/x86_64/*.so, the library's segments are mapped and relocated, and the function runs under the unicorn cpu emulator with a jni environment of python stubs. the in-memory class loader parses the bytes it is handed as one more dex and adds its classes, so set 10's getDeclaredMethod lookup of share and its Method.invoke reach code that was never in classes.dex.
validation and answer formatting
the code's shape is fixed by Release.code itself: ANS- and sixteen characters from 0123456789ABCDEF, the nibbles of a long from the top down, which is exactly the question's pattern. a returned value that does not match it in full is not an answer, a crash on a method that something calls is reported rather than skipped, and an uncalled holder of ANS- can only rank behind a called one. the grader accepted ANS-271111025BA7746E for the single and ANS-D069EEECB75F3AE5 for the time trial; the mastery's fifteen codes began with set 1 ANS-7A19845BF5168698, set 2 ANS-B7BF64F1F47A157F and set 3 ANS-9A83BA63C2F7548A, all fifteen accepted.
failed approaches and pivots
none on day 31. nothing in the puzzle asked for a decode, and the interpreter ran every app without a missing framework call.
automation across modes
the same path answered every mode: the single in 0.30 seconds, the time trial's app in about 19 milliseconds, and the fifteen mastery apps in about 0.24 seconds, solved as they downloaded. the native sets and the loaded dex took no separate handling: the interpreter reached the native call and the class loader inside each app's own Release.code.
lessons
- when the app computes its answer, run the code that computes it rather than reading it. a composed design (searches, a state machine, a keyed peel) is still a straight line of integer arithmetic for an interpreter, however many earlier primitives it stacks.
- a brute-force search inside the app is not an obstacle to emulate: it is bounded by the app's own loop (4,096 tries here), and running it is cheaper than solving it.
- the meta-data entry naming the mechanic, the deep link and the extra
proofmethod describe a story; the answer is the return value of the one method that loadsANS-.
solve times
public scoreboard · day 31 finish: below top 10
- 0:03.6single#2 of 123 solvers
- 0:06.2time trial#2 of 118 solvers
- 0:10.0mastery#2 of 115 solvers
- #14team day finishof 90 teams that cleared it, in 10:51.3
- #2single 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 attempt start to its flag (server times). attempts counts our solver runs.
| mode | work to flag | attempts | wrong submits |
|---|---|---|---|
| single | 1.4s | 1 | 0 |
| time trial | 0.7s | 1 | 0 |
| mastery | 1.6s | 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 | 50.0s | 0.7s | 49.3s |
| mastery | 470.0s | 1.6s | 468.4s |
where we got stuck
- nowhere on day 31: the interpreter answered the single's computed code on its first run, and the same path answered the time trial and all fifteen mastery apps, the native and loaded-dex sets included.
flags: single, time trial, and mastery [redacted].
{generated by a clanker}