fixed bugs...

merge-requests/8/merge
_xeroxz 3 years ago
parent 9102e68a65
commit 931762a070

@ -1 +1 @@
Subproject commit 0cbc83be3fb0f4293146def0c3735f39608f646b Subproject commit c2319117a07d95794f54db970aa7f72e8726349a

@ -91,8 +91,13 @@ int __cdecl main( int argc, const char *argv[] )
std::printf( "> does this code block have a jcc? %s\n", code_block.jcc.has_jcc ? "yes" : "no" ); std::printf( "> does this code block have a jcc? %s\n", code_block.jcc.has_jcc ? "yes" : "no" );
if ( code_block.jcc.has_jcc ) if ( code_block.jcc.has_jcc )
std::printf( "> branch 1 = %p, branch 2 = %p\n", code_block.jcc.block_addr[ 0 ], {
code_block.jcc.block_addr[ 1 ] ); if ( code_block.jcc.type == vm::instrs::jcc_type::branching )
std::printf( "> branch 1 = %p, branch 2 = %p\n", code_block.jcc.block_addr[ 0 ],
code_block.jcc.block_addr[ 1 ] );
else
std::printf( "> branch 1 = %p\n", code_block.jcc.block_addr[ 0 ] );
}
} }
std::printf( "> serializing results....\n" ); std::printf( "> serializing results....\n" );

@ -222,13 +222,13 @@ namespace vm
{ {
case vm::instrs::jcc_type::branching: case vm::instrs::jcc_type::branching:
{ {
code_block.jcc.block_addr[ 0 ] = code_block.jcc.block_addr[ 1 ] =
( code_block.jcc.block_addr[ 0 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base; ( code_block.jcc.block_addr[ 1 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
} }
case vm::instrs::jcc_type::absolute: case vm::instrs::jcc_type::absolute:
{ {
code_block.jcc.block_addr[ 1 ] = code_block.jcc.block_addr[ 0 ] =
( code_block.jcc.block_addr[ 1 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base; ( code_block.jcc.block_addr[ 0 ] - g_vm_ctx->module_base ) + g_vm_ctx->image_base;
break; break;
} }
} }

Loading…
Cancel
Save