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

Emulation and rehosting

Emulation executes untrusted vendor code. Review Security first, use a disposable lab, and do not expose an emulated service to a network you do not control.

Preflight

fat preflight .fat-projects/firmware
fat preflight --signal arch:mips --signal web:cgi --json

preflight ranks emulator backends and reports host readiness from project signals or manual --signal values. It does not start firmware.

Start, inspect, stop

fat emulate --project .fat-projects/firmware
fat emulate --project .fat-projects/firmware --status
fat emulate --project .fat-projects/firmware --stop

emulate starts the selected runtime, records the session and run, and reports allocated endpoints. --status refreshes the current runtime state; --stop terminates the owned process. Stopped or failed runs retain historical observations but do not advertise current attachable surfaces.

Rehosting packs

A rehosting pack is YAML containing device-specific knowledge: the QEMU machine, init repairs, paths to materialize, network mode, and readiness validators.

fat rehost profiles validate ./my-packs/example-camera.yaml
fat rehost match .fat-projects/firmware --packs-dir ./my-packs
fat emulate --project .fat-projects/firmware --pack example/camera
fat emulate --project .fat-projects/firmware --experimental-rehosting

Local packs are discovered from --packs-dir arguments in order, then directories in the colon-separated FAT_REHOSTING_PACKS. With neither source, no local pack is discovered. Unsupported partition roles and init repairs fail closed in the pack capability report; network declarations remain degraded when the backend cannot prove fidelity.

FAT also embeds explicit, hash-pinned BMC profiles. They require --pack <id> and are listed by fat rehost profiles list. See Emulating BMC firmware.

Debug and observe

fat debug surfaces --project .fat-projects/firmware --json
fat debug shell --project .fat-projects/firmware
fat debug monitor --project .fat-projects/firmware --command 'info status'
fat debug gdb --project .fat-projects/firmware --command 'info registers'
fat observe --help

debug surfaces lists current attachable endpoints. debug shell attaches to the serial console; it does not supply credentials. debug monitor speaks to the QEMU monitor. debug gdb connects to the whole-system QEMU stub. observe inspects runtime processes, services, networking, shells, maps, and monitors.

BMC-specific userspace debugging is covered in BMC session and process debugging.

Instrumentation and traces

fat instrument-hooks --file ./usr/sbin/httpd --output hooks.yaml
fat emulate --project .fat-projects/firmware --instrument hooks.yaml
fat trace-ingest --project .fat-projects/firmware --trace hooks.jsonl --json
fat probe evaluate --taint taint.json --trace hooks.jsonl --marker FAT_MARKER

instrument-hooks builds a QEMU hook configuration from a binary, sink report, or taint findings. trace-ingest normalizes hook JSONL into a runtime capture artifact. probe evaluate compares the trace with static taint findings; it does not start emulation or inject traffic.

Fidelity boundaries

An emulation validator proves only what that validator checked during that run on that backend. A booted userspace does not establish physical sensor fidelity, secure boot, update-signature enforcement, or hardware behavior. Keep the source image hash, profile, adaptations, and observations together when comparing runs.