.vmp2 file format version 4 serialization working...

merge-requests/5/head
_xeroxz 3 years ago
parent 870c5eff3a
commit eb74df5c0f

@ -219,7 +219,7 @@ int __cdecl main( int argc, const char *argv[] )
} }
} }
if ( parser.exists( "showbvirtinstrs" ) && parser.exists( "rtnaddr" ) ) if ( parser.exists( "showvirtinstrs" ) && parser.exists( "rtnaddr" ) )
{ {
auto rtn_addr = std::stoull( parser.get< std::string >( "rtnaddr" ).c_str(), nullptr, 16 ); auto rtn_addr = std::stoull( parser.get< std::string >( "rtnaddr" ).c_str(), nullptr, 16 );
for ( auto [ rtn_block, rtn_idx ] = std::pair{ first_rtn, 0ull }; rtn_idx < file_header->rtn_count; for ( auto [ rtn_block, rtn_idx ] = std::pair{ first_rtn, 0ull }; rtn_idx < file_header->rtn_count;
@ -240,9 +240,14 @@ int __cdecl main( int argc, const char *argv[] )
std::printf( "> -----------------------------------------------------------------------\n" ); std::printf( "> -----------------------------------------------------------------------\n" );
std::printf( "> opcode | virtual instructions | virtual instruction pointer\n" ); std::printf( "> opcode | virtual instructions | virtual instruction pointer\n" );
std::printf( "> -----------------------------------------------------------------------\n" ); std::printf( "> -----------------------------------------------------------------------\n" );
auto block_vinstrs = reinterpret_cast< vm::instrs::virt_instr_t * >(
reinterpret_cast< std::uintptr_t >( code_block ) + sizeof vmp2::v4::code_block_t +
( code_block->num_block_addrs * 8 ) );
for ( auto idx = 0u; idx < code_block->vinstr_count; ++idx ) for ( auto idx = 0u; idx < code_block->vinstr_count; ++idx )
{ {
const auto vinstr = &code_block->vinstr[ idx ]; const auto vinstr = &block_vinstrs[ idx ];
const auto vm_profile = vm::handler::get_profile( vinstr->mnemonic_t ); const auto vm_profile = vm::handler::get_profile( vinstr->mnemonic_t );
if ( vinstr->operand.has_imm ) if ( vinstr->operand.has_imm )
{ {

Loading…
Cancel
Save