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

Command reference

fat -h lists every command grouped by task, starting with identify and doctor. fat --help adds common workflows and examples. Every subcommand also has its own --help output and examples. Help uses color in a terminal and stays plain when piped; FAT_COLOR=always forces color and FAT_COLOR=never disables it.

Projects and extraction

CommandPurpose
new, list, info, deleteManage project workspaces under .fat-projects/
identifyClassify evidence in an unknown file or directory
extractRecursively unpack firmware and record filesystem recovery and per-artifact outcomes
extract-payload, carveExtract a known byte range or format-sized object
analyzeDerive project signals, findings, and the bootloader snapshot
doctorReport external-tool and backend readiness
data, kernelInstall and verify runtime data and maintained kernels

fat extract firmware.zip --extractor native --json uses the built-in container and filesystem decoders. The default auto selection retains fallback extraction when native recovery is incomplete. recovery_status is rootfs_recovered, files_only, or partial; the artifacts array explains each recognized branch. work/native-artifacts.json also preserves native outcomes when the command cannot produce a final manifest.

Native JFFS2 extraction validates CRCs and reconstructs file versions and fragments before inspecting nested gzip streams. Unsupported codecs and incomplete files remain unresolved. Explicit --extractor native does not invoke external fallback; see the BMC extraction workflow for an example and supported formats.

For firmware with case-distinct names, create the project on a case-sensitive volume: fat new firmware.zip --projects-dir /path/to/case-sensitive/projects, then extract that project. On macOS, use a case-sensitive APFS volume or disk image. Existing project and extractor-selection arguments remain available.

Firmware structure and classification

CommandPurpose
inspectInspect headers, layout, carved artifacts, BMC flash, or bare-metal metadata
inspect bmcReport FIT authentication metadata, located platform markers, and CRC-valid U-Boot environments from raw flash
inspect update, inspect envelopeBuild update-envelope and trust-path evidence
detect-encryption, compareMeasure opaque wrappers and compare envelope boundaries
diff role, diff firmwareCompare binaries by role or projects across filesystem, configuration, and binary layers
bootloaderInspect bootloader images, environments, handoff, and sessions

fat inspect bmc --file flash.mtd --details expands the text report. Use --json or --sarif for structured output and --fail-on-warning to emit the report before returning a failing status for warning/error findings. Both --env-offset and --env-size are required for an explicit environment region. See BMC inspection for search bounds and the distinction between signature metadata and boot enforcement.

ESP-IDF partition tables

identify and inspect headers discover plaintext ESP-IDF partition tables in flash dumps, merged images, and standalone table binaries. The scan validates framing, alignment, ranges, labels, and MD5 when present, and accepts legacy tables without MD5. Partition offsets are flash addresses, not automatically file offsets. See ESP-IDF partition tables for the full workflow and limits.

Filesystem evidence

CommandPurpose
ls, treeInventory-oriented filesystem views with optional evidence-backed labels
search, xref-searchSearch printable strings and resolve pointer or code references
source-map, startup-mapMap inputs to consumers and startup metadata to binaries
trust-map, trust-boundaryIdentify governing update paths and trust boundaries
crypto-census, crypto, crypto-extractLocate reused crypto material and embedded keys, certificates, or blobs
edge-aiDiscover Edge AI models and library filename hints
androidAnalyze APK inventory, discovery leads, locality, and capability chains

Binary analysis

CommandPurpose
r2-triageProfile a binary with radare2 and rank audit targets
sink-discovery, handler-tableFind sink candidates and URL or command dispatch tables
identify-launcher, inspect-handoffDetect thin launchers and inspect downstream implementation artifacts
decompileDecompile one function with r2ghidra, applying r2 rename/comment scripts
taint, taint-query, taint-crossTrace data flow, ask precise path questions, and stitch cross-binary state
taint --lang shellTrace source-to-sink flows through shell scripts with a tree-sitter-bash AST
sdk-trace, bundle-reality, runtime-planeInspect dependencies and compare runtime metadata with filesystem reality

Invariants, chains, and verification

CommandPurpose
invariant queryQuery security invariants against source repositories
patch checkDerive patch guidance and search for nearby variants
chain queryAssemble multi-step propagation paths from evidence
verifyAttach runtime confirmation to a derived finding
signature-fitTest whether a byte window fits a public-key signature relation

Emulation and runtime

CommandPurpose
preflightRank emulator backends and host readiness
emulateStart, inspect, or stop a firmware runtime
rehost, experiment, rehosting-traceMatch, validate, and explain rehosting recipes and experiments; record pinned external campaign replays
debug, observeInspect runtime processes, services, networking, shells, maps, monitors, and GDB surfaces
instrument-hooks, trace-ingest, probeConfigure QEMU hooks, ingest traces, and compare runtime events with static findings
discover, hsmProduce family-scoped leads and query derived state-machine models
benchmarkScore and report analysis and emulation benchmarks

fat experiment external validate checks the pinned setup, replay input, retained evidence, and cleanup contract for a campaign owned by another engine. fat experiment external run executes one bounded replay and stores its input, logs, result, and cleanup outcome in a FAT project. See External campaign evidence.

Graph and label views

CommandPurpose
graph exportExport analysis facts as reusable JSON graph data
label scan, labels explainBuild label evidence and explain why a path carries a label

BMC emulation

fat rehost profiles list lists embedded BMC profiles. Use fat emulate --project <project> --pack <id-or-yaml>, then --status to probe Redfish and --stop to terminate the owned QEMU process. fat debug shell, monitor, and gdb attach to the recorded serial socket, monitor socket, and debugger port. See BMC emulation for full-flash/vendor-kernel modes, image hashes and fidelity limits.