-
Notifications
You must be signed in to change notification settings - Fork 51
/
dllexport.h
247 lines (202 loc) · 6.96 KB
/
dllexport.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
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
// ------------------------------------------------------------------------------
// 内存读写结构定义
// ------------------------------------------------------------------------------
// 读写内存整数结构体
typedef struct
{
DWORD pid;
ULONG64 address;
UINT bytes_toread;
DWORD64 data;
}ProcessIntMemory;
// 读写内存偏移整数型
typedef struct
{
DWORD pid;
ULONG64 base_address;
DWORD offset[32];
DWORD offset_len;
INT64 data;
}ProcessDeviationIntMemory;
// 读写多级偏移内存地址
typedef struct
{
DWORD pid;
ULONG64 base_address;
DWORD offset[32];
DWORD offset_len;
DWORD64 data;
}ProcessDeviationMemory;
// 读写内存字节型
typedef struct
{
DWORD pid;
ULONG64 base_address;
BYTE OpCode;
}ProcessByteMemory;
// 取模块名称结构体
typedef struct ModuleInfoStruct
{
CHAR ModuleName[1024];
}ModuleInfoStruct, *LPModuleInfoStruct;
cDrvCtrl DriveControl;
// 安装驱动
extern "C"__declspec(dllexport) void InstallDriver()
{
DriveControl.InstallAndRun();
}
// 卸载关闭驱动
extern "C" __declspec(dllexport) void RemoveDriver()
{
DriveControl.RemoveAndStop();
}
// 通用驱动导出
extern "C" __declspec(dllexport) BYTE ReadProcessMemoryByte(DWORD pid, ULONG64 address)
{
return DriveControl.ReadProcessMemoryByte(pid, address);
}
extern "C" __declspec(dllexport) BOOL WriteProcessMemoryByte(DWORD Pid, ULONG64 Address, BYTE bytef)
{
return DriveControl.WriteProcessMemoryByte(Pid, Address, bytef);
}
extern "C" __declspec(dllexport) DWORD ReadProcessMemoryInt32(DWORD Pid, ULONG64 Address)
{
return DriveControl.ReadProcessMemoryInt32(Pid, Address);
}
extern "C" __declspec(dllexport) DWORD ReadProcessMemoryInt64(DWORD Pid, ULONG64 Address)
{
return DriveControl.ReadProcessMemoryInt64(Pid, Address);
}
extern "C" __declspec(dllexport) BOOL WriteProcessMemoryInt32(DWORD Pid, ULONG64 Address, DWORD write)
{
return DriveControl.WriteProcessMemoryInt32(Pid, Address, write);
}
extern "C" __declspec(dllexport) BOOL WriteProcessMemoryInt64(DWORD Pid, ULONG64 Address, DWORD write)
{
return DriveControl.WriteProcessMemoryInt64(Pid, Address, write);
}
extern "C" __declspec(dllexport) FLOAT ReadProcessMemoryFloat(DWORD Pid, ULONG64 Address)
{
return DriveControl.ReadProcessMemoryFloat(Pid, Address);
}
extern "C" __declspec(dllexport) DOUBLE ReadProcessMemoryDouble(DWORD Pid, ULONG64 Address)
{
return DriveControl.ReadProcessMemoryDouble(Pid, Address);
}
extern "C" __declspec(dllexport) BOOL WriteProcessMemoryFloat(DWORD Pid, ULONG64 Address, FLOAT write)
{
return DriveControl.WriteProcessMemoryFloat(Pid, Address, write);
}
extern "C" __declspec(dllexport) BOOL WriteProcessMemoryDouble(DWORD Pid, ULONG64 Address, DOUBLE write)
{
return DriveControl.WriteProcessMemoryDouble(Pid, Address, write);
}
extern "C" __declspec(dllexport) INT32 ReadProcessDeviationInt32(ProcessDeviationIntMemory read_offset_struct)
{
return DriveControl.ReadProcessDeviationInt32(&read_offset_struct);
}
extern "C" __declspec(dllexport) INT64 ReadProcessDeviationInt64(ProcessDeviationIntMemory read_offset_struct)
{
return DriveControl.ReadProcessDeviationInt64(&read_offset_struct);
}
extern "C" __declspec(dllexport) BOOL WriteProcessDeviationInt32(ProcessDeviationIntMemory write_offset_struct)
{
return DriveControl.WriteProcessDeviationInt32(&write_offset_struct);
}
extern "C" __declspec(dllexport) BOOL WriteProcessDeviationInt64(ProcessDeviationIntMemory write_offset_struct)
{
return DriveControl.WriteProcessDeviationInt64(&write_offset_struct);
}
extern "C" __declspec(dllexport) DWORD ReadDeviationMemory32(ProcessDeviationMemory read_offset_struct)
{
return DriveControl.ReadDeviationMemory32(&read_offset_struct);
}
extern "C" __declspec(dllexport) DWORD64 ReadDeviationMemory64(ProcessDeviationMemory read_offset_struct)
{
return DriveControl.ReadDeviationMemory64(&read_offset_struct);
}
extern "C" __declspec(dllexport) BYTE ReadDeviationByte(ProcessDeviationMemory read_offset_struct)
{
return DriveControl.ReadDeviationByte(&read_offset_struct);
}
extern "C" __declspec(dllexport) FLOAT ReadDeviationFloat(ProcessDeviationMemory read_offset_struct)
{
return DriveControl.ReadDeviationFloat(&read_offset_struct);
}
extern "C" __declspec(dllexport) BOOL WriteDeviationByte(ProcessDeviationMemory write_offset_struct, BYTE write_byte)
{
return DriveControl.WriteDeviationByte(&write_offset_struct, write_byte);
}
extern "C" __declspec(dllexport) BOOL WriteDeviationFloat(ProcessDeviationMemory write_offset_struct, FLOAT write_float)
{
return DriveControl.WriteDeviationFloat(&write_offset_struct, write_float);
}
// 全局读写
extern "C" __declspec(dllexport) BOOL SetPid(DWORD Pid)
{
return DriveControl.SetPid(Pid);
}
extern "C" __declspec(dllexport) void ReadMemoryDWORD(DWORD pid, ULONG64 addre, DWORD ret)
{
return DriveControl.ReadMemoryDWORD(pid, addre, &ret);
}
extern "C" __declspec(dllexport) void ReadMemoryDWORD64(DWORD pid, ULONG64 addre, DWORD64 ret)
{
return DriveControl.ReadMemoryDWORD64(pid, addre, &ret);
}
extern "C" __declspec(dllexport) void ReadMemoryBytes(DWORD pid, ULONG64 addre, BYTE *ret, DWORD sizes)
{
return DriveControl.ReadMemoryBytes(pid, addre, &ret, sizes);
}
extern "C" __declspec(dllexport) void ReadMemoryFloat(DWORD pid, ULONG64 addre, float ret)
{
return DriveControl.ReadMemoryFloat(pid, addre, &ret);
}
extern "C" __declspec(dllexport) void ReadMemoryDouble(DWORD pid, ULONG64 addre, double ret)
{
return DriveControl.ReadMemoryDouble(pid, addre, &ret);
}
extern "C" __declspec(dllexport) void WriteMemoryBytes(DWORD pid, ULONG64 addre, BYTE data, DWORD sizes)
{
return DriveControl.WriteMemoryBytes(pid, addre, &data, sizes);
}
extern "C" __declspec(dllexport) void WriteMemoryDWORD(DWORD pid, ULONG64 addre, DWORD ret)
{
return DriveControl.WriteMemoryDWORD(pid, addre, ret);
}
extern "C" __declspec(dllexport) void WriteMemoryDWORD64(DWORD pid, ULONG64 addre, DWORD64 ret)
{
return DriveControl.WriteMemoryDWORD64(pid, addre, ret);
}
extern "C" __declspec(dllexport) void WriteMemoryFloat(DWORD pid, ULONG64 addre, float ret)
{
return DriveControl.WriteMemoryFloat(pid, addre, ret);
}
extern "C" __declspec(dllexport) void WriteMemoryDouble(DWORD pid, ULONG64 addre, double ret)
{
return DriveControl.WriteMemoryDouble(pid, addre, ret);
}
extern "C" __declspec(dllexport) DWORD64 GetModuleAddress(DWORD pid, std::string dllname)
{
return DriveControl.GetModuleAddress(pid, dllname);
}
extern "C" __declspec(dllexport) DWORD GetProcessID(std::string procname)
{
return DriveControl.GetProcessID(procname);
}
extern "C" __declspec(dllexport) DWORD64 GetSystemRoutineAddress(std::string funcname)
{
return DriveControl.GetSystemRoutineAddress(funcname);
}
extern "C" __declspec(dllexport) DWORD64 CreateRemoteMemory(DWORD length)
{
return DriveControl.CreateRemoteMemory(length);
}
extern "C" __declspec(dllexport) DWORD DeleteRemoteMemory(DWORD64 address, DWORD length)
{
return DriveControl.DeleteRemoteMemory(address, length);
}
BOOL APIENTRY DllMain(HMODULE hModule,DWORD ul_reason_for_call,LPVOID lpReserved)
{
return TRUE;
}