fixed an issue with flattening code with legit branchs...

merge-requests/11/merge
_xeroxz 4 years ago
parent a419fa4633
commit 2295658e5d

@ -83,6 +83,13 @@ namespace vm
while ( ZYAN_SUCCESS(
ZydisDecoderDecodeBuffer( &decoder, reinterpret_cast< void * >( routine_addr ), 0x1000, &instr ) ) )
{
// detect if we have already been at this instruction... if so that means there is a loop and we are going
// to just return...
if (std::find_if( routine.begin(), routine.end(), [ & ]( const zydis_instr_t &zydis_instr ) -> bool {
return zydis_instr.addr == routine_addr;
} ) != routine.end() )
return true;
std::vector< u8 > raw_instr;
raw_instr.insert( raw_instr.begin(), ( u8 * )routine_addr, ( u8 * )routine_addr + instr.length );

Loading…
Cancel
Save