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; }