|
|
@ -214,7 +214,25 @@ namespace vm
|
|
|
|
|
|
|
|
|
|
|
|
for ( auto &[ code_block, cpu_ctx, vm_ctx ] : code_blocks )
|
|
|
|
for ( auto &[ code_block, cpu_ctx, vm_ctx ] : code_blocks )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// code_block.vip_begin = ( code_block.vip_begin - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
|
|
|
|
// convert linear virtual addresses to image based addresses...
|
|
|
|
|
|
|
|
code_block.vip_begin = ( code_block.vip_begin - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
|
|
|
|
|
|
|
|
if ( code_block.jcc.has_jcc )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch ( code_block.jcc.type )
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case vm::instrs::jcc_type::branching:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
code_block.jcc.block_addr[ 0 ] =
|
|
|
|
|
|
|
|
( code_block.jcc.block_addr[ 0 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
case vm::instrs::jcc_type::absolute:
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
code_block.jcc.block_addr[ 1 ] =
|
|
|
|
|
|
|
|
( code_block.jcc.block_addr[ 1 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
entries.push_back( code_block );
|
|
|
|
entries.push_back( code_block );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|