unicorn

unicorn-engineGPL-2.0活跃维护

轻量级多架构 CPU 模拟框架,支持 ARM、MIPS、RISC-V、X86 等十余种指令集,常用于逆向工程、恶意代码分析和嵌入式固件调试。

Unicorn CPU emulator framework (ARM, AArch64, M68K, Mips, Sparc, PowerPC, RiscV, S390x, TriCore, X86)

2.1.4发布于 2025-09-09 17:21 UTC9,553star +8 / 7 天1,588fork同步于 2026-11-10 11:30 UTC

怎么上手

由 README 提炼,执行前请确认
参见 docs/COMPILE.md 编译安装;Python 用户可 pip install unicorn
硬件要求按 README 说明

README 未说明具体硬件要求;支持 Windows 与 *nix(Mac OSX、Linux、Android、*BSD、Solaris 已验证)。

下载:源码 zip·GitHub Releases(安装包)本站不镜像安装包

项目说明

由 README 自动翻译提炼

基于 QEMU 的轻量级多架构 CPU 模拟框架,可在代码中直接模拟执行多种指令集

轻量级多架构 CPU 模拟框架,支持 ARM、MIPS、RISC-V、X86 等十余种指令集,常用于逆向工程、恶意代码分析和嵌入式固件调试。

核心能力

  • 支持 ARM、ARM64、M68K、MIPS、PowerPC、RISCV、SPARC、S390X、TriCore、X86 多架构
  • 提供简洁、与架构无关的纯 C API
  • 通过 JIT 编译实现高性能模拟
  • 支持细粒度插桩,可挂钩指令级行为
  • 设计上线程安全,并提供 Python、Rust、Go 等十余种语言绑定

容易踩的坑

README 未给出具体编译命令,需先阅读 docs/COMPILE.md;项目采用 GPLv2 许可证,商用前需确认合规;遇到问题应先查 docs/FAQ.md 再提 issue

内容由模型根据 README 生成,可能不完整或不准确,以官方文档为准。看原文 README

最近发版

