2023-08-17 10:45:50 +02:00
|
|
|
#include "umanager.h"
|
|
|
|
|
|
|
|
#include "../common.h"
|
|
|
|
#include "process.h"
|
|
|
|
#include "../um/imports.h"
|
|
|
|
|
|
|
|
#include <TlHelp32.h>
|
|
|
|
|
2023-12-25 16:54:35 +01:00
|
|
|
usermode::UManager::UManager(std::shared_ptr<global::ThreadPool> ThreadPool,
|
|
|
|
std::shared_ptr<global::Client> ReportInterface)
|
2023-08-17 10:45:50 +02:00
|
|
|
{
|
2023-12-25 16:54:35 +01:00
|
|
|
this->thread_pool = ThreadPool;
|
|
|
|
this->process = std::make_unique<Process>(ReportInterface);
|
2023-08-17 10:45:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
usermode::UManager::~UManager()
|
|
|
|
{
|
2023-12-25 16:54:35 +01:00
|
|
|
/* Wait for our jobs to be finished, then safely stop our pool */
|
|
|
|
// while ( true )
|
|
|
|
//{
|
|
|
|
// if ( this->thread_pool->Busy() == FALSE )
|
|
|
|
// {
|
|
|
|
// this->thread_pool->Stop();
|
|
|
|
// break;
|
|
|
|
// }
|
|
|
|
// }
|
2023-08-17 10:45:50 +02:00
|
|
|
}
|
|
|
|
|
2023-12-25 16:54:35 +01:00
|
|
|
void
|
|
|
|
usermode::UManager::ValidateProcessThreads()
|
2023-08-17 10:45:50 +02:00
|
|
|
{
|
2023-12-25 16:54:35 +01:00
|
|
|
this->thread_pool->QueueJob([this]() { this->process->ValidateProcessThreads(); });
|
2023-08-17 10:45:50 +02:00
|
|
|
}
|
|
|
|
|
2023-12-25 16:54:35 +01:00
|
|
|
void
|
|
|
|
usermode::UManager::ValidateProcessMemory()
|
2023-08-17 10:45:50 +02:00
|
|
|
{
|
2023-12-25 16:54:35 +01:00
|
|
|
this->thread_pool->QueueJob([this]() { this->process->ScanProcessMemory(); });
|
2023-08-17 10:45:50 +02:00
|
|
|
}
|