Skip to content

v1.14.0

Compare
Choose a tag to compare
@wtfsck wtfsck released this 19 Aug 14:42
· 1084 commits to master since this release
  • Rust: Creating instructions got a lot easier:
    let mut a = CodeAssembler::new(64)?;
    a.xor(ecx, ecx)?;
    a.add(byte_ptr(rdx + r15 * 8 + 7), 0x10)?;
    assert_eq!(a.instructions().len(), 2);
    let bytes = a.assemble(0x1234_5678)?;
    assert_eq!(bytes, b"\x31\xC9\x42\x80\x44\xFA\x07\x10");
    All instructions are supported, including VEX/EVEX instructions.
    It requires the code_asm feature which is disabled by default.
    See the Rust README for a longer example.
  • Rust: Added Instruction::with{1,2,3,4,5}() methods to create instructions. The older methods with longer names have been deprecated.
    // old: 
    let _ = Instruction::try_with_reg_reg_u32(Code::Imul_r16_rm16_imm16, Register::CX, Register::DX, 0x5AA5)?;
    // new: (the '3' suffix means '3 operands')
    let _ = Instruction::with3(Code::Imul_r16_rm16_imm16, Register::CX, Register::DX, 0x5AA5)?;
    // A number suffix (`u32`, `u64`, `i64`) is sometimes needed to help the compiler:
    let _ = Instruction::with2(Code::Mov_r64_imm64, Register::RAX, 0x1234_5678_9ABC_DEF0u64)?;
  • Python: Instruction can be serialized/deserialized with pickle (Credit: @paulfariello)
  • Added Instruction::is_string_instruction() (Credit: @woodruffw) which returns true if it's eg. SCASB, MOVSQ, or any other string instruction.
  • Rust: optional serde feature added to serialize/deserialize Instruction