Repolode
unicorn-engine

unicorn-engine/unicorn

A lightweight CPU emulator framework based on QEMU that runs machine code for multiple architectures through a clean, architecture-neutral API.

Stars
9,545
Forks
1,588
Open issues
237
Last commit
20 days ago

What is it?

Unicorn is a CPU emulator framework built on QEMU. It lets a program load and execute machine code for architectures such as ARM, ARM64, M68K, MIPS, PowerPC, RISC-V, SPARC, S390X, TriCore and X86 (16, 32 and 64-bit) without running a full operating system or physical hardware.

The framework exposes a single, architecture-neutral API, so the same code for setting registers, mapping memory and running instructions works across supported CPUs. It is implemented in C and has bindings for many languages, including Python, Rust, Go, Java, .NET, Ruby and Lua. It runs on Windows and on *nix systems such as Linux, macOS, Android and the BSDs.

Unicorn uses just-in-time compilation for performance and provides hooks for fine-grained instrumentation at various levels. It is distributed under the GPLv2 license.

Key features

  • 01Emulates ARM, ARM64, M68K, MIPS, PowerPC, RISC-V, SPARC, S390X, TriCore and X86 CPUs.
  • 02Provides a clean, architecture-neutral API shared across all supported CPUs.
  • 03Offers bindings for Python, Rust, Go, Java, .NET and many other languages.
  • 04Uses just-in-time compilation for higher execution speed.
  • 05Supports fine-grained instrumentation hooks during emulation.

Use cases

  • Analyzing or reverse engineering machine code for multiple CPU architectures.
  • Fuzzing binaries by running code in a controlled emulated environment.
  • Testing firmware or embedded code without physical hardware.
  • Building custom tools that need to execute instructions with instrumentation.

Quick start

  1. 1

    Read the compile and install guide in docs/COMPILE.md

  2. 2

    Install the Python bindings from PyPI

    pip install unicorn

Things to know

  • Licensed under GPLv2, a copyleft license that may restrict use in proprietary software.
  • The README gives no pre-built install route beyond the referenced compile guide for other languages.

In collections

Topics

FAQ

What is unicorn?
A lightweight CPU emulator framework based on QEMU that runs machine code for multiple architectures through a clean, architecture-neutral API. Unicorn is a CPU emulator framework built on QEMU. It lets a program load and execute machine code for architectures such as ARM, ARM64, M68K, MIPS, PowerPC, RISC-V, SPARC, S390X, TriCore and X86 (16, 32 and 64-bit) without running a full operating system or physical hardware.
Is unicorn free to use? What license does it have?
unicorn is open source under the GPL-2.0 license. Check the license terms before using it in commercial products.
Is unicorn still maintained?
Actively maintained. The last commit to unicorn was on Oct 18, 2026.
What can I use unicorn for?
Analyzing or reverse engineering machine code for multiple CPU architectures. Fuzzing binaries by running code in a controlled emulated environment. Testing firmware or embedded code without physical hardware. Building custom tools that need to execute instructions with instrumentation.
How do I install unicorn?
Read the compile and install guide in docs/COMPILE.md Install the Python bindings from PyPI: pip install unicorn
Where can I get unicorn?
The source code and installation instructions are on GitHub: https://github.com/unicorn-engine/unicorn

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects