Module bddisasm::cpu_modes

source ·
Expand description

Offers information about the CPU modes in which an instruction is supported.

§Examples

use bddisasm::{DecodedInstruction, DecodeMode, Mnemonic};

// `VMXON     qword ptr [rax]`
let ins = DecodedInstruction::decode(&[0xf3, 0x0f, 0xc7, 0x30], DecodeMode::Bits64)?;
let modes = ins.valid_cpu_modes();

// Check if the instruction is available from user mode
if modes.privilege_level.ring3 {
    println!("Available in user mode");
} else {
    println!("Not available in user mode");
}

Structs§

  • Indicates in which modes the instruction is valid in
  • Operating modes in which an instruction is supported.
  • Privilege levels (rings) in which an instruction is supported.
  • Special modes - these may be active inside other modes (example: TSX in Long mode).
  • VMX mode - they engulf all the other modes.