Binary triage and decompilation
FAT’s binary workflow ranks audit targets, finds sinks and dispatch tables, decompiles selected functions, and feeds addresses into taint and runtime instrumentation.
Triage first
fat r2-triage --file ./usr/sbin/httpd --json
fat r2-triage --file ./usr/sbin/httpd --full
r2-triage profiles an ELF with radare2 and ranks functions by cyclomatic complexity and security-relevant signals. For raw blobs, supply the mapping:
fat r2-triage --file STM32.bin --arch cortex-m --base 0x08000000 --json
Sinks and handlers
fat sink-discovery --file ./usr/sbin/httpd --json > sinks.json
fat handler-table --file ./usr/sbin/httpd --json > handlers.json
fat identify-launcher --file ./usr/sbin/httpd --json
fat inspect-handoff --file ./usr/sbin/httpd --json
sink-discovery matches imports and symbols against sink profiles (command execution, config reads/writes, input sources, string overflow), resolves PLT stubs, and handles MIPS imp. symbols. Use --rootfs with a shell-target profile for scripts. handler-table finds URL or command dispatch tables. identify-launcher and inspect-handoff detect thin launchers and point at the downstream artifact that implements the behavior.
ELF symbols
fat inspect symbols --file ./usr/sbin/httpd --sort size --reverse
fat inspect symbols --file ./usr/sbin/httpd --in-flash --json
fat inspect symbols --file ./usr/sbin/httpd --names-file names.txt --preview 16 --demangle
fat inspect symbols --file ./old/httpd --file ./new/httpd --diff --json
inspect symbols reads .symtab/.dynsym by st_shndx, not by virtual-address guesses. It supports exact-name, substring, and regex selection; size/type/region filters; table, CSV, and JSON output; bounded byte previews; demangling; and two-file diffs. --in-flash includes read-only and executable sections. JSON uses elf-symbols/v2; diffs use elf-symbol-diff/v1.
Decompile one function
fat decompile --file ./usr/sbin/httpd --function 0x440b3c
fat decompile --file ./usr/sbin/httpd --function 0x440b3c \
--script names.r2 --output ./decompiled/ --json
decompile runs r2/r2ghidra on one function. --script files are applied after analysis and before pdg, so afn, afvn, and CC commands change the emitted pseudocode. Scripts are repeatable and remain the reviewable source of truth for names. Keep them next to the binary.
For raw firmware, add --arch, --base, and optionally --family:
fat decompile --file STM32.bin --function 0x080002ac \
--arch cortex-m --base 0x08000000
Stripped-binary workflow
fat r2-triage --file ./usr/sbin/httpd --json
fat sink-discovery --file ./usr/sbin/httpd --json > sinks.json
fat handler-table --file ./usr/sbin/httpd --json > handlers.json
fat taint --file ./usr/sbin/httpd --sink-candidates sinks.json --json > taint.json
fat instrument-hooks --from-sinks sinks.json --output hooks.yaml
fat emulate --project .fat-projects/firmware --instrument hooks.yaml
instrument-hooks turns sink or taint addresses into a QEMU hook configuration. After the run, trace-ingest normalizes the hook JSONL and probe evaluate checks whether a marker propagated through the static chain.
Next: Taint analysis.