This repository was archived by the owner on Mar 7, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathHooks.cpp
executable file
·38 lines (29 loc) · 1.58 KB
/
Hooks.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
#include "main.hpp"
#include "skinchanger.h"
void InitializeInterfaces() {
pSurface = GetInterface<ISurface>("./bin/osx64/vguimatsurface.dylib", "VGUI_Surface");
pPanel = GetInterface<IPanel>("./bin/osx64/vgui2.dylib", "VGUI_Panel");
pGameEventManager = GetInterface<IGameEventManager2>("./bin/osx64/engine.dylib", "GAMEEVENTSMANAGER002", true);
pCvar = GetInterface<ICvar>("./bin/osx64/materialsystem.dylib", "VEngineCvar");
pClient = GetInterface<IBaseClientDLL>("./csgo/bin/osx64/client.dylib", "VClient");
pEngine = GetInterface<IEngineClient>("./bin/osx64/engine.dylib", "VEngineClient");
pEntList = GetInterface<IClientEntityList>("./csgo/bin/osx64/client.dylib", "VClientEntityList");
pOverlay = GetInterface<IVDebugOverlay>("./bin/osx64/engine.dylib", "VDebugOverlay");
pEngineTrace = GetInterface<IEngineTrace>("./bin/osx64/engine.dylib", "EngineTraceClient");
pModelInfo = GetInterface<IVModelInfo>("./bin/osx64/engine.dylib", "VModelInfoClient");
}
void InitializeVMTs() {
game_event_vmt = new VMT(pGameEventManager);
testvmt = new VMT(pPanel);
client_vmt = new VMT(pClient);
}
extern bool hkFireEventClientSide(void* thisptr, IGameEvent* event);
void InitializeHooks() {
//testvmt->HookVM((void*)hkPaintTraverse, 42);
testvmt->ApplyVMT();
game_event_vmt->HookVM((void*)hkFireEventClientSide, 11);
game_event_vmt->ApplyVMT();
g_pSequence = (RecvVarProxyFn)NetVarManager::HookProp("DT_BaseViewModel", "m_nSequence", HSequenceProxyFn);
client_vmt->HookVM((void*)hkFrameStage, 36);
client_vmt->ApplyVMT();
}