A Zig implementation that extracts and validates firmware components from Apple's SuperBinary (.bin) files. This format bundles firmware for the AirTag's nRF (Bluetooth) and U1 (Ultra-Wideband) chips.
The SuperBinary contains firmware for two main components:
- The Nordic nRF chip (Bluetooth): consists of the SoftDevice, Bootloader, and the Bluetooth App.
- The Apple U1 chip (Ultra-Wideband): referred to as "R1" or "Rose", contained within the
ftabasset.
The SuperBinary header contains entries with the following structure:
- 4-byte ASCII tag (e.g.,
blap,sftd) - 2-byte version (little-endian)
- 2-byte flags (little-endian)
- 4-byte constant (
0x00490002) - 4-byte offset to data (little-endian)
- 4-byte length of data (little-endian)
This tool identifies these entries, extracts their corresponding binary blobs, and validates them based on their expected content (e.g., ARM firmware, signatures, or the U1 firmware container).
- Extracts various firmware components from SuperBinary files
- Supports the following tags:
blap: Bluetooth Application (for nRF)sftd: Soft Device (for nRF)bldr: Boot Loader (for nRF)basg: Bluetooth App Signaturesdsg: Soft Device Signatureblsg: Boot Loader Signatureftab: Firmware Table for R1 (U1/Rose) chip
- Validates extracted components based on their expected format
- Generates a manifest file with extraction details
- Falls back to dumping the first 512 bytes of the header if no entries are found
- Zig 0.15.1 or newer compatible build
zig buildzig build run -- <path-to-superbinary> [-o outdir] [--tags comma,separated]Extract all default components:
zig build run -- firmware.binExtract to a specific output directory:
zig build run -- firmware.bin -o extracted/Extract specific tags only:
zig build run -- firmware.bin --tags blap,sftd,bldrUnit tests for the validation helpers can be executed with:
zig build testThe tool creates the following files in the output directory:
- Individual extracted firmware components with names like
[tag]_[offset].bin manifest.json– detailed information about all extracted entriesheader_dump.bin– created when no entries are found (first 512 bytes of the header)
The tool performs the following validations:
- ARM firmware validation by checking ARM vector table patterns
- Signature validation using ASN.1 DER format cues
- U1 firmware container validation by checking for specific identifiers
- AirTag: AirTechno and Firmware Downgrade — presentation by jiska2342