abstract extension loading code
This commit is contained in:
parent
16cf2eb9b2
commit
b290392034
@ -62,8 +62,7 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
connect(hostSignaller, &HostSignaller::AddThread, this, &MainWindow::AddThread);
|
connect(hostSignaller, &HostSignaller::AddThread, this, &MainWindow::AddThread);
|
||||||
connect(hostSignaller, &HostSignaller::RemoveThread, this, &MainWindow::RemoveThread);
|
connect(hostSignaller, &HostSignaller::RemoveThread, this, &MainWindow::RemoveThread);
|
||||||
connect(this, &MainWindow::ThreadOutputReceived, this, &MainWindow::ThreadOutput);
|
connect(this, &MainWindow::ThreadOutputReceived, this, &MainWindow::ThreadOutput);
|
||||||
std::map<int, QString> extensions = LoadExtensions();
|
ReloadExtensions();
|
||||||
for (auto i : extensions) extenCombo->addItem(QString::number(i.first) + ": " + i.second);
|
|
||||||
Host::Open();
|
Host::Open();
|
||||||
Host::AddConsoleOutput(L"NextHooker beta v2.1.2 by Artikash\r\nSource code and more information available under GPLv3 at https://github.com/Artikash/NextHooker");
|
Host::AddConsoleOutput(L"NextHooker beta v2.1.2 by Artikash\r\nSource code and more information available under GPLv3 at https://github.com/Artikash/NextHooker");
|
||||||
}
|
}
|
||||||
@ -139,6 +138,13 @@ void MainWindow::ThreadOutput(TextThread* thread, QString output)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::ReloadExtensions()
|
||||||
|
{
|
||||||
|
extenCombo->clear();
|
||||||
|
std::map<int, QString> extensions = LoadExtensions();
|
||||||
|
for (auto i : extensions) extenCombo->addItem(QString::number(i.first) + ": " + i.second);
|
||||||
|
}
|
||||||
|
|
||||||
std::unordered_map<std::string, int> MainWindow::GetInfoForExtensions(TextThread* thread)
|
std::unordered_map<std::string, int> MainWindow::GetInfoForExtensions(TextThread* thread)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
@ -236,9 +242,7 @@ void MainWindow::on_addExtenButton_clicked()
|
|||||||
extenName +
|
extenName +
|
||||||
"_nexthooker_extension.dll";
|
"_nexthooker_extension.dll";
|
||||||
QFile::copy(extenFileName, copyTo);
|
QFile::copy(extenFileName, copyTo);
|
||||||
extenCombo->clear();
|
ReloadExtensions();
|
||||||
std::map<int, QString> extensions = LoadExtensions();
|
|
||||||
for (auto i : extensions) extenCombo->addItem(QString::number(i.first) + ": " + i.second);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_rmvExtenButton_clicked()
|
void MainWindow::on_rmvExtenButton_clicked()
|
||||||
@ -247,7 +251,5 @@ void MainWindow::on_rmvExtenButton_clicked()
|
|||||||
QString extenFileName = extenCombo->currentText().split(":")[0] + "_" + extenCombo->currentText().split(": ")[1] + "_nexthooker_extension.dll";
|
QString extenFileName = extenCombo->currentText().split(":")[0] + "_" + extenCombo->currentText().split(": ")[1] + "_nexthooker_extension.dll";
|
||||||
FreeLibrary(GetModuleHandleW(extenFileName.toStdWString().c_str()));
|
FreeLibrary(GetModuleHandleW(extenFileName.toStdWString().c_str()));
|
||||||
DeleteFileW(extenFileName.toStdWString().c_str());
|
DeleteFileW(extenFileName.toStdWString().c_str());
|
||||||
extenCombo->clear();
|
ReloadExtensions();
|
||||||
std::map<int, QString> extensions = LoadExtensions();
|
|
||||||
for (auto i : extensions) extenCombo->addItem(QString::number(i.first) + ": " + i.second);
|
|
||||||
}
|
}
|
||||||
|
@ -41,6 +41,7 @@ private slots:
|
|||||||
void on_rmvExtenButton_clicked();
|
void on_rmvExtenButton_clicked();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void ReloadExtensions();
|
||||||
std::unordered_map<std::string, int> GetInfoForExtensions(TextThread* thread);
|
std::unordered_map<std::string, int> GetInfoForExtensions(TextThread* thread);
|
||||||
QVector<HookParam> GetAllHooks(DWORD processId);
|
QVector<HookParam> GetAllHooks(DWORD processId);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user