diff --git a/GUI/mainwindow.cpp b/GUI/mainwindow.cpp index e955a3c..3c664d9 100644 --- a/GUI/mainwindow.cpp +++ b/GUI/mainwindow.cpp @@ -175,10 +175,10 @@ void MainWindow::on_attachButton_clicked() { bool ok; QString process = QInputDialog::getItem(this, "Select Process", - "If you don't see the process you want to inject, try running with admin rights", + "If you don't see the process you want to inject, try running with admin rights\r\nYou can also just type in the process id if you know it", GetAllProcesses(), 0, true, &ok); if (!ok) return; - if (!Host::InjectProcess(process.split(":")[1].toInt())) Host::AddConsoleOutput(L"Failed to attach"); + if (!Host::InjectProcess(process.split(":")[0].toInt())) Host::AddConsoleOutput(L"Failed to attach"); } void MainWindow::on_detachButton_clicked() diff --git a/GUI/misc.cpp b/GUI/misc.cpp index 3144de6..6a95143 100644 --- a/GUI/misc.cpp +++ b/GUI/misc.cpp @@ -27,8 +27,10 @@ QStringList GetAllProcesses() if (!EnumProcesses(allProcessIds, sizeof(allProcessIds), &spaceUsed)) return ret; for (int i = 0; i < spaceUsed / sizeof(DWORD); ++i) if (GetModuleName(allProcessIds[i]).size()) - ret.push_back(GetModuleName(allProcessIds[i]) + ": " + QString::number(allProcessIds[i])); - ret.sort(); + ret.push_back(GetModuleName(allProcessIds[i]) + ":" + QString::number(allProcessIds[i])); + ret.sort(Qt::CaseInsensitive); + for (int i = 0; i < ret.size(); ++i) + ret[i] = ret[i].split(":")[1] + ": " + ret[i].split(":")[0]; return ret; }