improve UX

This commit is contained in:
Akash Mozumdar 2018-08-17 14:45:14 -04:00
parent b290392034
commit 34acf4f300
2 changed files with 6 additions and 4 deletions

View File

@ -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()

View File

@ -28,7 +28,9 @@ QStringList GetAllProcesses()
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.sort(Qt::CaseInsensitive);
for (int i = 0; i < ret.size(); ++i)
ret[i] = ret[i].split(":")[1] + ": " + ret[i].split(":")[0];
return ret;
}