5 个版本2.1.4
  1. 2.1.4Version 2.1.4最新正式版2025-09-09 · 2025-09-09 17:21 UTC

    Hello everyone. It has been a while since last release and we are releasing Unicorn 2.1.4. Though it is a patch release, there are some highlights worth mentioning.

    The very first thing is that, Unicorn (finally!) offers consistent PC guarantee in all cases. Well, it might sound weird that why it was not. Generally QEMU is not designed to keep PC synced in all cases for performance and Unicorn once put necessary hacks but those hacks were too hard to maintain. Now we have architecture agnostic mechanism to offer the PC guarantee.

    In addition, we offer a standalone unicorn Rust crate unicorn-engine-sys to allows users to build their own bindings since v2.1.4 (actually v2.1.5 because of the mess of releasing new crates). There are also lots of bindings improvements contained in this release.

    We also fix the building and distribution issues for macos ARM and distribute wheels again. Our friend @patryk4815 from pwndbg helps sort this out. Kudos to him!

    For 2.2.0, personally I wish I could work it out before the end of this year, by merging lots of pending big PRs but my time budget is relatively limited recently. Please aware that 2.2.0 would probably bump QEMU version to 5.1.0 or even higher so semantics could be changed. Any help is highly welcome and please contact @wtdcode if you are keen.

    Lastly, I would like to express my deep gratitude to all contributors that help make this release happen, specifically @Evian-Zhang for Rust improvements and unicornafl integration, @Antelox for constant contributions on our workflows, @amaanq for various huge work, reviews and Rust bindings split, @PhilippTakacs for PR reviews and fix. Again, thanks for every contributor!

    Below goes the auto generated release notes. Starting from this tag, the release note will switch to a short passage plus Github generated contents because this makes it easier to follow big changes.

    What's Changed

  2. 2.1.3Version v2.1.32025-03-07 · 2025-03-07 14:28 UTC
    查看更新说明

    2.1.3 includes a few fixes for distribution and stability issues. We urge users to update their versions as previous version contains security vulnerabilities.

    Fix & Improvements

    • Several security issues fixes. @PhilippTakacs
    • Add alpine workflow and fix several distribution issues. @Antelox @disconnect3d
    • Introduce importlib_resources for py3.8 (EOL already) @Arusekk @Antelox
    • Mips64 improvements. @OBarronCS
    • MIPS related fixes and implement a few registers.
    • x86 default CPU model is changed to UC_CPU_X86_HASWELL and remove a few quirks.
    • Fix CR4 implementation.
    • Fix python bindings break changes by adding back ctl_tlb_mode. @Antelox

    New Contributors

    Full Changelog: https://github.com/unicorn-engine/unicorn/compare/2.1.2...2.1.3

    As usual, thanks to all contributors and sorry if I missed your name here (please tell me @wtdcode !).

  3. 2.1.2Version v2.1.22025-02-13 · 2025-02-13 15:32 UTC
    查看更新说明

    2.1.2 is a patch release to mainly resolve the stability issue of the 2.1.0 release series and fix a few distribution issues. All users of Unicorn are expected to upgrade.

    Highlights

    • macOS arm64 no longer provides binary wheels due to a feature missing from Github Action runners.
    • py3.8 support is brought back, python2 wheels are built and test as well and we migrate to cibuildwheel! @Antelox
    • Several polish to python bindings and implement new API. @elicn @droe
    • Revert previous break changes that return UC_ERR_ARG for non-existing registers. Now this prints a warning. We urge all users relying on this behavior to fix code as soon as possible.
    • Fix several segment faults, including a few long-standing random segfault issues.
    • Revive previous unicorn 1 test suite and related refactoring. @elicn @Antelox
    • Optimize memory handling and notdirty writes for faster memory access and snapshots, especially useful for fuzzing. @PhilippTakacs
    • RISC-V API updates. @apparentlymart
    • fix UC_HOOK_MEM_READ on aarch64. @glennsec
    • Support UC_TCG_OP_FLAG_CMP for ARM @dotCirill
    • An alternative tag prefixed with "v" is added for golang compatibility.

    Fix & Improvements

    • Implement UC_ARM64_REG_WSP
    • Several fixes on arm64 macos @tbodt
    • reg_read_batch and reg_write_batch @hsa1as
    • Fix pc sync issue for SPARC, MIPS, x86. This also fixes PC sync issue within UC_HOOK_BLOCK hooks.
    • Allow cmake to install files on Windows and allow cmake not to generate Unicorn 1 style all-in-one objects archive
    • Make i386 instructions RDTSC and RDTSCP hookable @t0rr3sp3dr0
    • Allow Statically Linking in Go @t0rr3sp3dr0
    • Rust bindings improvements @Sanae6
    • Patch multiple UC_HOOK_MEM callbacks for unaligned access @Michael-c0de
    • Fix UC_MEM_FETCH_PROT for data read
    • Remove more Unicorn 1 hacks to improve performance.
    • Docs & unit test updates. @saicao
    • Allow uc_ctl_set_page_size() for arm64 @droe
    • Musl builds @clan
    • mips16 fix @ZakDanger
    • Fix UC_HOOK_MEM on arm32 @xndcn
    • Fix heap buffer overflow in op_cksm function @Shivam7-1

    New Contributors

    Full Changelog: https://github.com/unicorn-engine/unicorn/compare/2.1.1...2.1.2

    As usual, thanks to all contributors and sorry if I missed your name here (please tell me @wtdcode !).

    Lastly and personally, I would like to express my big thanks to @Antelox @elicn and @PhilippTakacs for spending lots of time improving Unicorn Engine. Also, there are a few big pull requests adding new architectures (RH850, TCI, LoongArch64, AVR) and I will actively push them to 2.2.0.

  4. 2.1.1Version v2.1.12024-09-26 · 2024-09-26 12:25 UTC
    查看更新说明

    This is a small release to fix a few urgent issues.

    • Remove pkg_resources usage
    • Fix wheels distribution for x86_64 macos
    • Fix redundant wheel hacks
    • Support musllinux distribution @Antelox

    Full Changelog: https://github.com/unicorn-engine/unicorn/compare/2.1.0...2.1.1

  5. 2.1.0Version v2.1.02024-09-21 · 2024-09-21 16:06 UTC
    查看更新说明

    It has been a while since the last release, and 2.1.0 brings several exciting features. Below is the changelog from the latest to the oldest (though not strictly).

    Highlights

    • Revive QEMU logs, now we have -DUNICORN_LOGGING=yes to enable all qemu logs. @BitMaskMixer
    • Faster (up to 40x) write performance by not always doing store_helper and cleaning page locks. @tunz @boborjan2
    • Brand new python bindings, with strongly typed and many improvements. @elicn
    • Fix to a long-standing MinGW random segfault bug.
    • We bring python2 compatibility back.
    • We now fully support M1, both building and a pre-built wheel.
    • We support snapshot memory now, with a very low overhead copy-on-write fashion. @PhilippTakacs
    • An option to bypass MMU is also added, check our FAQ. @PhilippTakacs
    • A brand new (and modern) java bindings. We are also working to publish it to maven. @nneonneo
    • We have zig integrated. @kassane @atipls
    • Now Unicorn no longer allocates 2GB memory for every instance. The memory will be only committed once used and the upper limit can be adjusted with uc_ctl.
    • New DotNet binding, with published to both Github and Nuget. @TSRBerry
    • The release will attach all binaries, thanks to @marameref

    Fixes & Improvements

    • RISCV improvements, but we still have a long way to go. @apparentlymart @ks0777
    • cmake improvements @scribam @es3n1n
    • Various python bindings fix and improvements @bet4it @rhelmot
    • Docs. @gerph @BitMaskMixer
    • Rust bindings. @lockbox @mlgiraud @deadash
    • TCG backend fixes. @redoste @StalkR @dglynos
    • PPC32 fixes. @dotCirill
    • Haiku fixes. @kallisti5
    • Improvements to avoid simulator detection. @mrexodia

    New Contributors

