forked from LloydLabs/dearg-thread-ipc-stealth
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomm.h
59 lines (50 loc) · 992 Bytes
/
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
#pragma once
#include <Windows.h>
#include <Winternl.h>
#include <winnt.h>
#pragma comment(lib, "OneCoreUAP.lib")
#define DEARG_HEADER_MAGIC 0x1337BEEF
#define DEARG_BUFFER_END "\x00\x00"
#define DEARG_NO_KEY 0xFF
typedef enum DEARG_FLAGS {
DEARG_WRITE = 1,
DEARG_READ = 2,
DEARG_READWRITE = 3
} DEARG_FLAGS;
#pragma pack(push, 1)
typedef struct DEARG_HEADER {
DWORD32 dwMagic;
DEARG_FLAGS dfFlags;
DWORD32 dwChecksum;
UINT16 u16Len;
BYTE bKey;
} DEARG_HEADER, *PDEARG_HEADER;
#pragma pack(pop)
typedef enum DEARG_STATUS {
DSERVE_OK,
DSERVE_ERROR_KEY,
DSERVE_ERROR_SET,
DSERVE_ERROR_GET,
DSERVE_ERROR_ALLOC,
DSERVE_ERROR_HEADER,
DSERVE_INVALID_PARAMS,
DSERVE_NO_DATA_OUT
} DEARG_STATUS, *PDEARG_STATUS;
BOOL
dearg_init_hdr(
PDEARG_HEADER pHdr
);
DEARG_STATUS
dearg_serve(
HANDLE hThread,
DEARG_FLAGS dFlags,
PDEARG_HEADER pHdr,
PBYTE pbBuffer,
UINT16 u16Len
);
DEARG_STATUS
dearg_read(
_In_ HANDLE hThread,
_Out_ PDEARG_HEADER pHdr,
_Out_ PBYTE pbDataOut
);