From 44bf42af02a47077fe2b0751759542324f6ee1f8 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 19 Aug 2021 18:39:44 -0700 Subject: [PATCH] updated transforms to include XCHG as well as updated readme... --- README.md | 4 ++-- include/transform.hpp | 11 ++++++----- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8f95f52..01b4041 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,12 @@ vmprofiler is a c++ library which is used to statically analyze VMProtect 2 poly ### Build Instructions -* Warning: Visual Studio 2019 must be installed on the system... +* Warning: Visual Studio 2019 must be installed on the system... Also please make sure it is completely up-to-date! You will have compile issues if you are not updated :) ``` git clone --recursive https://githacks.org/vmp2/vmprofiler.git cd vmprofiler -cmake -G "Visual Studio 16 2019" +cmake -B build ``` You can now open `vmprofiler.sln`, select "Release" and "x64" then build. diff --git a/include/transform.hpp b/include/transform.hpp index 562961b..5ada35a 100644 --- a/include/transform.hpp +++ b/include/transform.hpp @@ -205,17 +205,18 @@ namespace vm::transform template < class T > inline std::map< zydis_mnemonic_t, transform_t< T > > transforms = { - { ZYDIS_MNEMONIC_ADD, _add< T > }, { ZYDIS_MNEMONIC_XOR, _xor< T > }, { ZYDIS_MNEMONIC_BSWAP, _bswap< T > }, - { ZYDIS_MNEMONIC_SUB, _sub< T > }, { ZYDIS_MNEMONIC_NEG, _neg< T > }, { ZYDIS_MNEMONIC_NOT, _not< T > }, - { ZYDIS_MNEMONIC_ROR, _ror< T > }, { ZYDIS_MNEMONIC_ROL, _rol< T > }, { ZYDIS_MNEMONIC_INC, _inc< T > }, - { ZYDIS_MNEMONIC_DEC, _dec< T > } }; + { ZYDIS_MNEMONIC_ADD, _add< T > }, { ZYDIS_MNEMONIC_XOR, _xor< T > }, { ZYDIS_MNEMONIC_BSWAP, _bswap< T > }, + { ZYDIS_MNEMONIC_SUB, _sub< T > }, { ZYDIS_MNEMONIC_NEG, _neg< T > }, { ZYDIS_MNEMONIC_NOT, _not< T > }, + { ZYDIS_MNEMONIC_ROR, _ror< T > }, { ZYDIS_MNEMONIC_ROL, _rol< T > }, { ZYDIS_MNEMONIC_INC, _inc< T > }, + { ZYDIS_MNEMONIC_DEC, _dec< T > }, { ZYDIS_MNEMONIC_XCHG, _bswap< T > } }; inline std::map< zydis_mnemonic_t, zydis_mnemonic_t > inverse = { { ZYDIS_MNEMONIC_ADD, ZYDIS_MNEMONIC_SUB }, { ZYDIS_MNEMONIC_XOR, ZYDIS_MNEMONIC_XOR }, { ZYDIS_MNEMONIC_BSWAP, ZYDIS_MNEMONIC_BSWAP }, { ZYDIS_MNEMONIC_SUB, ZYDIS_MNEMONIC_ADD }, { ZYDIS_MNEMONIC_NEG, ZYDIS_MNEMONIC_NEG }, { ZYDIS_MNEMONIC_NOT, ZYDIS_MNEMONIC_NOT }, { ZYDIS_MNEMONIC_ROR, ZYDIS_MNEMONIC_ROL }, { ZYDIS_MNEMONIC_ROL, ZYDIS_MNEMONIC_ROR }, - { ZYDIS_MNEMONIC_INC, ZYDIS_MNEMONIC_DEC }, { ZYDIS_MNEMONIC_DEC, ZYDIS_MNEMONIC_INC } }; + { ZYDIS_MNEMONIC_INC, ZYDIS_MNEMONIC_DEC }, { ZYDIS_MNEMONIC_DEC, ZYDIS_MNEMONIC_INC }, + { ZYDIS_MNEMONIC_XCHG, ZYDIS_MNEMONIC_XCHG } }; /// /// determines if the given mnemonic is a valid transformation...