Pretty printer from GTIRB to assembly code
Clone or download
Antonio Flores Montoya
Antonio Flores Montoya Added option to keep skipped functions
the option --keep-functions or -K receives a list of function names
that will not be skipped while printing the IR.
Latest commit 4505e5f Dec 5, 2018

README.md

GTIRB Pretty Printer

A pretty printer from the GTIRB intermediate representation for binary analysis and reverse engineering to gas-syntax assembly code.

Building

The pretty-printer uses C++17, and requires a compiler which supports that standard such as gcc 7, clang 6, or MSVC 2017.

Boost (1.59 or later) and GTIRB are required.

Use the following options to configure cmake:

  • You can tell CMake which compiler to use with -DCMAKE_CXX_COMPILER=<compiler>.
  • Normally CMake will find GTIRB automatically, but if it does not you can pass -Dgtirb_DIR=<path-to-gtirb-build>.

Once the dependencies are installed, you can configure and build as follows:

$ cmake ./ -Bbuild
$ cd build
$ make

Usage

Pretty print the GTIRB for a simple hello world executable to an assembly file named hello.S, assemble this file with the GNU assembler to an object file named hello.o, and link this object file into an executable.

$ gtirb-pp hello.gtirb -o hello.S
$ as hello.S -o hello.o
$ ld hello.o -o hello
$ ./hello
Hello, world!