From a493b4d267c4fb6a042cf071301c8885196b4a91 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 21 Mar 2021 01:02:00 -0700 Subject: rewrite 0f-based instruction handling this is... a more significant rewrite than i expected yaxpeax-x86 to ever need. it turns out that capstone is extremely permissive about duplicative 66/f2/f3 prefixes to the point that the implemented prefex handling was unsalvageable. while this replaces the *0f* opcode tables, i haven't profiled these changes. it's possible this is a net improvement for single-byte opcodes, it could be a net loss. code size may be severely impacted. there is still work to do. but this in total gets very close to iced/xed/zydis parity, far more than before. also adds several small extensions, gfni, 3dnow, enqcmd, invpcid, some of cet, and a few missing avx instructions. --- src/long_mode/display.rs | 52 ++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) (limited to 'src/long_mode/display.rs') diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index df7237d..3e38d8d 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -570,6 +570,10 @@ const MNEMONICS: &[&'static str] = &[ "movnti", "movntps", "movntpd", + "extrq", + "insertq", + "movntss", + "movntsd", "movntq", "movntdq", "mulps", @@ -842,6 +846,10 @@ const MNEMONICS: &[&'static str] = &[ "vpaddusw", "vpaddw", "vpalignr", + "vandps", + "vandpd", + "vandnps", + "vandnpd", "vpand", "vpandn", "vpavgb", @@ -1086,6 +1094,8 @@ const MNEMONICS: &[&'static str] = &[ "vmsave", "vmrun", "invlpga", + "invlpgb", + "tlbsync", "movbe", "adcx", "adox", @@ -1248,15 +1258,33 @@ const MNEMONICS: &[&'static str] = &[ "pfacc", "pfcmpeq", "pfmul", + "pfmulhrw", "pfrcpit2", "pfnacc", - "pswapd", "pfpnacc", + "pswapd", "pavgusb", // ENQCMD "enqcmd", "enqcmds", + + // INVPCID, + "invept", + "invvpid", + "invpcid", + + // PTWRITE + "ptwrite", + + // GFNI + "gf2p8affineqb", + "gf2p8affineinvqb", + "gf2p8mulb", + + // CET + "wruss", + "wrss", ]; impl Opcode { @@ -1423,6 +1451,10 @@ impl > Colorize> Colorize> Colorize> Colorize> Colorize> Colorize { write!(out, "{}", colors.platform_op(self)) } Opcode::CRC32 | @@ -2253,6 +2296,9 @@ impl > Colorize> Colorize