From 9b255f14128aa70b48ef21ba04685cda057dc0cb Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Tue, 1 Jun 2021 15:11:08 -0700 Subject: [PATCH] fixed vm::transform::inverse_transforms --- include/transform.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/transform.hpp b/include/transform.hpp index e06f440..d24facb 100644 --- a/include/transform.hpp +++ b/include/transform.hpp @@ -176,12 +176,13 @@ namespace vm transform::inverse[ transforms[ transform::type::update_key ].mnemonic ]; } - inline auto inverse_transform( std::vector< zydis_decoded_instr_t > &instrs ) -> bool + inline auto inverse_transforms( std::vector< zydis_decoded_instr_t > &instrs ) -> bool { - for ( auto idx = 0u; idx < instrs.size() - 1; ++idx ) + for ( auto idx = 0u; idx < instrs.size(); idx++ ) if ( !( instrs[ idx ].mnemonic = inverse[ instrs[ idx ].mnemonic ] ) ) return false; + std::reverse( instrs.begin(), instrs.end() ); return true; }