Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Extracting firmware

Extraction turns a firmware image into published files plus a manifest that explains every recognized branch. FAT’s native pipeline is deterministic and does not execute recovered programs.

Projects first

fat new ./firmware.bin
fat extract .fat-projects/firmware

A project records the source identity and owns extraction, analysis, sessions, and runtime state. Use --name to override the derived slug and --projects-dir to place the project elsewhere.

Use case-sensitive storage when firmware contains names such as libip6t_HL.so and libip6t_hl.so. On macOS, create a case-sensitive APFS volume or disk image:

fat new ./firmware.bin --projects-dir /Volumes/FAT/projects
fat extract /Volumes/FAT/projects/firmware

Choose an engine

fat extract .fat-projects/firmware --extractor auto --json > extraction.json
fat extract .fat-projects/firmware --extractor native
fat extract .fat-projects/firmware --extractor all
EngineBehavior
auto (default)Native first, with external fallback when native recovery is incomplete
nativeBuilt-in decoders only; never invokes external fallback
binwalkExternal binwalk-ng only
unblobExternal unblob only
allRuns every engine without skipping

--force reruns extraction and overwrites existing artifacts. --extract-timeout SECS bounds a stalled external engine; 0 disables the timeout. The default is FAT_EXTRACT_TIMEOUT or 1800 seconds.

Read the manifest, not just the directory

The extraction manifest is work/extraction-manifest.json. Its important fields are:

  • recovery_status: rootfs_recovered, files_only, or partial;
  • artifacts: per-artifact lineage, decoder, output path, counts, timing, and failure reason;
  • kernel_paths: kernel candidates, which are not inferred from directory names.

work/native-artifacts.json preserves native outcomes when the command cannot produce a final manifest. A successful exit and a directory full of files do not establish complete rootfs recovery; inspect unresolved branches in artifacts.

Gzip members are published under artifact-ID/format directories such as work/extractions/native/0004-gzip. The directory name identifies the artifact and compression format, not a kernel role.

Native format support

FormatSupport
ZIP, TAR, gzipRecursive container extraction
SquashFS 2/3/4Both byte orders; zlib, LZMA, and XZ codecs
CramFSBounded native decoder
JFFS2CRC-validated nodes, inode versions, dirent deletions, both byte orders
JFFS2 fragmentsUncompressed, copy, zero-filled, and zlib

Unsupported codecs, incomplete files, and exceeded limits remain explicit unresolved outcomes. SquashFS special device entries are counted and omitted; ownership, timestamps, and xattrs are not restored. TAR hard links and sparse entries are unsupported.

JFFS2 discovery joins nodes across erased gaps of at most 64 KiB. It does not infer partition boundaries, ECC/OOB layouts, or missing fragments. Filenames and symlink targets currently require UTF-8.

Limits

Default native limits are:

ResourceLimit
Input512 MiB
Single output file256 MiB
Cumulative output, including symlink targets1 GiB
Output entries262,144
Artifacts4,096
Container depth8
Path components64
Shared metadata/fragment cache16 MiB

Carve a known region

When you already know the offset and size, skip full extraction:

fat carve --file firmware.bin --offset 0x200000 --size 0x100000 --output part.bin
fat carve --file firmware.bin --offset 0x200000 --format squashfs --output fs.sqsh
fat extract-payload --file firmware.bin --offset 0x40 --format gzip

carve extracts a byte range or a format-sized object; extract-payload extracts a payload fragment at a known offset. Both accept --project to resolve the primary firmware image from a project.

Next: Filesystem analysis.