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

MCU and bare-metal images

FAT analyzes raw Cortex-M and other bare-metal images without assuming a load address or a vendor SDK. Identification, vector evidence, family evidence, and code mapping are independent, so an unresolved mapping stays visible instead of being guessed away.

Identify and inspect

fat identify --file firmware.bin
fat inspect mcu --file firmware.bin
fat inspect mcu --file firmware.bin --details
fat inspect mcu --file firmware.bin --json > mcu.json

identify gives a short identity/image overview. inspect mcu groups evidence into image mapping, startup, interrupts, and hardware. --details expands the same groups with reference tables; JSON is unchanged by presentation flags.

Override inference only when you have external evidence:

fat inspect mcu --file firmware.bin --base 0x08000000 --family STM32H7 --details

Image mapping

ImageLayoutReport.vector_address maps the selected vector table’s file offset to memory. Exact whole-image periods and uniform regions are reported as measurements; repetition is not attributed to encryption.

A family pack can corroborate compatible SRAM and executable ranges, but family-pack strings alone do not establish identity. Rejected candidates and unresolved mappings remain in JSON.

Startup and interrupts

Fast and detailed inspection share mcu::scan_vector_table. Counts describe populated pointers, not enabled IRQs or default-handler roles. Core exceptions, external IRQs, reserved slots, and unpopulated slots are distinguished; a shared target does not imply an interrupt-driven execution model.

The startup section reports the initial stack pointer, reset handler, and populated vectors with their file offsets and mapped addresses.

Code evidence

mcu_code follows supported Thumb control flow from mapped vector seeds with explicit budgets. It reports:

  • candidate functions;
  • literal and string references;
  • local constant-derived accesses.

mcu_registers attaches declarative family-pack register names to that evidence. Literal address references remain separate from actual reads/writes. Unknown profiles retain raw addresses; register aliases and part conditions stay unresolved unless supported.

Hardware surfaces

fat inspect peripheral-map --file firmware.bin --json
fat inspect isr-state --file firmware.bin --json
fat inspect svd-rank --help

peripheral-map reports family-backed peripheral and register surfaces. isr-state reports interrupt-boundary shared-state candidates. svd-rank ranks SVD-derived register surfaces when you supply the appropriate inputs.

What this does not prove

  • A vector table does not prove that the image boots on a particular board.
  • A register name does not prove a peripheral exists or is used at runtime.
  • A literal MMIO address is not an observed access until supported control flow reaches it.
  • Static code mapping does not establish timing, interrupt enablement, or hardware behavior.

For raw-binary decompilation, pass the same mapping to r2-triage or decompile:

fat r2-triage --file firmware.bin --arch cortex-m --base 0x08000000 --json
fat decompile --file firmware.bin --function 0x080002ac --arch cortex-m --base 0x08000000