iced-x86
Blazing-fast, correct x86/x64 disassembler, assembler, decoder, and encoder written in pure Rust.
Repository Health
Technical Analysis
iced-x86 is a high-performance x86 (16/32/64-bit) instruction decoder, disassembler, assembler, and encoder written entirely in Rust. It supports the full Intel and AMD instruction set, offers masm, nasm, gas (AT&T), and Intel (XED) formatter syntaxes, and exposes rich instruction metadata such as read/written registers, memory operands, rflags bits, CPUID feature flags, and control-flow information.
Designed for correctness and speed, iced-x86 has been tested against xed, gas, objdump, masm, dumpbin, nasm, and ndisasm and fuzzed extensively. Decoded instructions are just 40 bytes and the decoder allocates no memory, making it well suited for high-throughput binary analysis, JIT tooling, and reverse engineering. It also supports #![no_std] and WebAssembly targets.
What You Get
- A fast, allocation-free decoder that turns raw x86/x64 bytes into 40-byte instruction structs
- Formatters for masm, nasm, gas (AT&T), and Intel (XED) syntax with extensive customization options
- An encoder and BlockEncoder for re-encoding decoded instructions at arbitrary addresses
- A CodeAssembler API for ergonomically building instructions, e.g.
asm.mov(eax, edx) - Instruction-info APIs exposing read/written registers and memory, rflags, CPUID flags, and control flow
Common Use Cases
- Building disassemblers, debuggers, and reverse-engineering tooling
- Analyzing or rewriting binaries, including function hooking and code relocation
- Generating and encoding machine code for JITs and binary instrumentation
Under The Hood
Architecture - iced-x86 is organized around a table-driven decoder that maps opcode bytes into a compact 40-byte Instruction struct, with separate encoder, formatter, and instruction-info subsystems layered on top; the crate lives under src/rust/iced-x86 in the larger icedland/iced monorepo that also hosts .NET, Java, Python, and Lua bindings.
Tech Stack - Written in 100% safe-leaning Rust targeting rustc 1.64.0+, with lazy_static as its only runtime dependency and granular Cargo feature flags (decoder, encoder, gas, nasm, code_asm, no_std, and more) so consumers compile only what they use, including #![no_std] and WebAssembly builds.
Code Quality - Correctness is a first-class concern: instructions are tested against xed, gas, objdump, masm, dumpbin, nasm, and ndisasm and continuously fuzzed, and the decoder is allocation-free for predictable performance.
API Design - The public surface is ergonomic and consistent, offering both low-level decode/encode primitives and a fluent CodeAssembler (e.g. asm.mov(eax, edx)), backed by extensive docs.rs documentation and worked how-to examples in the README.