mirror-ac/user/um/process.h

46 lines
1.4 KiB
C
Raw Normal View History

2023-08-15 14:02:17 +02:00
#ifndef PROCESS_H
#define PROCESS_H
2023-08-16 11:28:46 +02:00
#include <windows.h>
#include <winternl.h>
2023-08-15 14:02:17 +02:00
#include <TlHelp32.h>
#include <string>
2023-08-22 19:32:25 +02:00
#include "../client.h"
2023-08-17 10:45:50 +02:00
#include "../threadpool.h"
2023-08-16 11:28:46 +02:00
#include "../um/imports.h"
2023-09-05 11:16:32 +02:00
#include "../km/kmanager.h"
2023-08-16 11:28:46 +02:00
2023-08-16 12:47:09 +02:00
#define ThreadQuerySetWin32StartAddress 9
namespace usermode {
/*
* This class represents a process and the usermode functions responsible for
* the protection of it. This class represents the protected process and allows
* us to split protection class into methods which can then be easily managed
* by the usermode manager class.
*/
class Process
2023-08-15 14:02:17 +02:00
{
HANDLE process_handle;
DWORD process_id;
std::mutex mutex;
std::unique_ptr<Imports> function_imports;
std::vector<DWORD> in_memory_module_checksums;
std::shared_ptr<global::Client> client_interface;
HANDLE GetHandleToProcessGivenName(std::string ProcessName);
bool CheckIfAddressLiesWithinValidProcessModule(UINT64 Address, bool* Result);
bool GetProcessBaseAddress(UINT64* Result);
void CheckPageProtection(MEMORY_BASIC_INFORMATION* Page);
void PatternScanRegion(UINT64 Address, MEMORY_BASIC_INFORMATION* Page);
public:
Process(std::shared_ptr<global::Client> ClientInterface);
void ValidateProcessThreads();
void ScanProcessMemory();
};
2023-08-15 14:02:17 +02:00
}
#endif