用户点评

登录用户的真实使用记录,可按版本和硬件筛选
共 0 条

    还没有人点评。第一个说出真实体验的人最有价值。

    README 原文

    未翻译

    Unicorn Engine

    pypi downloads Fuzzing Status

    LOOKING FOR CONTRIBUTORS! See this.

    Unicorn is a lightweight, multi-platform, multi-architecture CPU emulator framework, based on QEMU.

    Unicorn offers some unparalleled features:

    • Multi-architecture: ARM, ARM64 (ARMv8), M68K, MIPS, PowerPC, RISCV, SPARC, S390X, TriCore and X86 (16, 32, 64-bit)
    • Clean/simple/lightweight/intuitive architecture-neutral API
    • Implemented in pure C language, with bindings for Crystal, Clojure, Visual Basic, Perl, Rust, Ruby, Python, Java, .NET, Go, Delphi/Free Pascal, Haskell, Pharo, Lua and Zig.
    • Native support for Windows & *nix (with Mac OSX, Linux, Android, *BSD & Solaris confirmed)
    • High performance via Just-In-Time compilation
    • Support for fine-grained instrumentation at various levels
    • Thread-safety by design
    • Distributed under free software license GPLv2

    Further information is available at http://www.unicorn-engine.org

    License

    This project is released under the GPL license.

    Compilation & Docs

    See docs/COMPILE.md file for how to compile and install Unicorn.

    More documentation is available in docs/README.md.

    For common questions, read docs/FAQ.md before raising an issue.

    Contact

    Contact us via mailing list, email or twitter for any questions.

    Join our group for instant feedback.

    Contribute

    If you want to contribute, please pick up something from our Github issues.

    We also maintain a list of more challenged problems in milestones for our regular release.

    Please send pull request to our dev branch.

    CREDITS.TXT records important contributors of our project.