diff options
Diffstat (limited to 'src/protected_mode/vex.rs')
-rw-r--r-- | src/protected_mode/vex.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/protected_mode/vex.rs b/src/protected_mode/vex.rs index 3550f77..54c9d23 100644 --- a/src/protected_mode/vex.rs +++ b/src/protected_mode/vex.rs @@ -440,6 +440,12 @@ fn read_vex_operands<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch as y Ok(()) } VEXOperandCode::Nothing => { + if instruction.opcode == Opcode::VZEROUPPER || instruction.opcode == Opcode::VZEROALL { + if instruction.regs[3].num != 0 { + instruction.opcode = Opcode::Invalid; + return Err(DecodeError::InvalidOperand); + } + } instruction.operand_count = 0; Ok(()) }, @@ -1470,7 +1476,11 @@ fn read_vex_instruction<T: Reader<<Arch as yaxpeax_arch::Arch>::Address, <Arch a } else { VEXOperandCode::G_V_E_xmm }), - 0x77 => (Opcode::VZEROUPPER, VEXOperandCode::Nothing), + 0x77 => if L { + (Opcode::VZEROALL, VEXOperandCode::Nothing) + } else { + (Opcode::VZEROUPPER, VEXOperandCode::Nothing) + }, 0xAE => (Opcode::Invalid, if L { return Err(DecodeError::InvalidOpcode); } else { |