-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcKernal.h
40 lines (28 loc) · 898 Bytes
/
cKernal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#pragma once
#include <iostream>
#include <string>
#include <Windows.h>
#include "cLogger.h"
typedef struct _PROCESS_BASIC_INFORMATION {
PVOID Reserved1;
PVOID PebBaseAddress;
PVOID Reserved2[2];
ULONG_PTR UniqueProcessId;
PVOID Reserved3;
} PROCESS_BASIC_INFORMATION;
typedef DWORD(WINAPI* pNtQueryInformationProcess)(HANDLE, DWORD, PVOID, DWORD, PVOID);
class cKernal
{
static std::shared_ptr<cKernal> _instance;
public:
static std::shared_ptr<cKernal> Get();
cKernal();
~cKernal();
void* GetPEBFromHandle(const HANDLE& handle);
private:
DWORD NtQueryInformationProcess(HANDLE ProcessHandle, DWORD ProcessInformationClass, PVOID ProcessInformation, ULONG ProcessInformationLength, PULONG ReturnLength);
HMODULE _ntDLL = nullptr;
pNtQueryInformationProcess _fnNtQueryInformationProces = nullptr;
cLogger_t _logger = nullptr;
};
typedef std::shared_ptr<cKernal> cKernal_t;