Expand description
atx-core — reader/decoder for Apple ATX (AAPL) texture-image containers.
ATX files are Apple “AAPL” texture containers found throughout iOS UI image caches: PosterBoard / runtime snapshots, wallpapers, contact posters, avatars / Animoji. Forensically they are what was on screen.
§Container layout (clean-room from the iLEAPP reference)
The byte-level framing below is reimplemented clean-room from
abrignoni/iLEAPP’s
leapp_functions/parsers/apple_atx.py (MIT, @JamesHabben, 2026-06-25), the
authoritative reverse-engineered reference cited by the source write-up
(James Habben, 2026-06-26).
AAPL\r\n\x1a\n 8-byte signature (PNG-style)
[size u32 LE][tag] chunk header (size = payload bytes, NOT incl. the 8-byte header)
payload[size]
... repeated to EOFChunk tags: HEAD (metadata), FILL, astc/ASTC (raw ASTC payload),
LZFS (LZFSE-compressed ASTC).
§Decode pipeline
LZFSpayload: LZFSE-decompress (lzfse_rust) → a linear ASTC 4x4 stream (padded to the 4x4 block grid) →astc-decode→ RGBA8. No macro de-tiling — the compressed stream is already linear.- raw
astc/ASTCpayload: the ASTC blocks are macro-tiled in 32x32 block (128 px) tiles, Morton-ordered within each tile. De-tile to a linear block stream, thenastc-decode→ RGBA8. The Morton X/Y interpretation is not flagged by the format, so both orientations are decoded and the one with the smaller brightness jump across the 128-px macro-tile seams is kept (the reference’s grid-seam heuristic).
Codecs are REUSED, never reinvented: lzfse_rust (the fleet’s LZFSE) and
astc-decode. The new value-add is the AAPL container parse, the HEAD field
layout, and the Morton de-tiling.
§Validation status (Doer-Checker) — tier-1
In-crate unit tests cover the container parse and Morton math against the
documented byte layout. Beyond that, the end-to-end decode is tier-1
validated on real device textures: 108 real .atx files from a public
iPhone 11 / iOS 17.3 full-file-system image decode to RGBA matching the
independent iLEAPP reference (a different author and a different ASTC
decoder) to within one LSB per channel on every file, across both the
LZFSE-compressed and raw macro-tiled paths. See docs/validation.md for the
corpus, oracle, and per-path results.
Epistemics: report the pixel format as confirmed vs inferred; never claim a file is the active wallpaper just because of its path. State what the container holds, not what it means.
Modules§
- fourcc
- The chunk FourCC tags ATX containers carry.
Structs§
- Atx
- A parsed ATX container: its chunk inventory, optional HEAD metadata, optional texture payload, and any non-fatal parse warnings (truncation, trailing bytes).
- Chunk
Ref - A located chunk within the container, from the framed
[size][tag]walk. - Decoded
Image - A decoded ATX image (RGBA8).
- Head
HEADmetadata, parsed at the byte offsets confirmed from the iLEAPP reference.- Payload
- A located texture payload chunk and its inner framing.
Enums§
- AtxError
- Errors from reading or decoding an ATX container.
- Format
Confidence - How confidently the pixel format is known — the source research’s honest distinction (never present an inference as a confirmed fact).
Constants§
- MAGIC
- Every ATX file begins with this 8-byte signature (
AAPL+ a PNG-style\r\n\x1a\nguard). Confirmed from the iLEAPP reference (AAPL_MAGIC).
Functions§
- astc4x4_
confidence - Map a pixel-format discriminator pair to an ASTC-4x4 confidence, per the
iLEAPP findings. Returns
Nonefor an unrecognized pair — surface the raw pair to the analyst rather than guessing a format. - decode
- Decode the texture payload to RGBA8.
- is_atx
- Whether
bytesbegins with the full 8-byte ATXAAPLmagic. - morton_
5bit - Decode an index into a 5-bit Morton (Z-order)
(x, y)pair: even bits formx, odd bits formy. Pure function — the de-tiling primitive. - parse
- Parse an ATX container: validate the magic (loud on failure), walk the framed
chunk list, and parse HEAD + locate the texture payload. Malformed chunks
after a valid magic degrade to
Atx::warnings.