From 0509af1204ff2566b91d6109619471929eacd5e7 Mon Sep 17 00:00:00 2001 From: _xeroxz Date: Thu, 3 Jun 2021 22:30:28 -0700 Subject: [PATCH] address is now block_(rva)... --- src/qvminspector.cpp | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/qvminspector.cpp b/src/qvminspector.cpp index c29f6d0..49078fd 100644 --- a/src/qvminspector.cpp +++ b/src/qvminspector.cpp @@ -3,9 +3,9 @@ qvminspector_t::qvminspector_t( qwidget_t *parent ) : qmain_window_t( parent ), file_header( nullptr ), vmctx( nullptr ) { ui.setupUi( this ); - ui.virt_instrs->setColumnWidth( 0, 175 ); - ui.virt_instrs->setColumnWidth( 1, 140 ); - ui.virt_instrs->setColumnWidth( 2, 200 ); + ui.virt_instrs->setColumnWidth( 0, 180 ); + ui.virt_instrs->setColumnWidth( 1, 150 ); + ui.virt_instrs->setColumnWidth( 2, 190 ); ui.virt_instrs->setColumnWidth( 3, 200 ); connect( ui.action_open, &QAction::triggered, this, &qvminspector_t::on_open ); @@ -141,7 +141,7 @@ void qvminspector_t::add_branch_children( qtree_widget_item_t *item, std::uintpt { // skip if this code block begin address is not branch_addr... if ( code_block->vip_begin != branch_addr && code_block->vip_begin != branch_addr - 2 && - code_block->vip_begin != branch_addr - 1) + code_block->vip_begin != branch_addr - 1 ) continue; dbg_print( qstring_t( "> code block %1 (block_%2), number of vinstrs = %3..." ) @@ -157,9 +157,14 @@ void qvminspector_t::add_branch_children( qtree_widget_item_t *item, std::uintpt auto virt_instr_entry = new qtree_widget_item_t; // virtual instruction image base'ed rva... (column 1)... - virt_instr_entry->setText( 0, qstring_t::number( ( virt_instr->trace_data.vip - file_header->module_base ) + - file_header->image_base, - 16 ) ); + virt_instr_entry->setText( + 0, QString( "block_%1+%2" ) + .arg( ( branch_addr - file_header->module_base ) + file_header->image_base, 0, 16 ) + .arg( idx ? code_block->vip_begin > virt_instr->trace_data.vip + ? code_block->vip_begin - virt_instr->trace_data.vip + : virt_instr->trace_data.vip - code_block->vip_begin + : 0u, + 0, 16 ) ); // virtual instruction operand bytes... (column 2)... qstring_t operand_bytes; @@ -263,9 +268,14 @@ void qvminspector_t::update_ui() auto virt_instr_entry = new qtree_widget_item_t; // virtual instruction image base'ed rva... (column 1)... - virt_instr_entry->setText( 0, qstring_t::number( ( virt_instr->trace_data.vip - file_header->module_base ) + - file_header->image_base, - 16 ) ); + virt_instr_entry->setText( + 0, QString( "block_%1+%2" ) + .arg( ( code_block->vip_begin - file_header->module_base ) + file_header->image_base, 0, 16 ) + .arg( idx ? code_block->vip_begin > virt_instr->trace_data.vip + ? code_block->vip_begin - virt_instr->trace_data.vip + : virt_instr->trace_data.vip - code_block->vip_begin + : 0u, + 0, 16 ) ); // virtual instruction operand bytes... (column 2)... qstring_t operand_bytes;