From a2d4713dcae92cc16838c43f3a5e9703a1c926da Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 22 Feb 2020 16:42:14 -0800 Subject: explicitly report x87 as not (yet) supported --- README.md | 1 + src/long_mode/mod.rs | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 32dc882..98b888d 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ the canonical copy of `yaxpeax-x86` is at [https://git.iximeow.net/yaxpeax-x86/] * `yaxpeax-x86` will, but does not yet, have decoders for protected-mode and real-mode `x86`. currently, `yaxpeax-x86` assumes that it is decoding long mode `x86_64` instructions. it is strongly recommended to use `::Instruction` and similar type aliases, rather than using struct and operand types directly. user beware! * avx512 is not yet supported. user beware! * avx256 support is questionable. user beware! +* x87 is not yet supported. user beware! * ring-0 instructions have questionable support. user beware! * the only unsafe code in `yaxpeax_x86` is instances of `unsafe { unreachable_unchecked(); }`. while these are, currently, all unreachable, this code should default to a fail-safe assertion fail, with `unreachable_unchecked` being an opt-in feature. user beware! diff --git a/src/long_mode/mod.rs b/src/long_mode/mod.rs index 73570c1..a18a62c 100644 --- a/src/long_mode/mod.rs +++ b/src/long_mode/mod.rs @@ -4366,21 +4366,21 @@ const OPCODES: [OpcodeRecord; 256] = [ // XLAT OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), // x86 d8 - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 d9 - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 da - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 db - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 dc - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 dd - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 de - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // x86 df - OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), + OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Unsupported), // 0xe0 // LOOPNZ OpcodeRecord(Interpretation::Instruction(Opcode::Invalid), OperandCode::Nothing), @@ -5357,6 +5357,9 @@ fn read_operands>(decoder: &InstDecoder, mut bytes_iter: T, } fn unlikely_operands>(decoder: &InstDecoder, mut bytes_iter: T, instruction: &mut Instruction, operand_code: OperandCode, mem_oper: OperandSpec, length: &mut u8) -> Result<(), DecodeError> { match operand_code { + OperandCode::Unsupported => { + return Err(DecodeError::IncompleteDecoder); + } OperandCode::MOVQ_f30f => { // if rex.w is set, the f3 prefix no longer applies and this becomes an 0f7e movq, // rather than f30f7e movq. -- cgit v1.1