Oriel — AI & technology worth noticing, every day.

Ghidra + CBMC = Assembly Model Checker

Web page · https://philipzucker.com/asmc_cpp

First seen by Oriel on .

AI summary

ASMC connects Ghidra’s lifted assembly semantics to CBMC, enabling bounded model checking, ABI verification, translation validation, and C-specified assembly properties across x86-64 and RISC-V.

  • asmc-lift converts compiled .elf files into CBMC .gb objects using Ghidra pcode semantics packaged by Trail of Bits’ sleigh.
  • The driver checks C-style postconditions, safety, scalar ABI obligations, and custom harnesses, producing counterexamples with register values and recent machine instructions.
  • Examples verify return values, detect clobbered return addresses and unpreserved callee-saved registers, and compare compiled assembly against an equivalent C function.
  • The implementation is approximately 1kLOC of C++ glue, while C encoding introduces bitvector and memory-modeling compromises but produces readable, compilable models.
  • ASMC currently supports x86-64 SysV and RV32/64; adding architectures mainly requires writing a new ABI shim in C.

#cbmc #ghidra #assembly verification #risc-v

Generated by gpt-5.6-sol. Check the original for details.

Aliases

SourceExternal IDURL
Lobstersbr0hd7https://www.philipzucker.com/asmc_cpp/ Read discussion