Zydis is a C library that decodes and encodes x86 and AMD64 instructions with optional formatting. It targets tools that need compact, fast machine-code introspection without libc or other runtime dependencies.
Overview
Zydis disassembles and encodes Intel and AMD x86 and x86-64 machine code for programs that must inspect or emit instructions in user mode, kernels, or unusual environments. The API covers decoding buffers to structured instruction data, encoding instructions, and printing human-readable text, with documentation generated for the public interfaces.
The implementation emphasizes performance, a small binary footprint, no dynamic allocation in normal operation, and thread safety by design. It supports the instruction sets and extensions from both vendors and exposes rich per-instruction metadata such as registers, flags, and byte offsets of instruction fragments. The project ships amalgamated single-file builds, CMake and Visual Studio build paths, package-manager packages, and a ZydisInfo CLI for inspecting what the library knows about an opcode.
Reported deployments include debuggers, browsers, and other large open-source codebases. Bindings and higher-level wrappers exist in the ecosystem, including a C++-style front end in related projects. The library is MIT licensed and offers optional commercial consulting for integrations and custom extensions.
Key features
- Full x86 and x86-64 decode and encode
- No libc or third-party dependencies
- Thread-safe design without malloc in core paths
- Instruction metadata including flags and registers
- Decoder, encoder, and formatter APIs
- Amalgamated single-header distribution
- ZydisInfo CLI for instruction inspection
- CMake, Visual Studio, and package-manager builds
Use cases
- Building debuggers and reverse-engineering tools
- JIT and codegen pipelines needing x86 encode
- Kernel, UEFI, or libc-free firmware tooling
- Instruction introspection in security analysis
- Embedding disassembly in larger C or C++ apps