From 4f2366afd198b30c3ec335667c65a2f1b6725dd5 Mon Sep 17 00:00:00 2001 From: Alexis Engelke Date: Sat, 23 Jan 2021 16:47:30 +0100 Subject: [PATCH] instrs: Add VIA PadLock and AMD RDPRU --- instrs.txt | 15 +++++++++++++++ parseinstrs.py | 1 + tests/test_decode.c | 8 ++++++++ 3 files changed, 24 insertions(+) diff --git a/instrs.txt b/instrs.txt index d5d592e..b5d8e3c 100644 --- a/instrs.txt +++ b/instrs.txt @@ -1454,6 +1454,18 @@ F3.0fae/5r M GP - - - INCSSP # CLDEMOTE NP.0f1c/0m M MEM8 - - - CLDEMOTE +# VIA PadLock +F3.0fa6c0 NP - - - - REP_MONTMUL ONLYVIA +F3.0fa6c8 NP - - - - REP_XSHA1 ONLYVIA +F3.0fa6d0 NP - - - - REP_XSHA256 ONLYVIA +NFx.0fa7c0 NP - - - - XSTORE ONLYVIA +F3.0fa7c0 NP - - - - REP_XSTORE ONLYVIA +F3.0fa7c8 NP - - - - REP_XCRYPTECB ONLYVIA +F3.0fa7d0 NP - - - - REP_XCRYPTCBC ONLYVIA +F3.0fa7d8 NP - - - - REP_XCRYPTCTR ONLYVIA +F3.0fa7e0 NP - - - - REP_XCRYPTCFB ONLYVIA +F3.0fa7e8 NP - - - - REP_XCRYPTOFB ONLYVIA + # VMX 66.0f3880/m RM GP MEMZ - - INVEPT DEF64 66.0f3881/m RM GP MEMZ - - INVVPID DEF64 @@ -1474,6 +1486,9 @@ F3.0fc7/6m M MEM64 - - - VMXON 66.0f01ce NP - - - - SEAMOPS 66.0f01cf NP - - - - SEAMCALL +# AMD RDPRU +0f01fd NP - - - - RDPRU ONLYAMD + # AMD SVM 0f01d8 NP - - - - VMRUN ONLYAMD 0f01d9 NP - - - - VMMCALL ONLYAMD diff --git a/parseinstrs.py b/parseinstrs.py index 8901188..962c17b 100644 --- a/parseinstrs.py +++ b/parseinstrs.py @@ -456,6 +456,7 @@ def decode_table(entries, modes): .replace("JMPF", "JMP FAR").replace("CALLF", "CALL FAR") .replace("_S2G", "").replace("_G2S", "") .replace("_CR", "").replace("_DR", "") + .replace("REP_", "REP ") .lower() for m in mnems] defines = ["FD_TABLE_OFFSET_%d %d"%k for k in zip(modes, root_offsets)] diff --git a/tests/test_decode.c b/tests/test_decode.c index 29b624f..5b7772f 100644 --- a/tests/test_decode.c +++ b/tests/test_decode.c @@ -597,6 +597,14 @@ main(int argc, char** argv) TEST("\x0f\x0f\xc0\xb6", "3dnow mm0, mm0, 0xb6"); // PFRCPIT2 TEST("\x0f\x0f\xc0\xbf", "3dnow mm0, mm0, 0xbf"); // PAVGUSB + // VIA PadLock + TEST("\x0f\xa7\xc0", "xstore"); + TEST("\xf3\x0f\xa7\xc0", "rep xstore"); + TEST("\xf2\x0f\xa7\xc0", "UD"); + TEST("\x0f\xa7\xe8 ", "UD"); + TEST("\xf2\x0f\xa7\xe8", "UD"); + TEST("\xf3\x0f\xa7\xe8", "rep xcryptofb"); + puts(failed ? "Some tests FAILED" : "All tests PASSED"); return failed ? EXIT_FAILURE : EXIT_SUCCESS; }