diff --git a/include/vmutils.hpp b/include/vmutils.hpp index 14af5ab..d66d7dc 100644 --- a/include/vmutils.hpp +++ b/include/vmutils.hpp @@ -70,6 +70,8 @@ inline bool open_binary_file(const std::string& file, /// bool is_jmp(const zydis_decoded_instr_t& instr); +bool is_32_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 73e917c..f6b9ce3 100644 --- a/src/vmutils.cpp +++ b/src/vmutils.cpp @@ -28,6 +28,11 @@ bool is_mov(const zydis_decoded_instr_t& instr) { instr.mnemonic == ZYDIS_MNEMONIC_MOVZX; } +bool is_32_bit_gp(const ZydisRegister reg) +{ + return reg >= ZYDIS_REGISTER_EAX && reg <= ZYDIS_REGISTER_R15D; +} + bool flatten(zydis_rtn_t& routine, std::uintptr_t routine_addr, bool keep_jmps,