Skip to content

Commit dc8278d

Browse files
committed
GUI: resolved issue x64dbg#433 (freeze when dropping a program in x64dbg)
1 parent 5e9a330 commit dc8278d

File tree

3 files changed

+5
-15
lines changed

3 files changed

+5
-15
lines changed

src/gui/Src/BasicView/Disassembly.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Disassembly::Disassembly(QWidget* parent) : AbstractTableView(parent)
4747
// Slots
4848
connect(Bridge::getBridge(), SIGNAL(repaintGui()), this, SLOT(reloadData()));
4949
connect(Bridge::getBridge(), SIGNAL(updateDump()), this, SLOT(reloadData()));
50-
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(debugStateChanged(DBGSTATE)));
50+
connect(Bridge::getBridge(), SIGNAL(dbgStateChanged(DBGSTATE)), this, SLOT(debugStateChangedSlot(DBGSTATE)));
5151

5252
Initialize();
5353
}

src/gui/Src/Gui/MainWindow.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -562,7 +562,7 @@ void MainWindow::openFile()
562562
{
563563
filename = fileToOpen->text();
564564
}
565-
DbgCmdExec(QString("init \"" + filename + "\"").toUtf8().constData());
565+
DbgCmdExec(QString().sprintf("init \"%s\"", filename.toUtf8().constData()).toUtf8().constData());
566566

567567
//file is from recent menu
568568
if(fileToOpen != NULL && fileToOpen->objectName().startsWith("MRU"))
@@ -612,16 +612,9 @@ void MainWindow::startScylla() //this is executed
612612

613613
void MainWindow::restartDebugging()
614614
{
615-
char filename[MAX_SETTING_SIZE] = "";
616615
if(!mMRUList.size())
617616
return;
618-
strcpy_s(filename, mMRUList.at(0).toUtf8().constData());
619-
if(DbgIsDebugging())
620-
{
621-
DbgCmdExec("stop"); //close current file (when present)
622-
Sleep(400);
623-
}
624-
DbgCmdExec(QString().sprintf("init \"%s\"", filename).toUtf8().constData());
617+
DbgCmdExec(QString().sprintf("init \"%s\"", mMRUList.at(0).toUtf8().constData()).toUtf8().constData());
625618

626619
mCpuWidget->setDisasmFocus();
627620
}
@@ -644,10 +637,7 @@ void MainWindow::dropEvent(QDropEvent* pEvent)
644637
if(pEvent->mimeData()->hasUrls())
645638
{
646639
QString filename = QDir::toNativeSeparators(pEvent->mimeData()->urls()[0].toLocalFile());
647-
if(DbgIsDebugging())
648-
DbgCmdExecDirect("stop");
649-
QString cmd;
650-
DbgCmdExec(cmd.sprintf("init \"%s\"", filename.toUtf8().constData()).toUtf8().constData());
640+
DbgCmdExec(QString().sprintf("init \"%s\"", filename.toUtf8().constData()).toUtf8().constData());
651641
pEvent->acceptProposedAction();
652642
}
653643
}

src/gui/Src/Gui/MainWindow.ui

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@
9494
<addaction name="actionDonate"/>
9595
<addaction name="actionReportBug"/>
9696
<addaction name="separator"/>
97-
<addaction name="actionAbout"/>
9897
<addaction name="actionManual"/>
98+
<addaction name="actionAbout"/>
9999
</widget>
100100
<widget class="QMenu" name="menuPlugins">
101101
<property name="title">

0 commit comments

Comments
 (0)