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:
Note that Homebrew installs libraries into its own directory, so you need to tell applications where to find them, for example with:
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:
Installation from sources with:
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).
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:
On Windows, do:
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.
Programming
After installation, find in tutorials below how to write your tools based on Unicorn using your favorite programming languages.
Miscellaneous
-
Unicorn: next generation CPU emulator framework: Blackhat USA 2015 slides (PDF).
-
Beyond QEMU: A quick technical comparison of Unicorn and QEMU.
-
Micro-Unicorn-Engine-API-Documentation in Chinese: This API Documentation details some Unicorn’s data types, APIs, and related code implementations (currently available in Chinese only).