diff --git a/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp b/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp index a1b1e0d0..16068081 100644 --- a/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp +++ b/x64_dbg_gui/Project/Src/BasicView/Disassembly.cpp @@ -121,7 +121,7 @@ QString Disassembly::paintContent(QPainter* painter, int_t rowBase, int rowOffse if(DbgGetLabelAt(cur_addr, SEG_DEFAULT, label)) //has label { char module[MAX_MODULE_SIZE]=""; - if(DbgGetModuleAt(cur_addr, module)) + if(DbgGetModuleAt(cur_addr, module) && !QString(label).startsWith("JMP.&")) addrText+=" <"+QString(module)+"."+QString(label)+">"; else addrText+=" <"+QString(label)+">"; diff --git a/x64_dbg_gui/Project/Src/Disassembler/BeaTokenizer.cpp b/x64_dbg_gui/Project/Src/Disassembler/BeaTokenizer.cpp index faf05d86..9ea7c2b9 100644 --- a/x64_dbg_gui/Project/Src/Disassembler/BeaTokenizer.cpp +++ b/x64_dbg_gui/Project/Src/Disassembler/BeaTokenizer.cpp @@ -156,7 +156,7 @@ QString BeaTokenizer::PrintValue(const BeaTokenValue* value, bool module) char moduleText[MAX_MODULE_SIZE]=""; int_t addr=value->value; bool bHasLabel=DbgGetLabelAt(addr, SEG_DEFAULT, labelText); - bool bHasModule=(module && DbgGetModuleAt(addr, moduleText)); + bool bHasModule=(module && DbgGetModuleAt(addr, moduleText) && !QString(labelText).startsWith("JMP.&")); QString addrText; addrText=QString("%1").arg(addr&(uint_t)-1, 0, 16, QChar('0')).toUpper(); QString finalText; diff --git a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp index 3d18c97a..bdd66c81 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp @@ -210,6 +210,7 @@ void CPUDisassembly::contextMenuEvent(QContextMenuEvent* event) mSearchMenu->addAction(mSearchConstant); mSearchMenu->addAction(mSearchStrings); + mSearchMenu->addAction(mSearchCalls); wMenu->addMenu(mSearchMenu); mReferencesMenu->addAction(mReferenceSelectedAddress); @@ -363,6 +364,10 @@ void CPUDisassembly::setupRightClickContextMenu() mSearchStrings = new QAction("&String references", this); connect(mSearchStrings, SIGNAL(triggered()), this, SLOT(findStrings())); + // Intermodular Calls + mSearchCalls = new QAction("&Intermodular calls", this); + connect(mSearchCalls, SIGNAL(triggered()), this, SLOT(findCalls())); + // Highlighting mode mEnableHighlightingMode = new QAction("&Highlighting mode", this); mEnableHighlightingMode->setShortcutContext(Qt::WidgetShortcut); @@ -715,6 +720,13 @@ void CPUDisassembly::findStrings() emit displayReferencesWidget(); } +void CPUDisassembly::findCalls() +{ + QString addrText=QString("%1").arg(rvaToVa(getInitialSelection()), sizeof(int_t)*2, 16, QChar('0')).toUpper(); + DbgCmdExec(QString("modcallfind " + addrText).toUtf8().constData()); + emit displayReferencesWidget(); +} + void CPUDisassembly::selectionGet(SELECTIONDATA* selection) { selection->start=rvaToVa(getSelectionStart()); diff --git a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.h b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.h index 0eb045ca..24e5c6bf 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.h +++ b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.h @@ -54,6 +54,7 @@ public slots: void findReferences(); void findConstant(); void findStrings(); + void findCalls(); void selectionGet(SELECTIONDATA* selection); void selectionSet(const SELECTIONDATA* selection); void enableHighlightingMode(); @@ -88,6 +89,7 @@ private: QAction* mReferenceSelectedAddress; QAction* mSearchConstant; QAction* mSearchStrings; + QAction* mSearchCalls; QAction* mEnableHighlightingMode; GotoDialog* mGoto; diff --git a/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp b/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp index 4a6c3012..df166146 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUDump.cpp @@ -153,7 +153,7 @@ QString CPUDump::paintContent(QPainter* painter, int_t rowBase, int rowOffset, i if(DbgGetLabelAt(curAddr, SEG_DEFAULT, label)) //has label { char module[MAX_MODULE_SIZE]=""; - if(DbgGetModuleAt(curAddr, module)) + if(DbgGetModuleAt(curAddr, module) && !QString(label).startsWith("JMP.&")) addrText+=" <"+QString(module)+"."+QString(label)+">"; else addrText+=" <"+QString(label)+">"; diff --git a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp index 32d73722..9692ac8a 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp @@ -36,7 +36,7 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA) { QString fullLabel="<"+QString(label)+">"; char mod[MAX_MODULE_SIZE]=""; - if(DbgGetModuleAt(parVA, mod)) + if(DbgGetModuleAt(parVA, mod) && !QString(label).startsWith("JMP.&")) fullLabel="<"+QString(mod)+"."+QString(label)+">"; info=QString("%1").arg(parVA, sizeof(int_t) * 2, 16, QChar('0')).toUpper() + " " + fullLabel; } diff --git a/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp b/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp index 9efc4861..846e5bd8 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUStack.cpp @@ -106,7 +106,7 @@ QString CPUStack::paintContent(QPainter* painter, int_t rowBase, int rowOffset, if(DbgGetLabelAt(curAddr, SEG_DEFAULT, label)) //has label { char module[MAX_MODULE_SIZE]=""; - if(DbgGetModuleAt(curAddr, module)) + if(DbgGetModuleAt(curAddr, module) && !QString(label).startsWith("JMP.&")) addrText+=" <"+QString(module)+"."+QString(label)+">"; else addrText+=" <"+QString(label)+">"; diff --git a/x64_dbg_gui/Project/Src/Gui/GotoDialog.cpp b/x64_dbg_gui/Project/Src/Gui/GotoDialog.cpp index e8d5a9b4..f2eeb6cb 100644 --- a/x64_dbg_gui/Project/Src/Gui/GotoDialog.cpp +++ b/x64_dbg_gui/Project/Src/Gui/GotoDialog.cpp @@ -62,12 +62,12 @@ void GotoDialog::on_editExpression_textChanged(const QString &arg1) char label[MAX_LABEL_SIZE]=""; if(DbgGetLabelAt(addr, SEG_DEFAULT, label)) //has label { - if(DbgGetModuleAt(addr, module)) + if(DbgGetModuleAt(addr, module) && !QString(label).startsWith("JMP.&")) addrText=QString(module)+"."+QString(label); else addrText=QString(label); } - else if(DbgGetModuleAt(addr, module)) + else if(DbgGetModuleAt(addr, module) && !QString(label).startsWith("JMP.&")) addrText=QString(module)+"."+QString("%1").arg(addr, sizeof(int_t)*2, 16, QChar('0')).toUpper(); else addrText=QString("%1").arg(addr, sizeof(int_t)*2, 16, QChar('0')).toUpper(); diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp b/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp index 7a117470..ddac8163 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.cpp @@ -133,6 +133,7 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi connect(ui->actionThreads,SIGNAL(triggered()),this,SLOT(displayThreadsWidget())); connect(ui->actionSettings,SIGNAL(triggered()),this,SLOT(openSettings())); connect(ui->actionStrings,SIGNAL(triggered()),this,SLOT(findStrings())); + connect(ui->actionCalls,SIGNAL(triggered()),this,SLOT(findModularCalls())); connect(ui->actionAppearance,SIGNAL(triggered()),this,SLOT(openAppearance())); connect(Bridge::getBridge(), SIGNAL(updateWindowTitle(QString)), this, SLOT(updateWindowTitleSlot(QString))); @@ -575,6 +576,12 @@ void MainWindow::findStrings() displayReferencesWidget(); } +void MainWindow::findModularCalls() +{ + DbgCmdExec(QString("modcallfind " + QString("%1").arg(mCpuWidget->mDisas->rvaToVa(mCpuWidget->mDisas->getInitialSelection()), sizeof(int_t)*2, 16, QChar('0')).toUpper()).toUtf8().constData()); + displayReferencesWidget(); +} + void MainWindow::addMenu(int hMenu, QString title) { int nFound=-1; diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.h b/x64_dbg_gui/Project/Src/Gui/MainWindow.h index 6937a63a..04d0cf97 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.h +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.h @@ -70,6 +70,7 @@ public slots: void addRecentFile(QString file); void setLastException(unsigned int exceptionCode); void findStrings(); + void findModularCalls(); void addMenu(int hMenu, QString title); void addMenuEntry(int hMenu, QString title); void addSeparator(int hMenu); diff --git a/x64_dbg_gui/Project/Src/Gui/MainWindow.ui b/x64_dbg_gui/Project/Src/Gui/MainWindow.ui index 40b51651..29210334 100644 --- a/x64_dbg_gui/Project/Src/Gui/MainWindow.ui +++ b/x64_dbg_gui/Project/Src/Gui/MainWindow.ui @@ -140,6 +140,7 @@ + @@ -507,6 +508,18 @@ &Appearance + + + + :/icons/images/call.png:/icons/images/call.png + + + Find Intermodular Calls + + + Find Intermodular Calls + + diff --git a/x64_dbg_gui/Project/images/call.png b/x64_dbg_gui/Project/images/call.png new file mode 100644 index 00000000..778a03a3 Binary files /dev/null and b/x64_dbg_gui/Project/images/call.png differ diff --git a/x64_dbg_gui/Project/resource.qrc b/x64_dbg_gui/Project/resource.qrc index dbf9c14f..5afd4587 100644 --- a/x64_dbg_gui/Project/resource.qrc +++ b/x64_dbg_gui/Project/resource.qrc @@ -31,5 +31,6 @@ images/settings.png images/strings.png images/color-swatches.png + images/call.png