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

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)
参见 docs/COMPILE.md 编译安装;Python 用户可 pip install unicornREADME 未说明具体硬件要求;支持 Windows 与 *nix(Mac OSX、Linux、Android、*BSD、Solaris 已验证)。
基于 QEMU 的轻量级多架构 CPU 模拟框架,可在代码中直接模拟执行多种指令集
轻量级多架构 CPU 模拟框架,支持 ARM、MIPS、RISC-V、X86 等十余种指令集,常用于逆向工程、恶意代码分析和嵌入式固件调试。
核心能力
- 支持 ARM、ARM64、M68K、MIPS、PowerPC、RISCV、SPARC、S390X、TriCore、X86 多架构
- 提供简洁、与架构无关的纯 C API
- 通过 JIT 编译实现高性能模拟
- 支持细粒度插桩,可挂钩指令级行为
- 设计上线程安全,并提供 Python、Rust、Go 等十余种语言绑定
容易踩的坑
- 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-systo 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
- bindings/zig: Fix sample_riscv_zig partial writes and logging by @fervagar in https://github.com/unicorn-engine/unicorn/pull/2133
- Fix physical address truncation on 32-bit systems with addressing extensions by @ExhoAR22 in https://github.com/unicorn-engine/unicorn/pull/2139
- refactor(lib): mark pointers as const where possible by @amaanq in https://github.com/unicorn-engine/unicorn/pull/2140
- bindings: ruby: fix unexpected uc_query result pointer type by @anthraxx in https://github.com/unicorn-engine/unicorn/pull/1962
- bindings: ruby: fix version identifier to 2.1.3 by @anthraxx in https://github.com/unicorn-engine/unicorn/pull/2142
- feat(arm): add an
ESRregister by @amaanq in https://github.com/unicorn-engine/unicorn/pull/2155 - fix(rust): watch all source and header files by @amaanq in https://github.com/unicorn-engine/unicorn/pull/2159
- feat(rust): improve ARM CP register ergonomics by @amaanq in https://github.com/unicorn-engine/unicorn/pull/2160
- fix(m68k): correct SR register read by @amaanq in https://github.com/unicorn-engine/unicorn/pull/2161
- fix(python): catch
BaseExceptionin wrappers instead ofExceptionby @amaanq in https://github.com/unicorn-engine/unicorn/pull/2163 - Remove the size limit for memory read and write (revamped) by @rliebig in https://github.com/unicorn-engine/unicorn/pull/2144
- Loongarch port by @wtdcode in https://github.com/unicorn-engine/unicorn/pull/2164
- S390x registers by @wtdcode in https://github.com/unicorn-engine/unicorn/pull/2167
- Add from_handle_with_data method by @Evian-Zhang in https://github.com/unicorn-engine/unicorn/pull/2169
- Make Unicorn struct clone-able by @Evian-Zhang in https://github.com/unicorn-engine/unicorn/pull/2170
- Add Display and Error impl for uc_error for Rust bindings by @Evian-Zhang in https://github.com/unicorn-engine/unicorn/pull/2171
- Add edge generated callback by @Evian-Zhang in https://github.com/unicorn-engine/unicorn/pull/2176
- Correctly restore skip_sync_pc_on_exit by @Evian-Zhang in https://github.com/unicorn-engine/un
- 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_HASWELLand remove a few quirks. - Fix CR4 implementation.
- Fix python bindings break changes by adding back
ctl_tlb_mode. @Antelox
New Contributors
- @OBarronCS made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2111
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 !).
- 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
- @droe made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2023
- @Antelox made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2026
- @tbodt made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2049
- @hsa1as made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2060
- @t0rr3sp3dr0 made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2066
- @Sanae6 made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2069
- @Michael-c0de made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2063
- @Evian-Zhang made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2064
- @glennsec made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2028
- @clan made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2085
- @xndcn made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2091
- @Shivam7-1 made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2096
- @amaanq made their first contribution in https://github.com/unicorn-engine/unicorn/pull/2099
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.
- 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
musllinuxdistribution @Antelox
Full Changelog: https://github.com/unicorn-engine/unicorn/compare/2.1.0...2.1.1
- 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=yesto enable all qemu logs. @BitMaskMixer - Faster (up to 40x) write performance by not always doing
store_helperand 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
- @ks0777 made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1736
- @LG3696 made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1764
- @PhilippTakacs made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1765
- @edsky made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1754
- @tunz made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1790
- @kassane made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1809
- @Xeonacid made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1807
- @nneonneo made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1830
- @lockbox made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1847
- @mlgiraud made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1849
- @basavesh made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1861
- @hamarituc made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1886
- @StalkR made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1907
- @dotCirill made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1910
- @marameref made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1897
- @redoste made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1922
- @xclusivor made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1929
- @elicn made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1629
- @nganhkhoa made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1942
- @es3n1n made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1960
- @BitMaskMixer made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1977
- @apparentlymart made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1995
- @atipls made their first contribution in https://github.com/unicorn-engine/unicorn/pull/1985
- @omer54463 made
- Revive QEMU logs, now we have
用户点评
登录用户的真实使用记录,可按版本和硬件筛选还没有人点评。第一个说出真实体验的人最有价值。
Unicorn Engine
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.