-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBaseClasses.h
More file actions
402 lines (336 loc) · 9.97 KB
/
BaseClasses.h
File metadata and controls
402 lines (336 loc) · 9.97 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
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
#pragma once
#include "Maths.h"
class SSystemGlobalEnvironment;
class IGameFramework;
class IGame;
class IActorSystem;
class ICVar;
class IRenderer;
class IEntitySystem;
class IEntity;
class IEntityClassRegistry;
class IPhysicalWorld;
class ISystem;
class IWeapon;
class i_actor;
class i_entity_proxy;
class i_entity;
class i_actor_system;
class i_entity_it;
class i_entity_system;
/*
#define sge 0x141CBBFB0
#define igFramework 0x141FC5818
#define iCvar 0x141FC4B70 // https://www.unknowncheats.me/forum/warface/336692-reversing-cvars-warface.html
#define gdDevice 0xA6D0 // https://www.unknowncheats.me/forum/warface/346016-vmt-hook-64-bit-warface.html
#define EU_sge 0x141C1A150
#define EU_igFramework 0x141F238F8
#define EU_iCvar 0x141F22C50
#define EU_gdDevice 0xA6D0
*/
#define sge 0x141D132D0
#define igFramework 0x14201CD18
#define iCvar 0x14201C070 // https://www.unknowncheats.me/forum/warface/336692-reversing-cvars-warface.html
#define gdDevice 0xA6D0 // https://www.unknowncheats.me/forum/warface/346016-vmt-hook-64-bit-warface.html
#define sge_IRenderer 0x48
#define sge_IGame 0xC8
#define sge_ICVar 0xC0
#define sge_IEntitySystem 0xD8
#define SSystemGlobalEnvironment__IGameRoom 0x224
#define SSystemGlobalEnvironment__pIPhysicalWorld 0x44
#define V_SetPostEffectParamI 0x23C / 4
#define IEntityRenderProxy__SetHUDSilhouettesParams 0xB0 / 4
#define ISkeletonPose__GetJointNameByID 0xC / 4
#define V_GetISkeletonPose 0x14 / 4
#define ISkeletonPose__GetAbsJointByID 0x1C / 4
#define IEntity___GetCharacter 0x148 / 4
#define V_GetProxy 0xEC / 4
#define V_GetCurrentGameRules 0x780
#define IGameRules__GetTeam 0x360 / 8
#define SSystemGlobalEnvironment__pIRenderer 0x30
#define SSystemGlobalEnvironment__pEntitySystem 0x78
typedef unsigned int EntityId;
template< typename cData >
cData vFun_Call(PVOID BaseClass, DWORD64 vOFFSET)
{
PDWORD64* vPointer = (PDWORD64*)BaseClass;
PDWORD64 vFunction = *vPointer;
DWORD64 dwAddress = vFunction[vOFFSET];
return (cData)(dwAddress);
};
template <typename t>
t f_virtual(PVOID f_base, __int64 f_index)
{
return (*(t**)f_base)[f_index / 8];
};
enum game_data : __int64
{
a_system_global = 0x141C140F0,
a_gameframework = 0x141F221F0,
o_entity_system = 0xD8,
o_system = 0xE8
};
enum virtual_data : __int32
{
f_get_entity_iterator = 168, // new-168 old-160 искать GetEntitiesByClass
f_entity_next = 48,
f_get_actor = 120,
f_set_hudsilhouettes_params = 352,
f_get_proxy = 472,
f_get_client_actor = 1136
};
enum e_entity_proxy
{
entity_proxy_render,
entity_proxy_physics,
entity_proxy_script,
entity_proxy_sound,
entity_proxy_ai,
entity_proxy_area,
entity_proxy_boids,
entity_proxy_boid_object,
entity_proxy_camera,
entity_proxy_flow_graph,
entity_proxy_substitution,
entity_proxy_trigger,
entity_proxy_rope,
entity_proxy_entity_node,
entity_proxy_user,
entity_proxy_last
};
enum entity_data : __int32
{
o_set_render_flags = 0x24
};
enum actor_data : __int32
{
o_get_entity = 0x10,
o_get_team_id = 0x3E0
};
enum game_frame_work_data
{
o_get_actor_system = 0x4E0
};
//-----------------------------------------------------------------------------------------------------------
class SSystemGlobalEnvironment
{
public:
char pad_0x0034[0x10];
IGame * pIGame() { return *(IGame**)((DWORD64)this + sge_IGame); }
IRenderer* pRenderer() { return *(IRenderer**)((DWORD64)this + sge_IRenderer); }
IEntitySystem* pEntitySystem() { return *(IEntitySystem**)((DWORD64)this + sge_IEntitySystem); }
static SSystemGlobalEnvironment* GetInstance() { return *(SSystemGlobalEnvironment**)sge; } // EU_sge 0x141BC5370 sge 0x141BC3310
i_entity_system* get_entity_system()
{
return (i_entity_system*)*(__int64*)((__int64)this + game_data::o_entity_system);
}
};
class IActor {
public:
EntityId getEntityId() { return *(EntityId*)((DWORD64)this + 0x20); }
INT IsDead() { return vFun_Call<int(__thiscall*)(PVOID)>(this, 24)(this); }
IEntity* GetEntity() { return *(IEntity**)((DWORD64)this + 0x10); }
};
class IGame
{
public:
//IGameFramework* GetIGameFramework() { return *(IGameFramework**)((DWORD)this + 0x28); }
IGameFramework* GetIGameFramework() { return *(IGameFramework**)igFramework; } // igFramework 0x141ECC628 EU_igFramework 0x141ECE698
ICVar * GetICvar()
{
//return (ICVar*)*(DWORD64*)((DWORD64)this + sge_ICVar);
return *(ICVar**)iCvar; // https://www.unknowncheats.me/forum/warface/336692-reversing-cvars-warface.html
}
};
class IGameRules
{
public:
INT GetTeam(EntityId entityId)
{
return vFun_Call<int(__thiscall*)(PVOID, EntityId)>(this, IGameRules__GetTeam)(this, entityId);
}
BOOL EliminationTeam(IActor* pPlayer, IActor* mPlayer)
{
int mTeam = GetTeam(mPlayer->getEntityId());
int pTeam = GetTeam(pPlayer->getEntityId());
//if (pPlayer->GetDead())return FALSE;
if ((mTeam != pTeam || pTeam == 0) && (pPlayer != mPlayer)) return TRUE; else return FALSE;
}
};
class IGameFramework {
public:
ISystem * GetISystem() { return *(ISystem**)((DWORD64)this + 0x8); }
IActorSystem* GetIActorSystem() { return *(IActorSystem**)((DWORD64)this + 0x4E0); }
BOOLEAN GetClientActor(i_actor** pActor)
{
using GetClientActorP = bool(__thiscall*)(PVOID, i_actor**);
return vFun_Call<GetClientActorP >(this, 142)(this, pActor);
}
IGameRules* GetCurrentGameRules() { return *(IGameRules**)((DWORD64)this + V_GetCurrentGameRules); }
static IGameFramework*GetGameFramework() { return*(IGameFramework**)igFramework; } //
i_actor_system* get_actor_system()
{
return *(i_actor_system**)((__int64)this + game_frame_work_data::o_get_actor_system);
}
bool get_client_actor(i_actor** p_actor)
{
return f_virtual<bool(__thiscall*)(PVOID, i_actor**)>(this, virtual_data::f_get_client_actor)(this, p_actor);
}
};
class IActorIterator
{
public:
IActor * Next() { return vFun_Call<IActor*(__thiscall*)(PVOID)>(this, 1)(this); }
INT Сount() { return vFun_Call<INT(__thiscall*)(PVOID)>(this, 3)(this); }
};
class IActorSystem
{
public:
int GetCount() { return vFun_Call<int(__thiscall*)(PVOID)>(this, 13)(this); }
void CreateActorIterator(IActorIterator** ActorIterator)
{
using CreateActorIteratorFn = void(__thiscall*)(PVOID, IActorIterator**);
return vFun_Call<CreateActorIteratorFn>(this, 144 / 8)(this, ActorIterator);
}
IActorIterator*GetActorIterator()
{
IActorIterator*pActorIterator = nullptr;
CreateActorIterator(&pActorIterator);
if (pActorIterator)return pActorIterator;
return NULL;
}
};
class IRenderer
{
public:
struct w2s_info
{
float Posx;
float Posy;
float Posz;
float *Scrnx;
float *Scrny;
float *Scrnz;
};
bool ProjectToScreen(w2s_info *info) { return vFun_Call<bool(__thiscall*)(PVOID, w2s_info*)>(this, 94)(this, info); }
DWORD64* GetDirectDevice() { return *(DWORD64**)((DWORD64)this + gdDevice); } // https://www.unknowncheats.me/forum/warface/346016-vmt-hook-64-bit-warface.html
};
enum ESilhouettesParams {
eAllMap = 524312,
eLimitDistance = 524296
};
class IEntityRenderProxy
{
public:
virtual void Function0(); //
virtual void Function1(); //
virtual void Function2(); //
virtual void Function3(); //
virtual void Function4(); //
virtual void Function5(); //
virtual void Function6(); //
virtual void Function7(); //
virtual void Function8(); //
virtual void Function9(); //
virtual void Function10(); //
virtual void Function11(); //
virtual void Function12(); //
virtual void Function13(); //
virtual void Function14(); //
virtual void Function15(); //
virtual void Function16(); //
virtual void Function17(); //
virtual void Function18(); //
virtual void Function19(); //
virtual void Function20(); //
virtual void Function21(); //
virtual void Function22(); //
virtual void Function23(); //
virtual void Function24(); //
virtual void Function25(); //
virtual void Function26(); //
virtual void Function27(); //
virtual void Function28(); //
virtual void Function29(); //
virtual void Function30(); //
virtual void Function31(); //
virtual void Function32(); //
virtual void Function33(); //
virtual void Function34(); //
virtual void Function35(); //
virtual void Function36(); //
virtual void Function37(); //
virtual void Function38(); //
virtual void Function39(); //
virtual void Function40(); //
virtual void Function41(); //
virtual void Function42(); //
virtual void Function43(); //
virtual void SetHUDSilhouettesParams(float a, float r, float g, float b);
void SetRndFlags(int Flag) { *(int*)((DWORD64)this + 0x24) = Flag; }
};
class IEntity
{
public:
IEntityRenderProxy* GetProxy() { return vFun_Call<IEntityRenderProxy*(__thiscall*)(PVOID, int) >(this, V_GetProxy)(this, 0); }
};
//////////////////////////////////////////////////////////////
class i_entity_system
{
public:
i_entity_it* get_entity_iterator()
{
return f_virtual<i_entity_it*(__thiscall*)(PVOID)>(this, virtual_data::f_get_entity_iterator)(this); // new-168 old-160 искать GetEntitiesByClass
}
};
class i_entity_it
{
public:
i_entity* entity_next()
{
return f_virtual<i_entity*(__thiscall*)(PVOID)>(this, virtual_data::f_entity_next)(this);
}
};
class i_actor_system
{
public:
int aff = 12;
i_actor* get_actor(__int32 entity_id)
{
return f_virtual<i_actor*(__thiscall*)(PVOID, __int32)>(this, virtual_data::f_get_actor)(this, entity_id);
}
};
class i_entity
{
public:
__int32 get_entity_id()
{
return *(__int32*)((__int64)this + 0x18);
}
i_entity_proxy* get_proxy(e_entity_proxy proxy)
{
return f_virtual<i_entity_proxy*(__thiscall*)(PVOID, e_entity_proxy)>(this, virtual_data::f_get_proxy)(this, proxy);
}
};
class i_entity_proxy
{
public:
int afd = 12;
void set_render_flags(__int32 flag) { *(__int32*)((__int64)this + entity_data::o_set_render_flags) = flag; }
void set_hudsilhouettes_params(float r, float g, float b, float a)
{
return f_virtual<void(__thiscall*)(PVOID, float, float, float, float)>(this, virtual_data::f_set_hudsilhouettes_params)(this, r, g, b, a);
}
};
class i_actor
{
public:
i_entity* get_entity()
{
return *(i_entity**)((__int64)this + actor_data::o_get_entity);
}
__int32 get_team_id()
{
return *(__int32*)((__int64)this + actor_data::o_get_team_id);
}
};