-
Notifications
You must be signed in to change notification settings - Fork 3
/
Offsets.cpp
177 lines (145 loc) · 5.31 KB
/
Offsets.cpp
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
#include "Offsets.h"
#include "UTIL Functions.h"
#define strenc( s ) ( s )
void Offsets::Initialise()
{
// Modules
Modules::Client = Utilities::Memory::WaitOnModuleHandle("client.dll");
Modules::Engine = Utilities::Memory::WaitOnModuleHandle("engine.dll");
Modules::VGUI2 = Utilities::Memory::WaitOnModuleHandle("vgui2.dll");
Modules::VGUISurface = Utilities::Memory::WaitOnModuleHandle("vguimatsurface.dll");
Modules::Material = Utilities::Memory::WaitOnModuleHandle("materialsystem.dll");
Modules::VPhysics = Utilities::Memory::WaitOnModuleHandle("vphysics.dll");
Modules::Stdlib = Utilities::Memory::WaitOnModuleHandle("vstdlib.dll");
#pragma region VTables
VMT::CHL_GetAllClasses = 8;
VMT::Engine_GetScreenSize = 5;
VMT::Engine_GetPlayerInfo = 8;
VMT::Engine_GetLocalPlayer = 12;
VMT::Engine_Time = 14;
VMT::Engine_GetViewAngles = 18;
VMT::Engine_SetViewAngles = 19;
VMT::Engine_GetMaxClients = 20;
VMT::Engine_IsConnected = 27;
VMT::Engine_IsInGame = 26;
VMT::Engine_WorldToScreenMatrix = 37;
VMT::Engine_ClientCmd_Unrestricted = 114;
VMT::Panel_GetName = 36;
VMT::Panel_PaintTraverse = 41;
VMT::Surface_DrawSetColorA = 14;
VMT::Surface_DrawSetColorB = 15;
VMT::Surface_DrawFilledRect = 16;
VMT::Surface_DrawOutlinedRect = 18;
VMT::Surface_DrawLine = 19;
VMT::Surface_DrawSetTextFont = 23;
VMT::Surface_DrawSetTextColorA = 24;
VMT::Surface_DrawSetTextColorB = 25;
VMT::Surface_DrawSetTextPos = 26;
VMT::Surface_DrawPrintText = 28;
VMT::Surface_DrawSetTextureRGBA = 37;
VMT::Surface_DrawSetTexture = 38;
VMT::Surface_CreateNewTextureID = 43;
VMT::Surface_FontCreate = 71;
VMT::Surface_SetFontGlyphSet = 72;
VMT::Surface_GetTextSize = 79;
VMT::Surface_DrawOutlinedCircle = 103;
VMT::Surface_SurfaceGetCursorPos = 66;
VMT::Surface_DrawTexturedPolygon = 106;
VMT::Material_GetName = 0;
VMT::Material_SetMaterialVarFlag = 30;
VMT::Material_GetMaterialVarFlag = 31;
VMT::Material_AlphaModulate = 28;
VMT::Material_ColorModulate = 29;
VMT::Material_IncrementReferenceCount = 14;
VMT::MaterialSystem_FindMaterial = 84;
VMT::MaterialSystem_CreateMaterial = 83;
VMT::ModelRender_ForcedMaterialOverride = 1;
VMT::ModelRender_DrawModelExecute = 21;
VMT::ModelInfo_GetModelName = 3;
VMT::ModelInfo_GetStudiomodel = 32;
VMT::RenderView_SetBlend = 4;
VMT::RenderView_SetColorModulation = 6;
#pragma endregion Contains the VTable Indexs
Functions::KeyValues_KeyValues = Utilities::Memory::FindPatternV2("client.dll", "55 8B EC 51 33 C0 C7 45");
Functions::KeyValues_LoadFromBuffer = Utilities::Memory::FindPatternV2("client.dll", "55 8B EC 83 E4 F8 83 EC 34 53 8B 5D 0C 89 4C 24 04");
Functions::dwCalcPlayerView = Utilities::Memory::FindPattern("client.dll", (PBYTE)"\x84\xC0\x75\x08\x57\x8B\xCE\xE8\x00\x00\x00\x00\x8B\x06", "xxxxxxxx????xx");
Functions::dwGetPlayerCompRank = GameUtils::FindPattern1(strenc("client.dll"), strenc("55 8B EC 8B 0D ? ? ? ? 68 ? ? ? ? "));
Functions::IsReadySig = GameUtils::FindPattern1(strenc("client.dll"), strenc("55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 8B 8E"));
Functions::dwIsReady = GameUtils::FindPattern1(strenc("client.dll"), strenc("55 8B EC 83 E4 F8 83 EC 08 56 8B 35 ? ? ? ? 57 8B BE"));
Utilities::Log("Offsets/Indexes Up to Date");
}
namespace Offsets
{
namespace Modules
{
DWORD Client;
DWORD Engine;
DWORD VGUI2;
DWORD VGUISurface;
DWORD Material;
DWORD VPhysics;
DWORD Stdlib;
};
namespace VMT
{
DWORD CHL_GetAllClasses;
DWORD Engine_GetScreenSize;
DWORD Engine_GetPlayerInfo;
DWORD Engine_GetLocalPlayer;
DWORD Engine_Time;
DWORD Engine_GetViewAngles;
DWORD Engine_SetViewAngles;
DWORD Engine_GetMaxClients;
DWORD Engine_IsConnected;
DWORD Engine_IsInGame;
DWORD Engine_WorldToScreenMatrix;
DWORD Engine_GetNetChannelInfo;
DWORD Engine_ClientCmd_Unrestricted;
DWORD Panel_GetName;
DWORD Panel_PaintTraverse;
DWORD Surface_DrawSetColorA;
DWORD Surface_DrawSetColorB;
DWORD Surface_DrawFilledRect;
DWORD Surface_DrawOutlinedRect;
DWORD Surface_DrawLine;
DWORD Surface_DrawSetTextFont;
DWORD Surface_DrawSetTextColorA;
DWORD Surface_DrawSetTextColorB;
DWORD Surface_DrawSetTextPos;
DWORD Surface_DrawPrintText;
DWORD Surface_DrawSetTextureRGBA;
DWORD Surface_DrawSetTexture;
DWORD Surface_CreateNewTextureID;
DWORD Surface_FontCreate;
DWORD Surface_SetFontGlyphSet;
DWORD Surface_GetTextSize;
DWORD Surface_DrawOutlinedCircle;
DWORD Surface_SurfaceGetCursorPos;
DWORD Surface_DrawTexturedPolygon;
DWORD Material_GetName;
DWORD Material_SetMaterialVarFlag;
DWORD Material_GetMaterialVarFlag;
DWORD Material_AlphaModulate;
DWORD Material_ColorModulate;
DWORD Material_IncrementReferenceCount;
DWORD MaterialSystem_FindMaterial;
DWORD MaterialSystem_CreateMaterial;
DWORD ModelRender_ForcedMaterialOverride;
DWORD ModelRender_DrawModelExecute;
DWORD ModelInfo_GetModelName;
DWORD ModelInfo_GetStudiomodel;
DWORD RenderView_SetBlend;
DWORD RenderView_SetColorModulation;
DWORD Weapon_GetSpread;
};
namespace Functions
{
DWORD KeyValues_KeyValues;
DWORD KeyValues_LoadFromBuffer;
DWORD dwCalcPlayerView;
DWORD dwGetPlayerCompRank;
DWORD dwIsReady;
DWORD GetWeaponData;
DWORD IsReadySig;
};
};