From 0c9a67c6c04f7ad5f9415c8344be1e992d4d9f29 Mon Sep 17 00:00:00 2001 From: xtremegamer1 Date: Sun, 16 Oct 2022 04:37:23 -0600 Subject: [PATCH] Check for 64 bit GP --- include/vmutils.hpp | 2 ++ src/vmutils.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/include/vmutils.hpp b/include/vmutils.hpp index d66d7dc..e0bd3bd 100644 --- a/include/vmutils.hpp +++ b/include/vmutils.hpp @@ -72,6 +72,8 @@ bool is_jmp(const zydis_decoded_instr_t& instr); bool is_32_bit_gp(const ZydisRegister reg); +bool is_64_bit_gp(const ZydisRegister reg); + /// /// used by profiles to see if an instruction is a MOV/SX/ZX... /// diff --git a/src/vmutils.cpp b/src/vmutils.cpp index f6b9ce3..06cfff7 100644 --- a/src/vmutils.cpp +++ b/src/vmutils.cpp @@ -33,6 +33,11 @@ bool is_32_bit_gp(const ZydisRegister reg) return reg >= ZYDIS_REGISTER_EAX && reg <= ZYDIS_REGISTER_R15D; } +bool is_64_bit_gp(const ZydisRegister reg) +{ + return reg >= ZYDIS_REGISTER_RAX && reg <= ZYDIS_REGISTER_R15; +} + bool flatten(zydis_rtn_t& routine, std::uintptr_t routine_addr, bool keep_jmps,