Ghidra + CBMC = Assembly Model Checker
The combination of Ghidra's assembly semantics and CBMC's bounded model checking capabilities has led to the development of a tool called asmc-lift. This tool allows for the lifting of compiled ELF files into a format compatible with CBMC, enabling assembly model checking. Asmc-lift is a relatively small piece of C++ code (~1kLOC) that serves as a driver to run asmc-lift and other CBMC tools for model checking.
It integrates seamlessly with CBMC, which offers a wide range of use cases, including standalone assembly verification, translation validation, linking to external assembly, C specifications, and more. The tool supports both RV32/64 architectures and provides a flexible framework for writing custom harnesses to compare the output of C and assembly versions.
While there are known limitations and potential issues with Ghidra's pcode semantics, the approach offers a promising compromise between the interests of assembly verification enthusiasts and the needs of society. The development of asmc-lift is part of a broader trend toward integrating binary verification tools with other languages, such as Rust using Kani.
The author acknowledges the potential impact of AI in simplifying such complex tasks and expresses a balanced perspective on the future of binary verification.
Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.