diff --git a/Hooks.cpp b/Hooks.cpp index 559d1ded..e62836e7 100644 --- a/Hooks.cpp +++ b/Hooks.cpp @@ -697,7 +697,7 @@ void Hooks::install() noexcept sound.hookAt(5, emitSound); surface.hookAt(15, setDrawColor); surface.hookAt(67, lockCursor); - svCheats.hookAt(13, svCheatsGetBool); + //svCheats.hookAt(13, svCheatsGetBool); viewRender.hookAt(39, render2dEffectsPreHud); viewRender.hookAt(41, renderSmokeOverlay); diff --git a/Interfaces.h b/Interfaces.h index 331c6c74..c2bf5866 100644 --- a/Interfaces.h +++ b/Interfaces.h @@ -31,48 +31,53 @@ class SoundEmitter; class StudioRender; //class SteamMatchMaking; -class Interfaces { +class Interfaces +{ public: -#define GAME_INTERFACE(type, name, module, version) \ -type* name = reinterpret_cast(find(L##module, version)); + #define GAME_INTERFACE(type, name, module, version) \ + type* name = reinterpret_cast(find(##module, version)); - GAME_INTERFACE(Client, client, "client", "VClient018") - GAME_INTERFACE(Cvar, cvar, "vstdlib", "VEngineCvar007") - GAME_INTERFACE(Effects, effects, "engine", "VEngineEffects001") - GAME_INTERFACE(Engine, engine, "engine", "VEngineClient014") - GAME_INTERFACE(EngineTrace, engineTrace, "engine", "EngineTraceClient004") - GAME_INTERFACE(EntityList, entityList, "client", "VClientEntityList003") - //GAME_INTERFACE(FileSystem, fileSystem, "filesystem_stdio", "VFileSystem017") - GAME_INTERFACE(GameEventManager, gameEventManager, "engine", "GAMEEVENTSMANAGER002") - GAME_INTERFACE(GameMovement, gameMovement, "client", "GameMovement001") - GAME_INTERFACE(GameUI, gameUI, "client", "GameUI011") - GAME_INTERFACE(InputSystem, inputSystem, "inputsystem", "InputSystemVersion001") - GAME_INTERFACE(Localize, localize, "localize", "Localize_001") - GAME_INTERFACE(MaterialSystem, materialSystem, "materialsystem", "VMaterialSystem080") - GAME_INTERFACE(ModelInfo, modelInfo, "engine", "VModelInfoClient004") - GAME_INTERFACE(ModelRender, modelRender, "engine", "VEngineModel016") - GAME_INTERFACE(NetworkStringTableContainer, networkStringTableContainer, "engine", "VEngineClientStringTable001") - GAME_INTERFACE(Panel, panel, "vgui2", "VGUI_Panel009") - GAME_INTERFACE(PhysicsSurfaceProps, physicsSurfaceProps, "vphysics", "VPhysicsSurfaceProps001") - GAME_INTERFACE(Prediction, prediction, "client", "VClientPrediction001") - GAME_INTERFACE(RenderView, renderView, "engine", "VEngineRenderView014") - GAME_INTERFACE(Surface, surface, "vguimatsurface", "VGUI_Surface031") - GAME_INTERFACE(Sound, sound, "engine", "IEngineSoundClient003") - GAME_INTERFACE(SoundEmitter, soundEmitter, "soundemittersystem", "VSoundEmitter003") - GAME_INTERFACE(StudioRender, studioRender, "studiorender", "VStudioRender026") - //GAME_INTERFACE(SteamMatchMaking, steamMatchMaking, "steam_api", "SteamMatchMaking009") + GAME_INTERFACE(Client, client, "client", "VClient018") + GAME_INTERFACE(Cvar, cvar, "vstdlib", "VEngineCvar007") + GAME_INTERFACE(Effects, effects, "engine", "VEngineEffects001") + GAME_INTERFACE(Engine, engine, "engine", "VEngineClient014") + GAME_INTERFACE(EngineTrace, engineTrace, "engine", "EngineTraceClient004") + GAME_INTERFACE(EntityList, entityList, "client", "VClientEntityList003") + //GAME_INTERFACE(FileSystem, fileSystem, "filesystem_stdio", "VFileSystem017") + GAME_INTERFACE(GameEventManager, gameEventManager, "engine", "GAMEEVENTSMANAGER002") + GAME_INTERFACE(GameMovement, gameMovement, "client", "GameMovement001") + GAME_INTERFACE(GameUI, gameUI, "client", "GameUI011") + GAME_INTERFACE(InputSystem, inputSystem, "inputsystem", "InputSystemVersion001") + GAME_INTERFACE(Localize, localize, "localize", "Localize_001") + GAME_INTERFACE(MaterialSystem, materialSystem, "materialsystem", "VMaterialSystem080") + GAME_INTERFACE(ModelInfo, modelInfo, "engine", "VModelInfoClient004") + GAME_INTERFACE(ModelRender, modelRender, "engine", "VEngineModel016") + GAME_INTERFACE(NetworkStringTableContainer, networkStringTableContainer, "engine", "VEngineClientStringTable001") + GAME_INTERFACE(Panel, panel, "vgui2", "VGUI_Panel009") + GAME_INTERFACE(PhysicsSurfaceProps, physicsSurfaceProps, "vphysics", "VPhysicsSurfaceProps001") + GAME_INTERFACE(Prediction, prediction, "client", "VClientPrediction001") + GAME_INTERFACE(RenderView, renderView, "engine", "VEngineRenderView014") + GAME_INTERFACE(Surface, surface, "vguimatsurface", "VGUI_Surface031") + GAME_INTERFACE(Sound, sound, "engine", "IEngineSoundClient003") + GAME_INTERFACE(SoundEmitter, soundEmitter, "soundemittersystem", "VSoundEmitter003") + GAME_INTERFACE(StudioRender, studioRender, "studiorender", "VStudioRender026") + //GAME_INTERFACE(SteamMatchMaking, steamMatchMaking, "steam_api", "SteamMatchMaking009") -#undef GAME_INTERFACE + #undef GAME_INTERFACE private: - static void* find(const wchar_t* moduleName, const char* name) noexcept - { - if (const auto createInterface = reinterpret_cast>(GetProcAddress(GetModuleHandleW(moduleName), "CreateInterface"))) - if (void* foundInterface = createInterface(name, nullptr)) - return foundInterface; + static void *find(const char *moduleName, const char *name) noexcept + { + if (const auto createInterface = reinterpret_cast>( + GetProcAddress(GetModuleHandleA(moduleName), "CreateInterface") + )) + { + if (void *foundInterface = createInterface(name, nullptr)) + return foundInterface; + } - MessageBoxA(nullptr, ("Failed to find " + std::string{ name } + " interface!").c_str(), "NEPS.PP", MB_OK | MB_ICONERROR); - std::exit(EXIT_FAILURE); - } + MessageBoxA(nullptr, ("Failed to find " + std::string{name} + " interface!").c_str(), "NEPS.PP", MB_OK | MB_ICONERROR); + std::exit(EXIT_FAILURE); + } }; inline std::unique_ptr interfaces;