All Projects → lifting-bits → Rellic

lifting-bits / Rellic

Licence: apache-2.0
Rellic produces goto-free C output from LLVM bitcode

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Rellic

Decomp
Components of a decompilation pipeline.
Stars: ✭ 343 (+46.58%)
Mutual labels:  llvm, decompiler, reverse-engineering
Protodec
Protobuf decompiler
Stars: ✭ 37 (-84.19%)
Mutual labels:  decompiler, reverse-engineering
Reko
Reko is a binary decompiler.
Stars: ✭ 942 (+302.56%)
Mutual labels:  decompiler, reverse-engineering
S2e
S2E: A platform for multi-path program analysis with selective symbolic execution.
Stars: ✭ 102 (-56.41%)
Mutual labels:  llvm, reverse-engineering
Fcd
An optimizing decompiler
Stars: ✭ 622 (+165.81%)
Mutual labels:  llvm, decompiler
Pbtk
A toolset for reverse engineering and fuzzing Protobuf-based apps
Stars: ✭ 791 (+238.03%)
Mutual labels:  decompiler, reverse-engineering
Jremapper
Remapping tool for compiled java programs.
Stars: ✭ 97 (-58.55%)
Mutual labels:  decompiler, reverse-engineering
Boomerang
Boomerang Decompiler - Fighting the code-rot :)
Stars: ✭ 265 (+13.25%)
Mutual labels:  decompiler, reverse-engineering
Despector
Java / Kotlin Decompiler and AST Library
Stars: ✭ 126 (-46.15%)
Mutual labels:  decompiler, reverse-engineering
Fernflower
Unofficial mirror of FernFlower Java decompiler (All pulls should be submitted upstream)
Stars: ✭ 2,380 (+917.09%)
Mutual labels:  decompiler, reverse-engineering
Rebel Framework
Advanced and easy to use penetration testing framework 💣🔎
Stars: ✭ 183 (-21.79%)
Mutual labels:  decompiler, reverse-engineering
Tigress protection
Playing with the Tigress binary protection. Break some of its protections and solve some of its challenges. Automatic deobfuscation using symbolic execution, taint analysis and LLVM.
Stars: ✭ 550 (+135.04%)
Mutual labels:  llvm, reverse-engineering
Bytecoder
Rich Domain Model for JVM Bytecode and Framework to interpret and transpile it.
Stars: ✭ 401 (+71.37%)
Mutual labels:  llvm, decompiler
Qbdi
A Dynamic Binary Instrumentation framework based on LLVM.
Stars: ✭ 801 (+242.31%)
Mutual labels:  llvm, reverse-engineering
Replica
Ghidra Analysis Enhancer 🐉
Stars: ✭ 194 (-17.09%)
Mutual labels:  decompiler, reverse-engineering
Termux Apktool
Decompile and Recompile android aplication use termux without openjdk installed
Stars: ✭ 53 (-77.35%)
Mutual labels:  decompiler, reverse-engineering
doc
Design documents related to the decompilation pipeline.
Stars: ✭ 23 (-90.17%)
Mutual labels:  llvm, decompiler
anvill
anvill forges beautiful LLVM bitcode out of raw machine code
Stars: ✭ 228 (-2.56%)
Mutual labels:  llvm, decompiler
Bin2llvm
A binary to LLVM translator
Stars: ✭ 108 (-53.85%)
Mutual labels:  llvm, reverse-engineering
Lucid
An Interactive Hex-Rays Microcode Explorer
Stars: ✭ 188 (-19.66%)
Mutual labels:  decompiler, reverse-engineering

Rellic

Rellic is an implementation of the pattern-independent structuring algorithm to produce a goto-free C output from LLVM bitcode.

The design philosophy behind the project is to provide a relatively small and easily hackable codebase with great interoperability with other LLVM and Remill projects.

Build Status

master
Linux Build Status

Getting Help

If you are experiencing undocumented problems with Rellic then ask for help in the #binary-lifting channel of the Empire Hacking Slack.

Supported Platforms

Rellic is supported on Linux platforms and has been tested on Ubuntu 16.04 and 18.04.

Dependencies

Most of Rellic's dependencies can be provided by the cxx-common repository. Trail of Bits hosts downloadable, pre-built versions of cxx-common, which makes it substantially easier to get up and running with Rellic. Nonetheless, the following table represents most of Rellic's dependencies.

Name Version
Git Latest
CMake 3.14+
Google Flags Latest
Google Log Latest
LLVM 4.0+
Clang 4.0+
Z3 4.7.1+

Pre-made Docker Images

Pre-built Docker images are available on Docker Hub and the Github Package Registry.

Getting and Building the Code

On Linux

First, update aptitude and get install the baseline dependencies.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get install \
     git \
     python3 \
     wget \
     unzip \
     pixz \
     xz-utils \
     cmake \
     curl \
     build-essential \
     lsb-release \
     zlib1g-dev \
     libomp-dev

If the distribution you're on doesn't include a recent release of CMake (3.14 or later), you'll need to install it. For Ubuntu, see here https://apt.kitware.com/.

The next step is to clone the Rellic repository.

git clone https://github.com/trailofbits/rellic.git

Finally, we build Rellic. This script will create another directory, rellic-build, in the current working directory. All remaining dependencies needed by Rellic will be downloaded and placed in the parent directory alongside the repo checkout in lifting-bits-downloads (see the script's -h option for more details).

cd rellic
./scripts/build_with_vcpkg.sh --llvm-version 10

To try out Rellic you can do the following, given a LLVM bitcode file of your choice.

# Create some sample bitcode or your own
clang-10 -emit-llvm -c ./tests/tools/decomp/issue_4.c -o ./tests/tools/decomp/issue_4.bc

./rellic-build/tools/rellic-decomp-10.0 --input ./tests/tools/decomp/issue_4.bc --output /dev/stdout

Docker image

The Docker image should provide an environment which can set-up, build, and run rellic. The Docker images are parameterized by Ubuntu verison, LLVM version, and architecture.

To build the docker image using LLVM 9.0 for Ubuntu 18.04 on amd64 you can run the following command:

ARCH=amd64; UBUNTU=18.04; LLVM=1000; docker build . \
  -t rellic:llvm${LLVM}-ubuntu${UBUNTU}-${ARCH} \
  -f Dockerfile \
  --build-arg UBUNTU_VERSION=${UBUNTU} \
  --build-arg ARCH=${ARCH} \
  --build-arg LLVM_VERSION=${LLVM}

To run the decompiler, the entrypoint has already been set, but make sure the bitcode you are decompiling is the same LLVM version as the decompiler, and run:

# Get the bc file
clang-10 -emit-llvm -c ./tests/tools/decomp/issue_4.c -o ./tests/tools/decomp/issue_4.bc

# Decompile
docker run --rm -t -i \
  -v $(pwd):/test -w /test \
  -u $(id -u):$(id -g) \
  rellic:llvm1000-ubuntu18.04-amd64 --input ./tests/tools/decomp/issue_4.bc --output /dev/stdout

To explain the above command more:

# Mount current directory and change working directory
-v $(pwd):/test -w /test

and

# Set the user to current user to ensure correct permissions
-u $(id -u):$(id -g) \
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].