2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2023-05-15 14:47:03 +02:00
|
|
|
#include "tier1/interface.h"
|
2023-08-22 01:11:49 +02:00
|
|
|
#include "pluginsdk/ifactory.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
/*-----------------------------------------------------------------------------
|
|
|
|
* _interfaces.h
|
|
|
|
*-----------------------------------------------------------------------------*/
|
2022-08-21 00:59:55 +02:00
|
|
|
|
2022-04-09 00:59:42 +02:00
|
|
|
#define VENGINE_LAUNCHER_API_VERSION "VENGINE_LAUNCHER_API_VERSION004"
|
|
|
|
#define VENGINE_GAMEUIFUNCS_VERSION "VENGINE_GAMEUIFUNCS_VERSION005"
|
|
|
|
|
|
|
|
#define VENGINE_RENDERVIEW_INTERFACE_VERSION "VEngineRenderView014"
|
|
|
|
#define VENGINE_RANDOM_INTERFACE_VERSION "VEngineRandom001"
|
|
|
|
#define VENGINE_HUDMODEL_INTERFACE_VERSION "VEngineModel016"
|
|
|
|
#define MATERIALSYSTEM_CONFIG_VERSION "VMaterialSystemConfig004"
|
|
|
|
|
|
|
|
#define SERVER_DLL_SHARED_APPSYSTEMS "VServerDllSharedAppSystems001"
|
2023-01-16 21:09:21 +01:00
|
|
|
#define INTERFACEVERSION_SERVERGAMECLIENTS_NEW "ServerGameClients004"
|
|
|
|
#define INTERFACEVERSION_SERVERGAMECLIENTS "ServerGameClients003"
|
2022-04-09 00:59:42 +02:00
|
|
|
#define INTERFACEVERSION_SERVERGAMEENTS "ServerGameEnts002"
|
|
|
|
#define INTERFACEVERSION_SERVERGAMEDLL "ServerGameDLL005"
|
|
|
|
|
|
|
|
#define VCLIENT_PREDICTION_INTERFACE_VERSION "VClientPrediction001"
|
|
|
|
#define VCLIENTENTITYLIST_INTERFACE_VERSION "VClientEntityList003"
|
|
|
|
#define CLIENT_DLL_INTERFACE_VERSION "VClient018"
|
|
|
|
#define CLIENTRENDERTARGETS_INTERFACE_VERSION "ClientRenderTargets001"
|
|
|
|
#define INTERFACEVERSION_ENGINETRACE_CLIENT "EngineTraceClient004"
|
|
|
|
#define INTERFACEVERSION_ENGINETRACEDECALS_CLIENT "EngineTraceClientDecals004"
|
|
|
|
|
|
|
|
#define VGUI_SYSTEM_INTERFACE_VERSION "VGUI_System010"
|
|
|
|
#define GAMEUI_INTERFACE_VERSION "GameUI011"
|
|
|
|
|
|
|
|
#define RUNGAMEENGINE_INTERFACE_VERSION "RunGameEngine005"
|
|
|
|
#define EVENTSYSTEM_INTERFACE_VERSION "EventSystem001"
|
|
|
|
|
|
|
|
#define CVAR_QUERY_INTERFACE_VERSION "VCvarQuery001"
|
|
|
|
#define VPHYSICS_DEBUG_OVERLAY_INTERFACE_VERSION "VPhysicsDebugOverlay001"
|
|
|
|
#define VDEBUG_OVERLAY_INTERFACE_VERSION "VDebugOverlay004"
|
|
|
|
#define SOUNDCARD_INTERFACE_VERSION "ISoundC002"
|
|
|
|
|
|
|
|
#define SHADERSYSTEM_INTERFACE_VERSION "ShaderSystem002"
|
2023-08-22 01:11:49 +02:00
|
|
|
#define FACTORY_INTERFACE_VERSION "VFactorySystem002"
|
2023-01-22 15:11:55 +01:00
|
|
|
#define FILESYSTEM_INTERFACE_VERSION "VFileSystem017"
|
|
|
|
#define BASEFILESYSTEM_INTERFACE_VERSION "VBaseFileSystem011"
|
2023-05-08 19:12:52 +01:00
|
|
|
#define KEYVALUESSYSTEM_INTERFACE_VERSION "VKeyValuesSystem001"
|
2022-01-17 03:28:16 +01:00
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Class to hold all factories (interfaces)
|
|
|
|
//-----------------------------------------------------------------------------
|
2023-08-22 01:11:49 +02:00
|
|
|
class CFactorySystem : public IFactorySystem
|
2022-01-17 03:28:16 +01:00
|
|
|
{
|
|
|
|
public:
|
2023-08-22 01:11:49 +02:00
|
|
|
virtual void AddFactory(InstantiateInterfaceFn createFn, const char* pName) const override;
|
|
|
|
virtual void* GetFactory(const char* pName) const override;
|
|
|
|
virtual const char* GetVersion(void) const override;
|
2022-01-17 03:28:16 +01:00
|
|
|
};
|
2023-08-21 20:40:35 +02:00
|
|
|
|
2024-01-21 21:29:23 +01:00
|
|
|
extern CFactorySystem g_FactorySystem;
|
2023-08-22 01:11:49 +02:00
|
|
|
PLATFORM_INTERFACE IFactorySystem* GetFactorySystem();
|
2022-01-18 01:21:24 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2024-01-02 15:21:36 +01:00
|
|
|
inline void*(*v_CreateInterfaceInternal)(const char* pName, int* pReturnCode);
|
2023-08-22 01:11:49 +02:00
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
class VFactory : public IDetour
|
2022-01-18 01:21:24 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-01-18 01:21:24 +01:00
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
LogFunAdr("CreateInterfaceInternal", v_CreateInterfaceInternal);
|
|
|
|
LogVarAdr("s_pInterfaceRegs", s_ppInterfaceRegs);
|
2023-08-22 01:11:49 +02:00
|
|
|
}
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
2024-01-02 15:21:36 +01:00
|
|
|
g_GameDll.FindPatternSIMD("48 89 5C 24 ?? 48 89 6C 24 ?? 48 89 74 24 ?? 57 48 83 EC 20 48 8B 1D ?? ?? ?? ?? 48 8B FA").GetPtr(v_CreateInterfaceInternal);
|
2022-01-18 01:21:24 +01:00
|
|
|
}
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2023-08-22 01:11:49 +02:00
|
|
|
s_ppInterfaceRegs = g_GameDll.FindPatternSIMD("E9 ?? ?? ?? ?? CC CC 89 91 ?? ?? ?? ??")
|
|
|
|
.FollowNearCallSelf().FindPatternSelf("48 8B 1D", CMemory::Direction::DOWN).ResolveRelativeAddressSelf(0x3, 0x7).RCast<InterfaceReg**>();
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
2024-04-05 16:53:51 +02:00
|
|
|
virtual void Detour(const bool /*bAttach*/) const { }
|
2022-01-18 01:21:24 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|