diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index 7fc777d..d2321f4 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -161,6 +161,7 @@ QVector MainWindow::GetAllHooks(DWORD processId) { QSet addresses; QVector hooks; + if (!processId) return hooks; for (int i = 0; i < ttCombo->count(); ++i) { ThreadParam tp = ParseTextThreadString(ttCombo->itemText(i)); @@ -187,6 +188,7 @@ void MainWindow::on_attachButton_clicked() void MainWindow::on_detachButton_clicked() { + if (processCombo->count() == 0) return; Host::DetachProcess(GetSelectedProcessId()); } @@ -195,6 +197,7 @@ void MainWindow::on_hookButton_clicked() bool ok; QString hookCode = QInputDialog::getText(this, ADD_HOOK, CODE_INFODUMP, QLineEdit::Normal, "", &ok, Qt::WindowCloseButtonHint); if (!ok) return; + if (processCombo->count() == 0) return; if (auto hp = ParseCode(hookCode)) Host::InsertHook(GetSelectedProcessId(), hp.value()); else Host::AddConsoleOutput(INVALID_CODE); }