Find details on the design & implementation of Unicorn in this BlackHat USA 2015 slides.

Compile & install Unicorn

There are several methods to compile and install Unicorn.

1. From source code

Find the source in Download section and follow the instructions to build and install the core of Unicorn.

2. From repositories

This section explains how to install Unicorn on *nix platforms from some software repositories.

2.1 Mac OSX - core engine

Homebrew users can install the core of Unicorn with:

  $ brew install unicorn

Note that Homebrew installs libraries into its own directory, so you need to tell applications where to find them, for example with:

  $ export DYLD_LIBRARY_PATH=/usr/local/opt/unicorn/lib/:$DYLD_LIBRARY_PATH

2.2 Pkgsrc - core engine

Unicorn has been packaged for pkgsrc, thus available for NetBSD, FreeBSD, Bitrig and OpenBSD.

Installation from binary pre-built packages with:

  $ pkgin install unicorn

Installation from sources with:

  $ cd /usr/pkgsrc/emulators/unicorn && make install

3. Python binding

The easiest way to install Python binding is via pip, where packages for all the Operating Systems, including Windows, are provided. Simply run the below command from prompt (you need sudo on Linux, MacOS for root access).

pip install unicorn

If you want to install from source, note that Python binding depends on the core, so make sure to install the core before you can use this binding.

On *nix platforms, do:

$ cd bindings/python
$ sudo make install

On Windows, do:

cd bindings/python
python install

For Windows, after above steps, you need to copy all the DLL files from the Windows core engine in the Download section into directory C:\location_to_python\Lib\site-packages\unicorn.

4. Precompiled binaries

At the moment precompiled binaries for Windows & Java are available in our Download section.

  • Windows

    If you only want to write your tool in Python, all you need is the Python installer, which includes full Unicorn module. The Windows core engine is not necessary because it is already embedded inside the Python module.

    For all the bindings, firstly you still need to install the Windows core engine, which includes the static/dynamic libraries and also the headers (*.h) for C programming.

  • Java

    Java binding is available in JAR package.


After installation, find in tutorials below how to write your tools based on Unicorn using your favorite programming languages.