fixed an issue with virtual instruction rva being over 32bits...

merge-requests/11/merge
_xeroxz 3 years ago
parent 1fad857077
commit 5c2d4397f5

@ -241,7 +241,6 @@ namespace vm
possible_block_2 > vmctx.module_base && possible_block_2 > vmctx.module_base &&
possible_block_2 < vmctx.module_base + vmctx.image_size; possible_block_2 < vmctx.module_base + vmctx.image_size;
} }
return false; return false;
} ); } );
@ -267,13 +266,12 @@ namespace vm
std::uintptr_t code_block_addr( const vm::ctx_t &ctx, const vmp2::v2::entry_t &entry ) std::uintptr_t code_block_addr( const vm::ctx_t &ctx, const vmp2::v2::entry_t &entry )
{ {
return ( ( entry.vsp.qword[ 0 ] + ( ctx.image_base & ~0xFFFFFFFFull ) ) - ctx.image_base ) + return ( ( entry.vsp.qword[ 0 ] & 0xFFFFFFFFull ) - ( ctx.image_base & 0xFFFFFFFFull ) ) + ctx.module_base;
ctx.module_base;
} }
std::uintptr_t code_block_addr( const vm::ctx_t &ctx, const std::uint32_t lower_32bits ) std::uintptr_t code_block_addr( const vm::ctx_t &ctx, const std::uint32_t lower_32bits )
{ {
return ( ( lower_32bits + ( ctx.image_base & ~0xFFFFFFFFull ) ) - ctx.image_base ) + ctx.module_base; return ( lower_32bits - ( ctx.image_base & 0xFFFFFFFFull ) ) + ctx.module_base;
} }
} // namespace instrs } // namespace instrs
} // namespace vm } // namespace vm
Loading…
Cancel
Save