binbun-disasm 0.1.0

Decode and inspect x86 and AArch64 instructions through one API.
Documentation

binbun-disasm

The x86 and AArch64 disassemblers of binbun through one API: decode, print and inspect instructions (operands, the registers they read and write, control flow) the same way for either architecture. For everything one architecture's decoder offers, use binbun-x86 or binbun-aarch64.

use binbun_disasm::{Arch, Decoder, x86};

let code = [0x55, 0x48, 0x89, 0xe5, 0x31, 0xc0, 0x5d, 0xc3];
for (address, decoded) in Decoder::new(Arch::X86(x86::Mode::Bits64), &code, 0x40_1000) {
    if let Ok(insn) = decoded {
        println!("{address:#x}  {insn}");
    }
}

The features x86 and aarch64 (both on by default) choose the architectures. More examples are in the repository.

Licensed under either of Apache License, Version 2.0 or MIT license at your option.