forked from kaisersoju/Eac-Bypass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomm.h
88 lines (75 loc) · 1.85 KB
/
comm.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#pragma once
#include <minwindef.h>
#include <bcrypt.h>
namespace Comm {
const auto DATA_UNIQUE = 0x1234UL;
enum class REQUEST_TYPE {
EXTEND,
WRITE,
READ,
PROTECT,
ALLOC,
FREE,
MODULE,
};
typedef struct _REQUEST_DATA {
DWORD Unique;
REQUEST_TYPE Type;
PVOID Arguments;
} REQUEST_DATA, * PREQUEST_DATA;
typedef struct _REQUEST_EXTEND {
DWORD ProcessId;
WCHAR Module[0xFF];
DWORD Size;
} REQUEST_EXTEND, * PREQUEST_EXTEND;
typedef struct _REQUEST_WRITE {
DWORD ProcessId;
PVOID Dest;
PVOID Src;
DWORD Size;
} REQUEST_WRITE, * PREQUEST_WRITE;
typedef struct _REQUEST_READ {
DWORD ProcessId;
PVOID Dest;
PVOID Src;
DWORD Size;
} REQUEST_READ, * PREQUEST_READ;
typedef struct _REQUEST_PROTECT {
DWORD ProcessId;
PVOID Address;
DWORD Size;
PDWORD InOutProtect;
} REQUEST_PROTECT, * PREQUEST_PROTECT;
typedef struct _REQUEST_ALLOC {
DWORD ProcessId;
PVOID OutAddress;
DWORD Size;
DWORD Protect;
} REQUEST_ALLOC, * PREQUEST_ALLOC;
typedef struct _REQUEST_FREE {
DWORD ProcessId;
PVOID Address;
} REQUEST_FREE, * PREQUEST_FREE;
typedef struct _REQUEST_MODULE {
DWORD ProcessId;
WCHAR Module[0xFF];
PBYTE* OutAddress;
PDWORD OutSize;
} REQUEST_MODULE, * PREQUEST_MODULE;
BOOL Setup();
class Process {
private:
DWORD ProcessId = 0;
public:
Process(DWORD processId) : ProcessId{ processId } {}
Process(LPCWSTR processName);
BOOLEAN Valid();
NTSTATUS Extend(LPCWSTR module, DWORD size);
NTSTATUS Write(PVOID dest, PVOID src, DWORD size);
NTSTATUS Read(PVOID dest, PVOID src, DWORD size);
NTSTATUS Protect(PVOID address, DWORD size, PDWORD inOutProtect);
PVOID Alloc(DWORD size, DWORD protect);
NTSTATUS Free(PVOID address);
NTSTATUS Module(LPCWSTR moduleName, PBYTE* base, PDWORD size);
};
}