aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2021-07-03 15:51:22 -0700
committeriximeow <me@iximeow.net>2021-07-03 15:51:22 -0700
commit7e154da8e2bd7b8892bdefe2f71c111c2135b0a3 (patch)
treeb1b945803f37c48a7dd7e5a23e0656ee1d9c83b9 /test
parent582c4e44579d4bbb9dcec9d12c23c8b774db3cfb (diff)
be more strict about denying invalid operands
Diffstat (limited to 'test')
-rw-r--r--test/long_mode/mod.rs8
-rw-r--r--test/long_mode/reuse_test.rs9
-rw-r--r--test/protected_mode/mod.rs2
3 files changed, 9 insertions, 10 deletions
diff --git a/test/long_mode/mod.rs b/test/long_mode/mod.rs
index 4d44694..f9a3fef 100644
--- a/test/long_mode/mod.rs
+++ b/test/long_mode/mod.rs
@@ -1869,7 +1869,7 @@ fn test_vex() {
test_instr(&[0xc4, 0b000_00001, 0b1_0111_000, 0x16, 0b00_001_010], "vmovhps xmm9, xmm8, qword [r10]");
test_invalid(&[0xc4, 0b000_00001, 0b1_0111_100, 0x16, 0b00_001_010]);
test_instr(&[0xc4, 0b000_00001, 0b1_0111_001, 0x16, 0b00_001_010], "vmovhpd xmm9, xmm8, qword [r10]");
- test_instr(&[0xc4, 0b000_00001, 0b1_0111_101, 0x16, 0b00_001_010], "vmovhpd xmm9, xmm8, qword [r10]");
+ test_invalid(&[0xc4, 0b000_00001, 0b1_0111_101, 0x16, 0b00_001_010]);
test_invalid(&[0xc4, 0b000_00001, 0b1_0111_001, 0x16, 0b11_001_010]);
test_instr(&[0xc4, 0b000_00001, 0b1_1111_000, 0x17, 0b00_001_010], "vmovhps qword [r10], xmm9");
test_invalid(&[0xc4, 0b000_00001, 0b1_1111_100, 0x17, 0b00_001_010]);
@@ -3147,6 +3147,12 @@ fn test_x87() {
#[test]
fn test_mishegos_finds() {
+ test_invalid(&[0xc5, 0x4d, 0x16, 0x0f]);
+ test_invalid(&[0xf3, 0x67, 0x0f, 0x3a, 0xf0, 0xfb, 0xb4]);
+// XOP is still not supported
+// test_display(&[0xc4, 0x63, 0x91, 0x7f, 0x2f, 0x2e], "vfnmsubsd xmm13, xmm13, xmm2, qword ptr [rdi]");
+ test_invalid(&[0x62, 0xf1, 0x56, 0xfe, 0x58, 0x04, 0xca]);
+ test_invalid(&[0x66, 0xf3, 0x36, 0x65, 0x0f, 0x3a, 0xf0, 0xee, 0x7a]);
test_display(&[0x62, 0x42, 0xd5, 0x9d, 0x97, 0xf6], "vfmsubadd132pd zmm30{k5}{z}{rne-sae}, zmm5, zmm14");
test_invalid(&[0x67, 0x66, 0x42, 0x0f, 0x01, 0xfe]);
test_display(&[0x62, 0x52, 0x05, 0xff, 0xad, 0xfd], "vfnmadd213ss xmm15{k7}{z}{rz-sae}, xmm15, xmm13");
diff --git a/test/long_mode/reuse_test.rs b/test/long_mode/reuse_test.rs
index 60a91e1..ad8e890 100644
--- a/test/long_mode/reuse_test.rs
+++ b/test/long_mode/reuse_test.rs
@@ -1,7 +1,7 @@
use yaxpeax_arch::Decoder;
use yaxpeax_x86::long_mode::InstDecoder;
-const INSTRUCTIONS: [&'static [u8]; 1982] = [
+const INSTRUCTIONS: [&'static [u8]; 1975] = [
&[0xc4, 0b000_00001, 0b0_0111_101, 0x60, 0b11_001_010],
&[0xc4, 0b000_00001, 0b0_0111_101, 0x61, 0b11_001_010],
&[0xc4, 0b000_00001, 0b0_0111_101, 0x62, 0b11_001_010],
@@ -1441,7 +1441,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00001, 0b0_1111_111, 0x2d, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0x12, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0x12, 0b11_001_010],
- &[0xc4, 0b000_00001, 0b1_0111_000, 0x16, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0x54, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0x55, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0x56, 0b00_001_010],
@@ -1454,7 +1453,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00001, 0b1_0111_000, 0x5f, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_000, 0xc2, 0b11_001_010, 0x77],
&[0xc4, 0b000_00001, 0b1_0111_001, 0x12, 0b00_001_010],
- &[0xc4, 0b000_00001, 0b1_0111_001, 0x16, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_001, 0x54, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_001, 0x55, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_001, 0x56, 0b00_001_010],
@@ -1528,7 +1526,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00001, 0b1_0111_100, 0x5e, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_100, 0x5f, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_100, 0xc2, 0b11_001_010, 0x77],
- &[0xc4, 0b000_00001, 0b1_0111_101, 0x16, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_101, 0x54, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_101, 0x55, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_0111_101, 0x56, 0b00_001_010],
@@ -1600,7 +1597,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00001, 0b1_1111_010, 0x10, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_1111_010, 0x11, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_1111_010, 0x12, 0b00_001_010],
- &[0xc4, 0b000_00001, 0b1_1111_010, 0x16, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_1111_010, 0x2a, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_1111_010, 0x2a, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_1111_010, 0x51, 0b00_001_010],
@@ -1645,7 +1641,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00001, 0b1_1111_110, 0x10, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_1111_110, 0x11, 0b00_001_010],
&[0xc4, 0b000_00001, 0b1_1111_110, 0x12, 0b00_001_010],
- &[0xc4, 0b000_00001, 0b1_1111_110, 0x16, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_1111_110, 0x2a, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_1111_110, 0x2c, 0b11_001_010],
&[0xc4, 0b000_00001, 0b1_1111_110, 0x2d, 0b00_001_010],
@@ -1780,8 +1775,6 @@ const INSTRUCTIONS: [&'static [u8]; 1982] = [
&[0xc4, 0b000_00011, 0b1_0111_001, 0x22, 0b00_001_010, 0x77],
&[0xc4, 0b000_00011, 0b1_0111_001, 0x22, 0b11_001_010, 0x77],
&[0xc4, 0b000_00011, 0b1_0111_101, 0x0f, 0b11_001_010, 0x77],
- &[0xc4, 0b000_00011, 0b1_1111_001, 0x16, 0b00_001_010, 0x77],
- &[0xc4, 0b000_00011, 0b1_1111_001, 0x16, 0b11_001_010, 0x77],
&[0xc4, 0x02, 0x09, 0x9d, 0xcd],
&[0xc4, 0x02, 0x71, 0x00, 0x0f],
&[0xc4, 0x02, 0x71, 0x00, 0xcd],
diff --git a/test/protected_mode/mod.rs b/test/protected_mode/mod.rs
index c742516..04a5676 100644
--- a/test/protected_mode/mod.rs
+++ b/test/protected_mode/mod.rs
@@ -1751,7 +1751,7 @@ fn test_vex() {
test_instr(&[0xc4, 0b110_00001, 0b1_0111_000, 0x16, 0b00_001_010], "vmovhps xmm1, xmm0, qword [edx]");
test_invalid(&[0xc4, 0b110_00001, 0b1_0111_100, 0x16, 0b00_001_010]);
test_instr(&[0xc4, 0b110_00001, 0b1_0111_001, 0x16, 0b00_001_010], "vmovhpd xmm1, xmm0, qword [edx]");
- test_instr(&[0xc4, 0b110_00001, 0b1_0111_101, 0x16, 0b00_001_010], "vmovhpd xmm1, xmm0, qword [edx]");
+ test_invalid(&[0xc4, 0b110_00001, 0b1_0111_101, 0x16, 0b00_001_010]);
test_invalid(&[0xc4, 0b110_00001, 0b1_0111_001, 0x16, 0b11_001_010]);
test_instr(&[0xc4, 0b110_00001, 0b1_1111_000, 0x17, 0b00_001_010], "vmovhps qword [edx], xmm1");
test_invalid(&[0xc4, 0b110_00001, 0b1_1111_100, 0x17, 0b00_001_010]);