forked from faggotman69/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInterfaces.h
More file actions
61 lines (55 loc) · 2.08 KB
/
Interfaces.h
File metadata and controls
61 lines (55 loc) · 2.08 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
#pragma once
#include "CommonIncludes.h"
#include "SDK.h"
#include <iostream>
#include "Utilities.h"
#include "IViewRenderBeams.h"
#include "memalloc.h"
#include <d3d9.h>
#include "network.h"
extern void InitialiseInterfaces();
extern IBaseClientDLL* g_CHLClient;
extern IVEngineClient* g_Engine;
extern IPanel* g_Panel;
extern C_BaseEntityList* g_EntityList;
extern ISurface* g_Surface;
extern IVDebugOverlay* g_DebugOverlay;
extern IClientMode* g_ClientMode;
extern CGlobalVarsBase* g_Globals;
extern IPrediction *g_Prediction;
extern CMaterialSystem* g_MaterialSystem;
extern CVRenderView* g_RenderView;
extern IVModelRender* g_ModelRender;
extern CModelInfo* g_ModelInfo;
extern IEngineTrace* g_EngineTrace;
extern IPhysicsSurfaceProps* g_PhysProps;
extern ICVar* g_CVar;
extern IVEffects* g_Dlight;
extern IMoveHelper* g_MoveHelper;
extern IGameMovement* g_GameMovement;
extern CInput* g_Input;
extern IGameEventManager2* g_EventManager;
extern C_CSPlayerResource* g_PlayerResource;
extern C_CSGameRules* g_GameRules;
extern IViewRender* g_ViewRender;
extern IGameConsole* g_GameConsole;
extern IMDLCache* g_MdlCache;
extern CHudChat* g_ChatElement;
extern CGlowObjectManager* g_GlowObjManager;
extern IViewRenderBeams* g_pViewRenderBeams;
extern IMemAlloc* g_pMemAlloc;
extern IDirect3DDevice9* g_D3DDevice9;
extern CNetworkStringTableContainer* g_ClientStringTableContainer;
template<class T>
static T* FindHudElement(const char* name)
{
static auto pThis = *reinterpret_cast<DWORD**>(U::pattern_scan(GetModuleHandleW(L"client.dll"), "B9 ? ? ? ? E8 ? ? ? ? 83 7D F8 ?") + 1);
static auto find_hud_element = reinterpret_cast<DWORD(__thiscall*)(void*, const char*)>(U::pattern_scan(GetModuleHandleW(L"client.dll"), "55 8B EC 53 8B 5D 08 56 57 8B F9 33 F6 39 77 28"));
return (T*)find_hud_element(pThis, name);
}
typedef void* (__cdecl* CreateInterface_t)(const char*, int*);
typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode);
inline CreateInterfaceFn get_module_factory(HMODULE module)
{
return reinterpret_cast<CreateInterfaceFn>(GetProcAddress(module, "CreateInterface"));
}