unicorn
Unicorn CPU emulator engine
Decision gist · record as of 2026-08-14
Yes, if you need to execute or analyze machine code across multiple architectures in a controlled environment. The permissive BSD License, active maintenance, broad platform support via prebuilt wheels, and minimal dependencies make it a solid choice. Medium install friction is acceptable given the compiled nature of the underlying emulator. Not necessary if you only need high-level language execution or do not work with binary code.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires a C compiler and build tools to compile from source if prebuilt wheels are unavailable for your platform; prebuilt wheels are available for common architectures and operating systems.
- Medium install friction due to compiled wheel dependencies across multiple platforms and architectures.
- The package is actively maintained with recent commits and has broad prebuilt wheel coverage for modern Python versions and common platforms.
License · maintenance · safety
BSD License (permissive) — Distributed under a permissive BSD License, which allows commercial and private use with minimal restrictions—suitable for most projects that do not require copyleft obligations.
last release 2025-09-09 (339 days) · last repo commit 2026-07-30 · 9,230 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 1,328,898 downloads/mo, #4,050 on PyPI
Alternatives
Verify before relying
pip install unicorn
import unicorn
mu = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)- Whether the package's performance characteristics (JIT compilation speed, memory footprint) meet specific emulation workload requirements.
- Completeness of instruction set coverage for less common architectures (M68K, SPARC, S390X, TriCore) in practice.
- Thread-safety guarantees and behavior in multi-threaded Python applications.
What it is and what it does
Unicorn is a Python binding to a QEMU-based CPU emulator that lets you execute machine code for multiple processor architectures—ARM, ARM64, MIPS, PowerPC, RISCV, SPARC, S390X, TriCore, X86 (16, 32, 64-bit), and M68K—without needing to run a full operating system. It provides a clean, architecture-neutral API for loading code into memory, setting up registers and memory state, and stepping through instruction execution with fine-grained instrumentation hooks.
The package is implemented in pure C with Python bindings, offering high performance through just-in-time compilation and thread-safe design. It runs on Windows, Linux, macOS, and BSD systems. A single runtime dependency (importlib-resources) keeps the footprint minimal. The project is actively maintained with broad platform coverage via prebuilt wheels, making installation straightforward on modern Python versions.
Use it for
- Reverse engineering and analyzing binary code without executing it natively on your system.
- Testing and validating machine code generation in compilers or code generation frameworks.
- Emulating firmware or embedded system code to understand behavior before deployment.
- Security research and vulnerability analysis by executing untrusted or malicious binaries in a controlled sandbox.
- Educational exploration of CPU architecture and low-level instruction execution.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if you need to execute or analyze machine code across multiple architectures in a controlled environment.
The permissive BSD License, active maintenance, broad platform support via prebuilt wheels, and minimal dependencies make it a solid choice. Medium install friction is acceptable given the compiled nature of the underlying emulator. Not necessary if you only need high-level language execution or do not work with binary code.
Install
unicorn on PyPI
Before you install
Medium install friction due to compiled wheel dependencies across multiple platforms and architectures. The package is actively maintained with recent commits and has broad prebuilt wheel coverage for modern Python versions and common platforms.
Requires a C compiler and build tools to compile from source if prebuilt wheels are unavailable for your platform; prebuilt wheels are available for common architectures and operating systems.
License in practice
Distributed under a permissive BSD License, which allows commercial and private use with minimal restrictions—suitable for most projects that do not require copyleft obligations.
Quickstart
pip install unicorn
import unicorn
mu = unicorn.Uc(unicorn.UC_ARCH_X86, unicorn.UC_MODE_32)
Verify before relying
- Whether the package's performance characteristics (JIT compilation speed, memory footprint) meet specific emulation workload requirements.
- Completeness of instruction set coverage for less common architectures (M68K, SPARC, S390X, TriCore) in practice.
- Thread-safety guarantees and behavior in multi-threaded Python applications.
Package facts
| License | BSD License permissive |
| Python support | Supports the current Python release !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*,!=3.6.*,>=2.7 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | 1 packageimportlib-resources |
| Maintenance | Actively maintained 339 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,328,898 / month, #4,050 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | License :: OSI Approved :: BSD LicenseProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: unicorn-2.1.4-cp37-abi3-macosx_10_9_x86_64.whl; unicorn-2.1.4-cp37-abi3-macosx_11_0_arm64.whl; unicorn-2.1.4-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl; unicorn-2.1.4-cp37-abi3-manylinux_2_17_i686.manylinux2014_i686.whl; unicorn-2.1.4-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl; unicorn-2.1.4-cp37-abi3-musllinux_1_2_aarch64.whl; unicorn-2.1.4-cp37-abi3-musllinux_1_2_i686.whl; unicorn-2.1.4-cp37-abi3-musllinux_1_2_x86_64.whl; unicorn-2.1.4-cp37-abi3-win32.whl; unicorn-2.1.4-cp37-abi3-win_amd64.whl; unicorn-2.1.4-py2-none-macosx_10_9_x86_64.whl; unicorn-2.1.4-py2-none-macosx_11_0_arm64.whl; unicorn-2.1.4-py2-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl; unicorn-2.1.4-py2-none-manylinux2014_i686.manylinux_2_17_i686.whl; unicorn-2.1.4-py2-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl; unicorn-2.1.4-py2-none-musllinux_1_2_aarch64.whl; unicorn-2.1.4-py2-none-musllinux_1_2_i686.whl; unicorn-2.1.4-py2-none-musllinux_1_2_x86_64.whl; unicorn-2.1.4-py2-none-win32.whl; unicorn-2.1.4-py2-none-win_amd64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “cpu emulator python”
- unicornUnicorn is a Python binding for a lightweight CPU emulator framework…
- dolphin-memory-engineReads and writes the memory of a running Dolphin emulator process…
- gcp-storage-emulatorProvides a local emulator for Google Cloud Storage that intercepts…
Give your agent the search over MCP, or paste the wish link into any chat.
More Software Development packages
Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.
NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.
FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.
Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.
Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.
Install it if you are building CLIs in Python.
Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.
See also dolphin-memory-engine · keystone-engine · pytest-embedded-qemu · py-cpuinfo · qemu.qmp · ROPGadget · akracer · gunicorn · vivisect · Adafruit-Blinka