BoomerangDecompiler / boomerang

Boomerang Decompiler - Fighting the code-rot :)
Other
374 stars 59 forks source link
c-plus-plus clang cmake decompiler gcc ppc qt5 reverse-engineering sparc visual-studio x86

Boomerang Decompiler

This is a fork of Boomerang, a general, open source (BSD licensed) machine code decompiler. Boomerang currently supports:

Although there are pre-compiled packages available for release versions (master branch), it is currently recommended to build the development version (develop branch) of the decompiler from source.

Building

Build status Test Coverage
develop CI Codecov branch
master CI Codecov branch

Building prerequisites

Building on Linux

On a Linux system you can build and install Boomerang with the usual cmake-make-make-install procedure. On a Debian-compatible system (e.g. Ubuntu) these commands will clone, build and install Boomerang:

sudo apt-get install git build-essential cmake qt5-default libcapstone-dev flex bison
cd YOUR_FAVOURITE_DEVELOPMENT_DIRECTORY
git clone https://github.com/BoomerangDecompiler/boomerang.git
cd boomerang && mkdir build && cd build
cmake .. && make -j$(nproc) && sudo make install

Building on macOS

To build Boomerang on macOS, you need at least macOS 10.13 or later, and XCode 10 or later. The recommended way of installing Boomerang and its dependencies outlined below is via Homebrew, although other methods might also work (untested). After installing XCode, execute the following commands in a terminal window:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" # Install Homebrew
brew install git cmake qt capstone flex bison # Install dependencies
cd YOUR_FAVOURITE_DEVELOPMENT_DIRECTORY
git clone https://github.com/BoomerangDecompiler/boomerang.git
cd boomerang && mkdir build && cd build
cmake -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5/ -DFLEX_EXECUTABLE=$(brew --prefix flex)/bin/flex -DBISON_EXECUTABLE=$(brew --prefix bison)/bin/bison ..
make -j$(sysctl -n hw.ncpu) && make install

Building on Windows

To compile on Windows using Visual Studio 2017, you can follow the following guide. Note that the build procedure for other IDEs or compilers (e.g. MinGW) is not covered in this guide.

Usage

Boomerang can be run in two ways:

There are a number of test applications available in the data/samples directory. You can use these to assess what the decompiler can decompile and also to experiment with the different decompilation options.

Testing

Unit tests

Boomerang has a unit test suite, which can be run by make && make test on Linux or by running the RUN_TESTS target in Visual Studio. Make sure you have the BOOMERANG_BUILD_UNIT_TESTS option set in CMake.

Regression tests

Additionally, you can run the regression test suite, to do so you will need a Python 3 interpeter. To run the regression test suite, make sure the BOOMERANG_BUILD_REGRESSION_TESTS option is set in CMake, then run make check on Linux. Building the regression test suite on Windows is currently not supported.

When the regression test suite finds a regression in the output, it is shown as a unified diff. If you have not modified Boomerang, please file the regression(s) as a bug report at https://github.com/BoomerangDecompiler/boomerang/issues.

Contributing

Boomerang uses the gitflow workflow. If you want to fix a bug or implement a small enhancement, please branch off from the develop branch (git checkout -b) and submit your fix or enhancement as a pull request to the develop branch. If you want to implement a larger feature, please open an issue about the new feature on the issue tracker first, so the feature can be discussed first. For additional information, please read the contributing guidelines.

Thanks for your interest in the Boomerang Decompiler!