Function bad64::disasm[][src]

pub fn disasm(
    code: &[u8],
    address: u64
) -> impl Iterator<Item = Result<Instruction, DecodeError>> + '_
Expand description

Disassemble byte slice


  • code - u8 slice to zero or more instructions
  • address - Location of code in memory


use bad64::{disasm, Op};

let mut decoded_iter = disasm(b"\x1f\x20\x03\xd5", 0x1000);

let decoded =;

assert_eq!(decoded.address(), 0x1000);
assert_eq!(decoded.operands().len(), 0);
assert_eq!(decoded.op(), Op::NOP);
assert_eq!(decoded.op().mnem(), "nop");

assert_eq!(, None);