Unicorn Engine is a lightweight, multi-architecture CPU emulation framework derived from QEMU. It provides a pure C API with bindings for Python, Go, Java, Rust, Ruby, .NET, Haskell, Pascal, Zig, and VB6. The engine supports ARM, ARM64, M68K, MIPS, PowerPC, RISC-V, S390X, SPARC, TriCore, and x86 (16/32/64-bit). It is used primarily for security research, reverse engineering, fuzzing, and dynamic analysis of binary code. The architecture is a library with a central C API that exposes memory mapping, register access, hooks (code, block, memory, interrupt, instruction, syscall, TLB), and context save/restore. The core emulation logic is based on QEMU's TCG (Tiny Code Generator) for dynamic binary translation, with a custom glib compatibility layer to eliminate external dependencies. The repository includes extensive regression tests, fuzz targets, and sample programs for each architecture and binding. While the engine is actively maintained and widely used, it carries technical debt from its QEMU fork (based on QEMU 5.0.1) and auto-generated binding constants that may drift from the C API.
This repository implements a complete 16-bit computer simulator built from fundamental logic gates (NAND, AND, OR, etc.) in Go. It includes a CPU, memory, ALU, memory-mapped I/O (keyboard and 240×160 pixel display), and a custom instruction set. The project provides three command-line tools: a simulator that loads binary programs and runs them with a GLFW-based graphical window, an assembler that converts a custom assembly language into binary, and a program generator that produces example assembly programs (e.g., text writer, sine wave animation, snake brush). The system is a faithful gate-level simulation—every component from bits to the CPU is wired together using Go structs, making it an educational tool for understanding computer architecture.