GUI: added 'Search For -> Intermodular calls' (resolved issue #89)
This commit is contained in:
parent
43eb27258e
commit
6f38a0c5e5
|
@ -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)+">";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)+">";
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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)+">";
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -140,6 +140,7 @@
|
|||
<addaction name="actionScylla"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionStrings"/>
|
||||
<addaction name="actionCalls"/>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusBar"/>
|
||||
<widget class="QToolBar" name="cmdBar">
|
||||
|
@ -507,6 +508,18 @@
|
|||
<string>&Appearance</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionCalls">
|
||||
<property name="icon">
|
||||
<iconset resource="../../resource.qrc">
|
||||
<normaloff>:/icons/images/call.png</normaloff>:/icons/images/call.png</iconset>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Find Intermodular Calls</string>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Find Intermodular Calls</string>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<layoutdefault spacing="6" margin="11"/>
|
||||
<resources>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 668 B |
|
@ -31,5 +31,6 @@
|
|||
<file>images/settings.png</file>
|
||||
<file>images/strings.png</file>
|
||||
<file>images/color-swatches.png</file>
|
||||
<file>images/call.png</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
|
Loading…
Reference in New Issue