-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathceserver.h
More file actions
259 lines (200 loc) · 5.3 KB
/
ceserver.h
File metadata and controls
259 lines (200 loc) · 5.3 KB
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
/*
* ceserver.h
*
* Created on: Jul 18, 2011
* Author: erich
*/
#ifndef CESERVER_H_
#define CESERVER_H_
#include <stdint.h>
#include <sys/types.h>
#include "porthelp.h"
#define CMD_GETVERSION 0
#define CMD_CLOSECONNECTION 1
#define CMD_TERMINATESERVER 2
#define CMD_OPENPROCESS 3
#define CMD_CREATETOOLHELP32SNAPSHOT 4
#define CMD_PROCESS32FIRST 5
#define CMD_PROCESS32NEXT 6
#define CMD_CLOSEHANDLE 7
#define CMD_VIRTUALQUERYEX 8
#define CMD_READPROCESSMEMORY 9
#define CMD_WRITEPROCESSMEMORY 10
#define CMD_STARTDEBUG 11
#define CMD_STOPDEBUG 12
#define CMD_WAITFORDEBUGEVENT 13
#define CMD_CONTINUEFROMDEBUGEVENT 14
#define CMD_SETBREAKPOINT 15
#define CMD_REMOVEBREAKPOINT 16
#define CMD_SUSPENDTHREAD 17
#define CMD_RESUMETHREAD 18
#define CMD_GETTHREADCONTEXT 19
#define CMD_SETTHREADCONTEXT 20
#define CMD_GETARCHITECTURE 21
#define CMD_MODULE32FIRST 22
#define CMD_MODULE32NEXT 23
#define CMD_GETSYMBOLLISTFROMFILE 24
#define CMD_LOADEXTENSION 25
#define CMD_ALLOC 26
#define CMD_FREE 27
#define CMD_CREATETHREAD 28
#define CMD_LOADMODULE 29
#define CMD_SPEEDHACK_SETSPEED 30
#define CMD_VIRTUALQUERYEXFULL 31
#define CMD_GETREGIONINFO 32
#define CMD_GETABI 33
#define CMD_AOBSCAN 200
//just in case I ever get over 255 commands this value will be reserved for a secondary command list (FF 00 - FF 01 - ... - FF FE - FF FF 01 - FF FF 02 - .....
#define CMD_COMMANDLIST2 255
//extern char *versionstring;
#pragma pack(1)
typedef struct {
int version;
unsigned char stringsize;
//append the versionstring
} CeVersion, *PCeVersion;
typedef struct {
DWORD dwFlags;
DWORD th32ProcessID;
} CeCreateToolhelp32Snapshot, *PCeCreateToolhelp32Snapshot;
typedef struct {
int result;
int pid;
int processnamesize;
//processname
} CeProcessEntry, *PCeProcessEntry;
typedef struct {
int32_t result;
int64_t modulebase;
int32_t modulepart;
int32_t modulesize;
int32_t modulenamesize;
} CeModuleEntry, *PCeModuleEntry;
typedef struct {
int handle;
uint64_t baseaddress;
} CeVirtualQueryExInput, *PCeVirtualQueryExInput;
typedef struct {
uint8_t result;
uint32_t protection;
uint32_t type;
uint64_t baseaddress;
uint64_t size;
} CeVirtualQueryExOutput, *PCeVirtualQueryExOutput;
typedef struct {
int handle;
uint8_t flags;
} CeVirtualQueryExFullInput, *PCeVirtualQueryExFullInput;
typedef struct {
uint32_t protection;
uint32_t type;
uint64_t baseaddress;
uint64_t size;
} CeVirtualQueryExFullOutput, *PCeVirtualQueryExFullOutput;
typedef struct {
uint32_t handle;
uint64_t address;
uint32_t size;
uint8_t compress;
} CeReadProcessMemoryInput, *PCeReadProcessMemoryInput;
typedef struct {
int read;
} CeReadProcessMemoryOutput, *PCeReadProcessMemoryOutput;
typedef struct {
int32_t handle;
int64_t address;
int32_t size;
} CeWriteProcessMemoryInput, *PCeWriteProcessMemoryInput;
typedef struct {
int32_t written;
} CeWriteProcessMemoryOutput, *PCeWriteProcessMemoryOutput;
typedef struct {
HANDLE hProcess;
int tid;
int debugreg;
uint64_t Address;
int bptype;
int bpsize;
} CeSetBreapointInput, *PCeSetBreakpointInput;
typedef struct {
int result;
} CeSetBreapointOutput, *PCeSetBreakpointOutput;
typedef struct {
HANDLE hProcess;
uint32_t tid;
uint32_t debugreg;
uint32_t wasWatchpoint;
} CeRemoveBreapointInput, *PCeRemoveBreakpointInput;
typedef struct {
int result;
} CeRemoveBreapointOutput, *PCeRemoveBreakpointOutput;
typedef struct {
HANDLE hProcess;
int tid;
} CeSuspendThreadInput, *PCeSuspendThreadInput;
typedef struct {
int result;
} CeSuspendThreadOutput, *PCeSuspendThreadOutput;
typedef struct {
HANDLE hProcess;
int tid;
} CeResumeThreadInput, *PCeResumeThreadInput;
typedef struct {
int result;
} CeResumeThreadOutput, *PCeResumeThreadOutput;
typedef struct {
HANDLE hProcess;
uint64_t preferedBase;
uint32_t size;
} CeAllocInput, *PCeAllocInput;
typedef struct {
uint64_t address; //0=fail
} CeAllocOutput, *PCeAllocOutput;
typedef struct {
HANDLE hProcess;
uint64_t address;
uint32_t size;
} CeFreeInput, *PCeFreeInput;
typedef struct {
uint32_t result;
} CeFreeOutput, *PCeFreeOutput;
typedef struct {
HANDLE hProcess;
uint64_t startaddress;
uint64_t parameter;
} CeCreateThreadInput, *PCeCreateThreadInput;
typedef struct {
HANDLE threadhandle;
} CeCreateThreadOutput, *PCeCreateThreadOutput;
typedef struct {
HANDLE hProcess;
uint32_t modulepathlength;
//modulepath
} CeLoadModuleInput, *PCeLoadModuleInput;
typedef struct {
uint32_t result;
} CeLoadModuleOutput, *PCeLoadModuleOutput;
typedef struct {
HANDLE hProcess;
float speed;
} CeSpeedhackSetSpeedInput, *PCeSpeedhackSetSpeedInput;
typedef struct {
uint32_t result;
} CeSpeedhackSetSpeedOutput, *PCeSpeedhackSetSpeedOutput;
typedef struct {
HANDLE hProcess;
uint64_t start;
uint64_t end;
int inc;
int protection;
int scansize;
} CeAobScanInput, * PCeAobScanInput;
#pragma pack()
ssize_t sendall (int s, void *buf, size_t size, int flags);
ssize_t recvall (int s, void *buf, size_t size, int flags);
int DispatchCommand(int currentsocket, unsigned char command);
int CheckForAndDispatchCommand(int currentsocket);
#if BUILD_OPTION == 1
#define SHARED_LIBRARY
#endif
#endif /* CESERVER_H_ */