diff options
| author | jz0 <[email protected]> | 2020-05-03 22:38:59 +0300 |
|---|---|---|
| committer | jz0 <[email protected]> | 2020-05-03 22:38:59 +0300 |
| commit | fdb81a898151278a66af544dfae6bfcbbf9dc3d2 (patch) | |
| tree | 8884fc5c21b3daf0a32cc145c4488b9e708deec4 | |
| download | source2-basehook-fdb81a898151278a66af544dfae6bfcbbf9dc3d2.tar.xz source2-basehook-fdb81a898151278a66af544dfae6bfcbbf9dc3d2.zip | |
Initial commit
36 files changed, 1870 insertions, 0 deletions
@@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 jz0 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..5f15573 --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +# Source2-Basehook +Internal base for Source2 games + +## Features +* CreateMove hook via ClientMode +* PaintTraverse hook + * Basic engine renderer +* Simple to use VMT hooking class +* Basic NetVar dumper +* Minimal Source SDK implementation diff --git a/source2-basehook/Base.cpp b/source2-basehook/Base.cpp new file mode 100644 index 0000000..2715d01 --- /dev/null +++ b/source2-basehook/Base.cpp @@ -0,0 +1,55 @@ +#include "Base.hpp" + +template< class Template > +Template* Base::GetInterface(const std::string ModuleName, const std::string InterfaceName) +{ + const auto Address = GetProcAddress(GetModuleHandleA(ModuleName.c_str()), "CreateInterface"); + const auto CreateInterface = reinterpret_cast<CreateInterfaceFn>(Address); + + Msg(Color(255, 0, 0, 255), "Module: %s : %s : 0x%x \n", ModuleName.c_str(), InterfaceName.c_str(), Address); + + return static_cast<Template*>(CreateInterface(InterfaceName.c_str(), nullptr)); +} + +void Base::InitInterfaces() +{ + pClient = GetInterface<CSource2Client>("client.dll", "Source2Client002"); + pEngine = GetInterface<CEngineClient>("engine2.dll", "Source2EngineToClient001"); + pPanel = GetInterface<IVPanel>("vgui2.dll", "VGUI_Panel010"); + pSurface = GetInterface<ISurface>("vguirendersurface.dll", "VGUI_Surface032"); + + //CSource2Client__SetGlobals + C2 028 48 8D 05 97 6A F5 FF lea rax, sub_40DC30; #STR: "gpGlocals->curtime() called while IsInSimulation() is fals, "gpGlocals->rendertime() called while IsInSimulation() is t, "-curtimewarnings" + //CSource2Client__SetGlobals + C9 028 F3 0F 11 05 A3 78 A5 00 movss dword ptr cs : qword_F0EA44, xmm0 + //CSource2Client__SetGlobals + D1 028 48 89 41 28 mov[rcx + 28h], rax + //CSource2Client__SetGlobals + D5 028 48 89 0D 64 24 8D 00 mov cs : gpGlobals, rcx //0xD89610 + pGlobals = *(CGlobalVarsBase**)Utilities::Dereference(Sig("client.dll", "48 89 0D ? ? ? ? 48 83 C4 28"), 3); + Msg(Color(255, 255, 255, 255), "pGlobals: %p \n", (void*)pGlobals); + + + //HudUpdate + B6 038 83 C9 FF or ecx, 0FFFFFFFFh + //HudUpdate + B9 038 E8 02 81 0B 00 call GetHud; #STR: "GetHud called with NULL g_pHudGameSystem!", "GetHud", "error", "c:\\buildslave\\hlvr_rel_win64\\build\\src\\game\\client\\ + //HudUpdate + BE 038 48 8B C8 mov rcx, rax + //HudUpdate + C1 038 E8 DA 28 0D 00 call UpdateHud; #STR: "screenshot" + //HudUpdate + C6 038 48 8B 0D 4B 51 A0 00 mov rcx, cs:ClientMode //0xEBC368 + pClientMode = *(IClientModeShared**)Utilities::Dereference(Sig("client.dll", "48 8B 0D ? ? ? ? 48 8B 01 FF 90 C0 01 00 00 85"), 3); + Msg(Color(255, 255, 255, 255), "ClientMode: %p \n", (void*)pClientMode); +} + +VMTHook* Panel = nullptr; +VMTHook* ClientMode = nullptr; +VMTHook* IsInGame = nullptr; + +void Base::InitHooks() +{ + Msg(Color(0, 0, 0, 255), "Initializing hooks \n"); + + Panel = new VMTHook(pPanel); + OriginalPaint = Panel->HookFunction<oPaintTraverse>(55, hkPaintTraverse); + + ClientMode = new VMTHook(pClientMode); + OriginalCreateMove = ClientMode->HookFunction<oCreateMove>(32, hkCreateMove); + OriginalLevelInit = ClientMode->HookFunction<oLevelInit>(33, hkLevelInit); + + Msg(Color(0, 0, 0, 255), "Hooks initialized \n"); +} + diff --git a/source2-basehook/Base.hpp b/source2-basehook/Base.hpp new file mode 100644 index 0000000..1190afd --- /dev/null +++ b/source2-basehook/Base.hpp @@ -0,0 +1,14 @@ +#pragma once +#include "Include.hpp" + +namespace Base +{ + typedef void* (*CreateInterfaceFn)(const char* pName, int* pReturnCode); + template<class Template> + Template* GetInterface(const std::string ModuleName, const std::string InterfaceName); + void InitInterfaces(); + void InitHooks(); +} + + + diff --git a/source2-basehook/Console.cpp b/source2-basehook/Console.cpp new file mode 100644 index 0000000..64b9518 --- /dev/null +++ b/source2-basehook/Console.cpp @@ -0,0 +1,3 @@ +#include "Console.hpp" +MsgFn Msg; + diff --git a/source2-basehook/Console.hpp b/source2-basehook/Console.hpp new file mode 100644 index 0000000..08c90f1 --- /dev/null +++ b/source2-basehook/Console.hpp @@ -0,0 +1,7 @@ +#pragma once +#include "Include.hpp" + +#include "Source2SDK/Color.hpp" + +typedef void(_cdecl* MsgFn)(const Color& color, const char* msg, ...); +extern MsgFn Msg;
\ No newline at end of file diff --git a/source2-basehook/DllMain.cpp b/source2-basehook/DllMain.cpp new file mode 100644 index 0000000..e631be9 --- /dev/null +++ b/source2-basehook/DllMain.cpp @@ -0,0 +1,30 @@ +/* + Source2 Basehook + by: j, https://github.com/jz0 + + Credits: + Valve + P47R!CK + Praydog +*/ + +#include "Include.hpp" + +void Initialize() +{ + Msg = (MsgFn)GetProcAddress(GetModuleHandleA("tier0.dll"), "?ConColorMsg@@YAXAEBVColor@@PEBDZZ"); + Msg(Color(255, 52, 25, 255), "Source2 Basehook\n"); + + Base::InitInterfaces(); + Base::InitHooks(); + //Utilities::DumpNetVars(); +} + +BOOL APIENTRY DllMain(void* Module, DWORD Reason, void* Reserved) +{ + if (Reason == DLL_PROCESS_ATTACH) + Initialize(); + + return TRUE; +} + diff --git a/source2-basehook/Hooks/CreateMove.cpp b/source2-basehook/Hooks/CreateMove.cpp new file mode 100644 index 0000000..e720466 --- /dev/null +++ b/source2-basehook/Hooks/CreateMove.cpp @@ -0,0 +1,15 @@ +#include "CreateMove.hpp" + +oCreateMove OriginalCreateMove; +bool __fastcall hkCreateMove(IClientModeShared* ptr, CUserCmd* cmd, QAngle& angle, Vector& pos) +{ + pCmd = cmd; + + if (!cmd->command_number) + return OriginalCreateMove(ptr, cmd, angle, pos); + + if (GetAsyncKeyState(VK_DELETE)) + cmd->viewangles.x += 1; + + return false; +}
\ No newline at end of file diff --git a/source2-basehook/Hooks/CreateMove.hpp b/source2-basehook/Hooks/CreateMove.hpp new file mode 100644 index 0000000..ae5c1be --- /dev/null +++ b/source2-basehook/Hooks/CreateMove.hpp @@ -0,0 +1,9 @@ +#pragma once +#include "../Include.hpp" +#include "../Source2SDK/IClientModeShared.hpp" +#include "../Source2SDK/CUserCmd.hpp" + +typedef bool(__fastcall* oCreateMove)(IClientModeShared*, CUserCmd*, QAngle&, Vector&); +extern oCreateMove OriginalCreateMove; + +bool __fastcall hkCreateMove(IClientModeShared* ptr, CUserCmd* Cmd, QAngle& Angle, Vector& Pos);
\ No newline at end of file diff --git a/source2-basehook/Hooks/LevelInit.cpp b/source2-basehook/Hooks/LevelInit.cpp new file mode 100644 index 0000000..e07b3b6 --- /dev/null +++ b/source2-basehook/Hooks/LevelInit.cpp @@ -0,0 +1,13 @@ +#include "LevelInit.hpp" + +oLevelInit OriginalLevelInit; +void __fastcall hkLevelInit(IClientModeShared* thisptr, const char* newmap) +{ + pGlobals = *(CGlobalVarsBase**)Utilities::Dereference(Sig("client.dll", "48 89 0D ? ? ? ? 48 83 C4 28"), 3); + Msg(Color(255, 0, 0, 255), "NewMap %s \n", newmap); + Msg(Color(255, 0, 0, 255), "pGlobals %p \n", pGlobals); + Msg(Color(255, 0, 0, 255), "pGlobals->MaxClients %i \n", pGlobals->maxclients); + + OriginalLevelInit(thisptr, newmap); +} + diff --git a/source2-basehook/Hooks/LevelInit.hpp b/source2-basehook/Hooks/LevelInit.hpp new file mode 100644 index 0000000..1682890 --- /dev/null +++ b/source2-basehook/Hooks/LevelInit.hpp @@ -0,0 +1,8 @@ +#pragma once +#include "../Include.hpp" +#include "../Source2SDK/CEngineClient.hpp" + +typedef void(__fastcall* oLevelInit)(IClientModeShared*, const char*); +extern oLevelInit OriginalLevelInit; + +void __fastcall hkLevelInit(IClientModeShared* thisptr, const char* newmap); diff --git a/source2-basehook/Hooks/PaintTraverse.cpp b/source2-basehook/Hooks/PaintTraverse.cpp new file mode 100644 index 0000000..62399e0 --- /dev/null +++ b/source2-basehook/Hooks/PaintTraverse.cpp @@ -0,0 +1,28 @@ +#include "PaintTraverse.hpp" + +oPaintTraverse OriginalPaint; +void __fastcall hkPaintTraverse(void* panel, IVGuiPaintSurface* surface, unsigned long long VGUIPanel, bool ForceRepaint, bool AllowForce) +{ + OriginalPaint(panel, surface, VGUIPanel, ForceRepaint, AllowForce); + + static unsigned long long RenderSystemTop; + if (RenderSystemTop == NULL) + { + const char* Name = pPanel->GetName(panel, VGUIPanel); + + //RenderSystemTopPanel + if (Name[0] == 'R' && Name[6] == 'S' && Name[12] == 'T') + { + Msg(Color(255, 255, 255, 255), "Panel: %s \n", Name); + RenderSystemTop = VGUIPanel; + } + } + + if (RenderSystemTop == VGUIPanel) + { + pRendererSurface = surface; + + EngineRenderer::DrawString(11, 550, 150, Color(255, 255, 255, 255), "Hello world!"); + EngineRenderer::DrawRect(150, 50, 50, 50, Color(255, 0, 0, 255)); + } +} diff --git a/source2-basehook/Hooks/PaintTraverse.hpp b/source2-basehook/Hooks/PaintTraverse.hpp new file mode 100644 index 0000000..5e0fe2a --- /dev/null +++ b/source2-basehook/Hooks/PaintTraverse.hpp @@ -0,0 +1,10 @@ +#pragma once +#include "../Include.hpp" +#include "../Source2SDK/ISurface.hpp" +#include "../Source2SDK/CEngineVGUI.hpp" + +typedef void(__fastcall* oPaintTraverse)(void*, IVGuiPaintSurface*, unsigned long long, bool, bool); +extern oPaintTraverse OriginalPaint; + +void __fastcall hkPaintTraverse(void* Panel, IVGuiPaintSurface* Surface, unsigned long long VGuiPanel, bool ForceRepaint, bool AllowForce); + diff --git a/source2-basehook/Include.hpp b/source2-basehook/Include.hpp new file mode 100644 index 0000000..7430b70 --- /dev/null +++ b/source2-basehook/Include.hpp @@ -0,0 +1,36 @@ +#pragma once +#define WIN32_LEAN_AND_MEAN + +#include <windows.h> +#include <string> +#include <memory> +#include <vector> +#include <cmath> + +//Macros +#define Packed +#pragma pack(push,1) + +#define Sig(Module, Signature)Utilities::FindPattern(Module, Signature) + +template<typename Fn> inline Fn CallVfunc(const PVOID Virtual, int Index) { return (Fn) * (*(const PVOID**)Virtual + Index); } + +//SDK +#include "Source2SDK/SDK.hpp" + +//Base +#include "Console.hpp" +#include "Utilities/VMTHook.hpp" +#include "Utilities/Utilities.hpp" +#include "Base.hpp" + +//Hooks +#include "Hooks/PaintTraverse.hpp" +#include "Hooks/CreateMove.hpp" +#include "Hooks/LevelInit.hpp" + +//Engine renderer +#include "Renderer/Renderer.hpp" + + + diff --git a/source2-basehook/Renderer/Renderer.cpp b/source2-basehook/Renderer/Renderer.cpp new file mode 100644 index 0000000..50610c7 --- /dev/null +++ b/source2-basehook/Renderer/Renderer.cpp @@ -0,0 +1,80 @@ +#include "Renderer.hpp" + +IVGuiPaintSurface* pRendererSurface = nullptr; + +void EngineRenderer::DrawRect(int x, int y, int w, int h, Color color) +{ + pRendererSurface->DrawSetColor(color.r, color.g, color.b, color.a); + pRendererSurface->DrawFilledRect(x, y, x + w, y + h); +} + +void EngineRenderer::DrawOutlinedRect(int x, int y, int w, int h, Color color) +{ + pRendererSurface->DrawSetColor(color.r, color.g, color.b, color.a); + pRendererSurface->DrawOutlinedRect(x, y, x + w, y + h); +} + +void EngineRenderer::DrawGradientRect(Vector2D pos, Vector2D size, Color top, Color bottom, bool horizontal) +{ + pRendererSurface->DrawSetColor(top.r, top.g, top.b, top.a); + pRendererSurface->DrawFilledRectFade(pos.x, pos.y, pos.x + size.x, pos.y + size.y, 255, 255, horizontal); + + pRendererSurface->DrawSetColor(bottom.r, bottom.g, bottom.b, bottom.a); + pRendererSurface->DrawFilledRectFade(pos.x, pos.y, pos.x + size.x, pos.y + size.y, 0, 255, horizontal); +} + +void EngineRenderer::DrawLine(int x0, int y0, int x1, int y1, Color color) +{ + pRendererSurface->DrawSetColor(color.r, color.g, color.b, color.a); + pRendererSurface->DrawLine(x0, y0, x1, y1); +} + +void EngineRenderer::DrawColoredCircle(int x, int y, float radius, Color color) +{ + //pRendererSurface->DrawSetColor(color.r, color.g, color.b, color.a); + //pRendererSurface->DrawOutlinedCircle(250, 250, 50, 8); + //pRendererSurface->DrawColoredCircle(x, y, radius, color.r, color.g, color.b, color.a); + pRendererSurface->DrawColoredCircle(x, y, radius, color.r, color.g, color.b, color.a); +} + +void EngineRenderer::DrawTexturedPolygon(int n, Vertex_t* vertice, Color color) +{ + static int TextureID = pRendererSurface->CreateNewTextureID(true); + static unsigned char Buf[4] = { 255, 255, 255, 255 }; + pRendererSurface->DrawSetTextureRGBA(TextureID, Buf, 1, 1); + pRendererSurface->DrawSetColor(color.r, color.g, color.b, color.a); + pRendererSurface->DrawSetTexture(TextureID); + pRendererSurface->DrawTexturedPolygon(n, vertice); +} + +void EngineRenderer::DrawFilledCircle(Vector2D position, float smoothness, float radius, Color color) +{ + std::vector<Vertex_t> vertices; + float step = (float)M_PI * 2.0f / smoothness; + + for (float a = 0; a < (M_PI * 2.0f); a += step) + vertices.push_back(Vertex_t(Vector2D(radius * cosf(a) + position.x, radius * sinf(a) + position.y))); + + DrawTexturedPolygon((int)smoothness, vertices.data(), color); +} + +void EngineRenderer::DrawString(unsigned long font, int x, int y, Color color, const char* str, ...) +{ + if (!str) + return; + + va_list arg; + char buffer[1024]; + wchar_t wstring[1024]; + + va_start(arg, str); + _vsnprintf_s(buffer, sizeof(buffer), str, arg); + va_end(arg); + + MultiByteToWideChar(CP_UTF8, 0, buffer, 256, wstring, 256); + + pRendererSurface->DrawSetTextPos(x, y); + pRendererSurface->DrawSetTextFont(font); + pRendererSurface->DrawSetTextColor(color.r, color.g, color.b, color.a); + pRendererSurface->DrawPrintText(wstring, wcslen(wstring)); +}
\ No newline at end of file diff --git a/source2-basehook/Renderer/Renderer.hpp b/source2-basehook/Renderer/Renderer.hpp new file mode 100644 index 0000000..9d65fd2 --- /dev/null +++ b/source2-basehook/Renderer/Renderer.hpp @@ -0,0 +1,17 @@ +#pragma once +#include "../Source2SDK/SDK.hpp" +#include "../Include.hpp" + +namespace EngineRenderer +{ + void DrawRect(int x, int y, int w, int h, Color color); + void DrawOutlinedRect(int x, int y, int w, int h, Color color); + void DrawGradientRect(Vector2D Position, Vector2D Size, Color Top, Color Bottom, bool Horizontal); + void DrawLine(int x0, int y0, int x1, int y1, Color color); + void DrawColoredCircle(int x, int y, float radius, Color color); + void DrawTexturedPolygon(int n, Vertex_t* vertice, Color color); + void DrawFilledCircle(Vector2D position, float smoothness, float radius, Color color); + void DrawString(unsigned long font, int x, int y, Color color, const char* str, ...); +} + +extern IVGuiPaintSurface* pRendererSurface;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/CEngineClient.hpp b/source2-basehook/Source2SDK/CEngineClient.hpp new file mode 100644 index 0000000..de556e9 --- /dev/null +++ b/source2-basehook/Source2SDK/CEngineClient.hpp @@ -0,0 +1,54 @@ +#pragma once + +class CEngineClient +{ +public: + virtual void Unknown1() = 0; + virtual void Unknown2() = 0; + virtual void Unknown3() = 0; + virtual void Unknown4() = 0; + virtual void Unknown5() = 0; + virtual void Unknown6() = 0; + virtual void Unknown7() = 0; + virtual void Unknown8() = 0; + virtual void Unknown9() = 0; + virtual void Unknown10() = 0; + virtual void Unknown11() = 0; + virtual void Unknown12() = 0; + virtual void Unknown13() = 0; + virtual void Unknown14() = 0; + virtual void Unknown15() = 0; + virtual void Unknown16() = 0; + virtual void Unknown17() = 0; + virtual void Unknown18() = 0; + virtual void Unknown19() = 0; + virtual void Unknown20(); + virtual void Unknown21() = 0; + virtual int GetLocalPlayer(int) = 0; + virtual void Unknown23() = 0; + virtual void Unknown24() = 0; + virtual void Unknown25() = 0; + virtual void Unknown26() = 0; + virtual int GetMaxClients(void) = 0; + virtual bool IsInGame(void) = 0; + virtual bool IsConnected(void) = 0; + virtual void Unknown31() = 0; + virtual void Unknown32() = 0; + virtual void Unknown33() = 0; + virtual void Unknown34() = 0; + virtual void Unknown35() = 0; + virtual void Unknown36() = 0; + virtual void Unknown37() = 0; + virtual void ClientCmd_Unrestricted(const char* szCmdString) = 0; + virtual void Unknown39() = 0; + + int GetLocalPlayer() + { + int Out = 0; + using oFn = int* (__thiscall*)(CEngineClient*, int&, int); + (CallVfunc<oFn>(this, 22))(this, Out, 0); + return Out; + } +}; + +extern CEngineClient* pEngine;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/CEngineVGUI.hpp b/source2-basehook/Source2SDK/CEngineVGUI.hpp new file mode 100644 index 0000000..937ae24 --- /dev/null +++ b/source2-basehook/Source2SDK/CEngineVGUI.hpp @@ -0,0 +1,13 @@ +#pragma once + +class IVPanel +{ +public: + const char* GetName(void* ptr, unsigned long long vguiPanel) + { + typedef const char* (__thiscall* OriginalFn)(void*, unsigned long long); + return CallVfunc<OriginalFn>(ptr, 50)(ptr, vguiPanel); + } +}; + +extern IVPanel* pPanel;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/CGlobalVarsBase.hpp b/source2-basehook/Source2SDK/CGlobalVarsBase.hpp new file mode 100644 index 0000000..ebdd799 --- /dev/null +++ b/source2-basehook/Source2SDK/CGlobalVarsBase.hpp @@ -0,0 +1,18 @@ +#pragma once + +class CGlobalVarsBase +{ +public: + float realtime; //0x0000 + int32_t framecount; //0x0004 + float absoluteframetime; //0x0008 + float curtime; //0x000C + float frameTime; //0x0010 + int32_t maxclients; //0x0014 + int32_t tickcount; //0x0018 + float interval_per_tick; //0x001C + float frametime2; //0x0020 + float interpolation_amount; //0x0024 +}; + +extern CGlobalVarsBase* pGlobals;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/CSource2Client.hpp b/source2-basehook/Source2SDK/CSource2Client.hpp new file mode 100644 index 0000000..e26764b --- /dev/null +++ b/source2-basehook/Source2SDK/CSource2Client.hpp @@ -0,0 +1,41 @@ +#pragma once +#include "ClientClass.hpp" + +class CSource2Client +{ +public: + virtual void Unknown1() = 0; + virtual void Disconnect(void) = 0; + virtual void Unknown3() = 0; + virtual void Unknown4() = 0; + virtual void Shutdown(void) = 0; + virtual void Unknown6() = 0; + virtual void Unknown7() = 0; + virtual void Unknown8() = 0; + virtual void Unknown9() = 0; + virtual void Unknown10() = 0; + virtual void Unknown11() = 0; + virtual void SetGlobals(void* CGlobalVarsBase) = 0; + virtual void Unknown13() = 0; + virtual void Unknown14() = 0; + virtual void Unknown15() = 0; + virtual void Unknown16() = 0; + virtual void Unknown17() = 0; + virtual void Unknown18() = 0; + virtual void Unknown19() = 0; + virtual void Unknown20() = 0; + virtual void Unknown21() = 0; + virtual void Unknown22() = 0; + virtual void Unknown23() = 0; + virtual void Unknown24() = 0; + virtual void Unknown25() = 0; + virtual void Unknown26() = 0; + virtual void Unknown27() = 0; + virtual ClientClass* GetAllClasses(void) = 0; + virtual void Unknown28() = 0; + virtual void Unknown29() = 0; + virtual void Unknown30() = 0; + virtual void HudUpdate(bool bActive) = 0; +}; + +extern CSource2Client* pClient;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/CUserCmd.hpp b/source2-basehook/Source2SDK/CUserCmd.hpp new file mode 100644 index 0000000..7c829dc --- /dev/null +++ b/source2-basehook/Source2SDK/CUserCmd.hpp @@ -0,0 +1,50 @@ +#pragma once +#include "Vector.hpp" +#include "QAngle.hpp" + +#define IN_ATTACK (1 << 0) +#define IN_JUMP (1 << 1) +#define IN_DUCK (1 << 2) +#define IN_FORWARD (1 << 3) +#define IN_BACK (1 << 4) +#define IN_USE (1 << 5) +#define IN_CANCEL (1 << 6) +#define IN_LEFT (1 << 7) +#define IN_RIGHT (1 << 8) +#define IN_MOVELEFT (1 << 9) +#define IN_MOVERIGHT (1 << 10) +#define IN_ATTACK2 (1 << 11) +#define IN_RUN (1 << 12) +#define IN_RELOAD (1 << 13) +#define IN_ALT1 (1 << 14) +#define IN_ALT2 (1 << 15) +#define IN_SCORE (1 << 16) // Used by client.dll for when scoreboard is held down +#define IN_SPEED (1 << 17) // Player is holding the speed key +#define IN_WALK (1 << 18) // Player holding walk key +#define IN_ZOOM (1 << 19) // Zoom key for HUD zoom +#define IN_WEAPON1 (1 << 20) // weapon defines these bits +#define IN_WEAPON2 (1 << 21) // weapon defines these bits +#define IN_BULLRUSH (1 << 22) +#define IN_GRENADE1 (1 << 23) // grenade 1 +#define IN_GRENADE2 (1 << 24) // grenade 2 +#define IN_ATTACK3 (1 << 25) + +class CUserCmd +{ +public: + virtual ~CUserCmd() {}; + int32_t command_number; //0x0008 + int32_t tick_count; //0x000C + QAngle viewangles; //0x0010 + Vector aimdirection; //0x001C + int32_t buttons; //0x0028 + int32_t unknown; + BYTE impulse; + int32_t weaponselect; //0x0034 + int32_t weaponsubtype; //0x0038 + int32_t random_seed; //0x003C + short mousedx; + short mousedy; +}; + +extern CUserCmd* pCmd;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/ClientClass.hpp b/source2-basehook/Source2SDK/ClientClass.hpp new file mode 100644 index 0000000..cf6806c --- /dev/null +++ b/source2-basehook/Source2SDK/ClientClass.hpp @@ -0,0 +1,21 @@ +#pragma once +#include "Schema.hpp" +//Greets to Praydog + +class ClientClass +{ +public: + char* m_pNetworkName; //0x0000 + char* m_pClassName; //0x0008 + ClientClass* m_pNext; //0x0010 + void* m_pCreateFn; //0x0018 + void* m_pCreateEventFn; //0x0020 + void* m_pDestroyFn; //0x0028 + char pad_0030[8]; //0x0030 + char* m_pLibNameAndClassName; //0x0038 + SchemaRecvTable* RecvTable; //0x0040 + char pad_0048[20]; //0x0048 + int m_ClassID; //0x005C + void* N00000046; //0x0060 + void* N00000047; //0x0068 +};
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/Color.hpp b/source2-basehook/Source2SDK/Color.hpp new file mode 100644 index 0000000..d2513a7 --- /dev/null +++ b/source2-basehook/Source2SDK/Color.hpp @@ -0,0 +1,20 @@ +#pragma once + +class Color +{ +public: + Color(); + Color(BYTE r, BYTE g, BYTE b, BYTE a = 255) + { + this->r = r, + this->g = g, + this->b = b, + this->a = a; + } + BYTE r, g, b, a; + + BYTE& operator[](int i) + { + return *(BYTE*)((int)this + i); + } +}; diff --git a/source2-basehook/Source2SDK/IClientModeShared.hpp b/source2-basehook/Source2SDK/IClientModeShared.hpp new file mode 100644 index 0000000..f7dbca4 --- /dev/null +++ b/source2-basehook/Source2SDK/IClientModeShared.hpp @@ -0,0 +1,9 @@ +#pragma once + +class IClientModeShared +{ +public: + +}; + +extern IClientModeShared* pClientMode;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/ISurface.hpp b/source2-basehook/Source2SDK/ISurface.hpp new file mode 100644 index 0000000..2ad781b --- /dev/null +++ b/source2-basehook/Source2SDK/ISurface.hpp @@ -0,0 +1,171 @@ +#pragma once + +enum FontFlags_t +{ + FONTFLAG_NONE, + FONTFLAG_ITALIC = 0x001, + FONTFLAG_UNDERLINE = 0x002, + FONTFLAG_STRIKEOUT = 0x004, + FONTFLAG_SYMBOL = 0x008, + FONTFLAG_ANTIALIAS = 0x010, + FONTFLAG_GAUSSIANBLUR = 0x020, + FONTFLAG_ROTARY = 0x040, + FONTFLAG_DROPSHADOW = 0x080, + FONTFLAG_ADDITIVE = 0x100, + FONTFLAG_OUTLINE = 0x200, + FONTFLAG_CUSTOM = 0x400, + FONTFLAG_BITMAP = 0x800, +}; + +struct Vector2D +{ + Vector2D() {} + Vector2D(float x, float y) { this->x = x; this->y = y; } + float x; + float y; +}; + +struct Vertex_t +{ + Vertex_t() {} + Vertex_t(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0)) + { + m_Position = pos; + m_TexCoord = coord; + } + + void Init(const Vector2D& pos, const Vector2D& coord = Vector2D(0, 0)) + { + m_Position = pos; + m_TexCoord = coord; + } + + Vector2D m_Position; + Vector2D m_TexCoord; +}; + +class ISurface +{ +public: + unsigned long CreateFonts(void) + { + using OriginalFn = unsigned long(__thiscall*)(void*); + return CallVfunc< OriginalFn >(this, 51)(this); + } + + void SetFontGlyphSet(unsigned long& font, const char* WindowsFontName, int tall, int weight, int blur, int scanlines, int flags) + { + using OriginalFn = void(__thiscall*)(void*, unsigned long, const char*, int, int, int, int, int, int, int); + CallVfunc<OriginalFn>(this, 58)(this, font, WindowsFontName, tall, weight, blur, scanlines, flags, 0, 0); + } + + void GetTextSize(unsigned long font, const wchar_t* text, int& width, int& tall) + { + using OriginalFn = bool(__thiscall*)(void*, unsigned long, const wchar_t*, int&, int&); + CallVfunc<OriginalFn>(this, 66)(this, font, text, width, tall); + } +}; + +extern ISurface* pSurface; + +class IVGuiPaintSurface +{ +public: + void DrawColoredCircle(int centerx, int centery, float radius, int r, int g, int b, int a) + { + typedef void(__thiscall* OriginalFn)(void*, int, int, int, int, int, int, int); + CallVfunc< OriginalFn >(this, 7)(this, centerx, centery, radius, r, g, b, a); + } + + void DrawFilledRectFade(int x0, int y0, int x1, int y1, size_t alpha0, size_t alpha1, bool horizontal) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int, size_t, size_t, bool); + CallVfunc<OriginalFn>(this, 9)(this, x0, y0, x1, y1, alpha0, alpha1, horizontal); + } + + void DrawOutlinedCircle(int x, int y, int radius, int segments) + { + typedef void(__thiscall* OriginalFn)(void*, int, int, int, int); + CallVfunc< OriginalFn >(this, 10)(this, x, y, radius, segments); + } + + void DrawSetTextFont(unsigned long font) + { + using OriginalFn = void(__thiscall*)(void*, unsigned long); + CallVfunc< OriginalFn >(this, 13)(this, font); + } + + void DrawSetColor(int r, int g, int b, int a) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int); + CallVfunc<OriginalFn>(this, 17)(this, r, g, b, a); + } + + void DrawFilledRect(int x0, int y0, int x1, int y1) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int); + CallVfunc< OriginalFn >(this, 19)(this, x0, y0, x1, y1); + } + + void DrawOutlinedRect(int x0, int y0, int x1, int y1) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int); + CallVfunc< OriginalFn >(this, 21)(this, x0, y0, x1, y1); + } + + void DrawLine(int x0, int y0, int x1, int y1) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int); + CallVfunc< OriginalFn >(this, 22)(this, x0, y0, x1, y1); + } + + void DrawSetTextColor(int r, int g, int b, int a) + { + using OriginalFn = void(__thiscall*)(void*, int, int, int, int); + CallVfunc< OriginalFn >(this, 25)(this, r, g, b, a); + } + + void DrawSetTextPos(int x, int y) + { + using OriginalFn = void(__thiscall*)(void*, int, int); + CallVfunc< OriginalFn >(this, 26)(this, x, y); + } + + void DrawPrintText(const wchar_t* text, int textLen) + { + using OriginalFn = void(__thiscall*)(void*, const wchar_t*, int); + CallVfunc< OriginalFn >(this, 27)(this, text, textLen); + } + + void DrawSetTexture(int id) + { + typedef void(__thiscall* OriginalFn)(void*, int); + CallVfunc< OriginalFn >(this, 33)(this, id); + } + + void DrawTexturedPolygon(int Count, Vertex_t* Vertices, bool bClipVertices = false) + { + typedef void(__thiscall* OriginalFn)(void*, int, Vertex_t*, bool); + return CallVfunc< OriginalFn >(this, 38)(this, Count, Vertices, bClipVertices); + } + + void GetTextSize(unsigned long font, const wchar_t* text, int& width, int& tall) + { + using OriginalFn = bool(__thiscall*)(void*, unsigned long, const wchar_t*, int&, int&); + CallVfunc< OriginalFn >(this, 57)(this, font, text, width, tall); + } + + int CreateNewTextureID(bool procedural = false) + { + typedef int(__thiscall* OriginalFn)(void*, bool); + return CallVfunc< OriginalFn >(this, 60)(this, procedural); + } + + void DrawSetTextureRGBA(int id, const unsigned char* rgba, int wide, int tall, int hw = 0, bool fr = true) + { + using OriginalFn = void(__thiscall*)(void*, int, const unsigned char*, int, int, int, bool); + CallVfunc< OriginalFn >(this, 64)(this, id, rgba, wide, tall, hw, fr); + } +}; + +extern IVGuiPaintSurface* pPaintSurface;
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/QAngle.hpp b/source2-basehook/Source2SDK/QAngle.hpp new file mode 100644 index 0000000..a00e7bc --- /dev/null +++ b/source2-basehook/Source2SDK/QAngle.hpp @@ -0,0 +1,338 @@ +#pragma once + +class QAngle +{ +public: + float x, y, z; + + QAngle(void); + QAngle(float X, float Y, float Z); + QAngle(Vector A); + + void Init(float ix = 0.0f, float iy = 0.0f, float iz = 0.0f); + void Random(float minVal, float maxVal); + + bool IsValid() const; + void Invalidate(); + + bool IsZero() + { + CHECK_VALID(*this); + if (this->x == 0.f && this->y == 0.f && this->z == 0.f) + return true; + + return false; + } + + float operator[](int i) const; + float& operator[](int i); + + float* Base(); + float const* Base() const; + + bool operator==(const QAngle& v) const; + bool operator!=(const QAngle& v) const; + + QAngle& operator+=(const QAngle& v); + QAngle& operator-=(const QAngle& v); + QAngle& operator*=(float s); + QAngle& operator/=(float s); + + float Length() const; + float LengthSqr() const; + + QAngle& operator=(const QAngle& src); + + QAngle operator-(void) const; + + QAngle operator+(const QAngle& v) const; + QAngle operator-(const QAngle& v) const; + QAngle operator*(float fl) const; + QAngle operator/(float fl) const; + + QAngle Clamp(); + QAngle NormalizeNoClamp(); + QAngle Mod(float N); + + inline QAngle Normalize(); +}; + +//----------------------------------------------------------------------------- +// constructors +//----------------------------------------------------------------------------- +inline QAngle::QAngle(void) +{ +#ifdef _DEBUG +#ifdef VECTOR_PARANOIA + // Initialize to NAN to catch errors + x = y = z = float_NAN; +#endif +#endif +} + +inline QAngle::QAngle(float X, float Y, float Z) +{ + x = X; y = Y; z = Z; + CHECK_VALID(*this); +} + +inline QAngle::QAngle(Vector A) +{ + x = A.x; + y = A.y; + z = A.z; +} + +//----------------------------------------------------------------------------- +// initialization +//----------------------------------------------------------------------------- +inline void QAngle::Init(float ix, float iy, float iz) +{ + x = ix; y = iy; z = iz; + CHECK_VALID(*this); +} + +inline void QAngle::Random(float minVal, float maxVal) +{ + x = minVal + ((float)rand() / RAND_MAX) * (maxVal - minVal); + y = minVal + ((float)rand() / RAND_MAX) * (maxVal - minVal); + z = minVal + ((float)rand() / RAND_MAX) * (maxVal - minVal); + CHECK_VALID(*this); +} + +//----------------------------------------------------------------------------- +// IsValid? +//----------------------------------------------------------------------------- + +inline bool QAngle::IsValid() const +{ + return std::isfinite(x) && std::isfinite(y) && std::isfinite(z); +} + +//----------------------------------------------------------------------------- +// Invalidate +//----------------------------------------------------------------------------- + +inline void QAngle::Invalidate() +{ + //#ifdef _DEBUG + //#ifdef VECTOR_PARANOIA + x = y = z = std::numeric_limits<float>::infinity(); + //#endif + //#endif +} + +//----------------------------------------------------------------------------- +// assignment +//----------------------------------------------------------------------------- +inline QAngle& QAngle::operator=(const QAngle& vOther) +{ + CHECK_VALID(vOther); + x = vOther.x; y = vOther.y; z = vOther.z; + return *this; +} + +//----------------------------------------------------------------------------- +// comparison +//----------------------------------------------------------------------------- +inline bool QAngle::operator==(const QAngle& src) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x == x) && (src.y == y) && (src.z == z); +} + +inline bool QAngle::operator!=(const QAngle& src) const +{ + CHECK_VALID(src); + CHECK_VALID(*this); + return (src.x != x) || (src.y != y) || (src.z != z); +} + +//----------------------------------------------------------------------------- +// standard math operations +//----------------------------------------------------------------------------- +inline QAngle& QAngle::operator+=(const QAngle& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x += v.x; y += v.y; z += v.z; + return *this; +} + +inline QAngle& QAngle::operator-=(const QAngle& v) +{ + CHECK_VALID(*this); + CHECK_VALID(v); + x -= v.x; y -= v.y; z -= v.z; + return *this; +} + +inline QAngle& QAngle::operator*=(float fl) +{ + x *= fl; + y *= fl; + z *= fl; + CHECK_VALID(*this); + return *this; +} + +inline QAngle& QAngle::operator/=(float fl) +{ + Assert(fl != 0.0f); + float oofl = 1.0f / fl; + x *= oofl; + y *= oofl; + z *= oofl; + CHECK_VALID(*this); + return *this; +} + +//----------------------------------------------------------------------------- +// Base address... +//----------------------------------------------------------------------------- +inline float* QAngle::Base() +{ + return (float*)this; +} + +inline float const* QAngle::Base() const +{ + return (float const*)this; +} + +//----------------------------------------------------------------------------- +// Array access +//----------------------------------------------------------------------------- +inline float& QAngle::operator[](int i) +{ + Assert((i >= 0) && (i < 3)); + return ((float*)this)[i]; +} + +inline float QAngle::operator[](int i) const +{ + Assert((i >= 0) && (i < 3)); + return ((float*)this)[i]; +} + +//----------------------------------------------------------------------------- +// length +//----------------------------------------------------------------------------- +inline float QAngle::Length() const +{ + CHECK_VALID(*this); + return (float)sqrt(LengthSqr()); +} + + +inline float QAngle::LengthSqr() const +{ + CHECK_VALID(*this); + return x * x + y * y; +} + +inline QAngle QAngle::operator-(void) const +{ + return QAngle(-x, -y, -z); +} + +inline QAngle QAngle::operator+(const QAngle& v) const +{ + QAngle res; + res.x = x + v.x; + res.y = y + v.y; + res.z = z + v.z; + return res; +} + +inline QAngle QAngle::operator-(const QAngle& v) const +{ + QAngle res; + res.x = x - v.x; + res.y = y - v.y; + res.z = z - v.z; + return res; +} + +inline QAngle QAngle::operator*(float fl) const +{ + QAngle res; + res.x = x * fl; + res.y = y * fl; + res.z = z * fl; + return res; +} + +inline QAngle QAngle::operator/(float fl) const +{ + QAngle res; + res.x = x / fl; + res.y = y / fl; + res.z = z / fl; + return res; +} + +inline QAngle QAngle::Clamp() +{ + CHECK_VALID(*this); + + if (this->x < -89.0f) + this->x = -89.0f; + + if (this->x > 89.0f) + this->x = 89.0f; + + while (this->y < -180.0f) + this->y += 360.0f; + + while (this->y > 180.0f) + this->y -= 360.0f; + + this->z = 0.0f; + + return *this; +} + +inline QAngle QAngle::NormalizeNoClamp() +{ + CHECK_VALID(*this); + + this->x -= floorf(this->x / 360.0f + 0.5f) * 360.0f; + + this->y -= floorf(this->y / 360.0f + 0.5f) * 360.0f; + + this->z -= floorf(this->z / 360.0f + 0.5f) * 360.0f; + + return *this; +} + +inline QAngle QAngle::Mod(float N) +{ + CHECK_VALID(*this); + this->x = fmod(x, N); + this->y = fmod(y, N); + this->z = fmod(z, N); + + return *this; +} + +inline QAngle QAngle::Normalize() +{ + CHECK_VALID(*this); + + QAngle vector; + float length = this->Length(); + + if (length != 0) + { + vector.x = x / length; + vector.y = y / length; + vector.z = z / length; + } + else + vector.x = vector.y = 0.0f; vector.z = 1.0f; + + return vector; +} + diff --git a/source2-basehook/Source2SDK/SDK.cpp b/source2-basehook/Source2SDK/SDK.cpp new file mode 100644 index 0000000..f5b54c9 --- /dev/null +++ b/source2-basehook/Source2SDK/SDK.cpp @@ -0,0 +1,10 @@ +#include "SDK.hpp" + +CSource2Client* pClient = nullptr; +IClientModeShared* pClientMode = nullptr; +CEngineClient* pEngine = nullptr; +CGlobalVarsBase* pGlobals = nullptr; +IVPanel* pPanel = nullptr; +ISurface* pSurface = nullptr; +IVGuiPaintSurface* pPaintSurface = nullptr; +CUserCmd* pCmd = nullptr; diff --git a/source2-basehook/Source2SDK/SDK.hpp b/source2-basehook/Source2SDK/SDK.hpp new file mode 100644 index 0000000..95a2889 --- /dev/null +++ b/source2-basehook/Source2SDK/SDK.hpp @@ -0,0 +1,17 @@ +#pragma once +#include "../Include.hpp" +#include "Color.hpp" +#include "Vector.hpp" +#include "QAngle.hpp" +#include "CSource2Client.hpp" +#include "IClientModeShared.hpp" +#include "CEngineClient.hpp" +#include "CEngineVGUI.hpp" +#include "CGlobalVarsBase.hpp" +#include "ClientClass.hpp" +#include "ISurface.hpp" +#include "CUserCmd.hpp" +#include "Schema.hpp" + + + diff --git a/source2-basehook/Source2SDK/Schema.hpp b/source2-basehook/Source2SDK/Schema.hpp new file mode 100644 index 0000000..3e74be6 --- /dev/null +++ b/source2-basehook/Source2SDK/Schema.hpp @@ -0,0 +1,27 @@ +#pragma once + +struct Netvar +{ + const char* NetvarName; + void* _pad[2]; + uint32_t Offset; + uint32_t something; + void* _pad2[10]; + const char* TypeName; + void* _pad3[5]; +}; + +struct NetvarWrapper +{ + Netvar* Netvar; + char pad[7]; +}Packed; + +struct SchemaRecvTable +{ + const char* varName; + void* _pad; + int32_t NumOfNetvars; + int32_t unknown; + NetvarWrapper* NetvarsArray; +};
\ No newline at end of file diff --git a/source2-basehook/Source2SDK/Vector.hpp b/source2-basehook/Source2SDK/Vector.hpp new file mode 100644 index 0000000..791e082 --- /dev/null +++ b/source2-basehook/Source2SDK/Vector.hpp @@ -0,0 +1,252 @@ +#pragma once +#define CHECK_VALID( _v ) 0 +#define Assert( _exp ) ((void)0) +#define M_PI 3.14159265358979323846f +#define M_RADPI 57.295779513082f +#define M_PI_F ((float)(M_PI)) +#define RAD2DEG( x ) ( (float)(x) * (float)(180.f / M_PI_F) ) +#define DEG2RAD( x ) ( (float)(x) * (float)(M_PI_F / 180.f) ) + +class Vector +{ +public: + + float x, y, z; + + Vector(void); + Vector(float x, float y, float z); + + float& operator[](int) const; + Vector& operator=(const Vector&); + + Vector& operator+=(const Vector&); + Vector& operator-=(const Vector&); + Vector& operator*=(const Vector&); + Vector& operator*=(const float&); + Vector& operator/=(const Vector&); + Vector& operator/=(const float&); + + Vector operator+(const Vector&) const; + Vector operator-(const Vector&) const; + Vector operator*(const Vector&) const; + Vector operator*(const float&) const; + Vector operator/(const Vector&) const; + Vector operator/(const float&) const; + + bool operator==(const Vector&) const; + bool operator!=(const Vector&) const; + + float DistTo(const Vector&) const; + + float Length() const; + float LengthSqr() const; + float Length2D() const; + float Length2DSqr() const; + + Vector Cross(const Vector&) const; + float Dot(const Vector&) const; + + float Normalize(); + void Init(float, float, float); + void Zero(); + bool IsZero(float); + + //new + void VectorClear(Vector&); + void VectorCopy(const Vector&, Vector&); +}; + +inline Vector::Vector() +{ + x = y = z = 0.f; +} + +inline void Vector::Zero() +{ + x = y = z = 0.0f; +} + +inline Vector::Vector(float _x, float _y, float _z) +{ + x = _x; + y = _y; + z = _z; +} + +inline float& Vector::operator[](int i) const +{ + return ((float*)this)[i]; +} + +inline Vector& Vector::operator=(const Vector& v) +{ + x = v.x; + y = v.y; + z = v.z; + + return *this; +} + +inline Vector& Vector::operator+=(const Vector& v) +{ + x += v.x; + y += v.y; + z += v.z; + + return *this; +} + +inline Vector& Vector::operator-=(const Vector& v) +{ + x -= v.x; + y -= v.y; + z -= v.z; + + return *this; +} + +inline Vector& Vector::operator*=(const Vector& v) +{ + x *= v.x; + y *= v.y; + z *= v.z; + + return *this; +} + +inline Vector& Vector::operator*=(const float& f) +{ + x *= f; + y *= f; + z *= f; + + return *this; +} + +inline Vector& Vector::operator/=(const Vector& v) +{ + x /= v.x; + y /= v.y; + z /= v.z; + + return *this; +} + +inline Vector& Vector::operator/=(const float& f) +{ + x /= f; + y /= f; + z /= f; + + return *this; +} + +inline Vector Vector::operator+(const Vector& v) const +{ + return Vector(x + v.x, y + v.y, z + v.z); +} + +inline Vector Vector::operator-(const Vector& v) const +{ + return Vector(x - v.x, y - v.y, z - v.z); +} + +inline Vector Vector::operator*(const Vector& v) const +{ + return Vector(x * v.x, y * v.y, z * v.z); +} + +inline Vector Vector::operator*(const float& f) const +{ + return Vector(x * f, y * f, z * f); +} + +inline Vector Vector::operator/(const Vector& v) const +{ + return Vector(x / (v.x), y / (v.y), z / (v.z)); +} + +inline Vector Vector::operator/(const float& f) const +{ + return Vector(x / (f), y / (f), z / (f)); +} + +inline bool Vector::operator==(const Vector& v) const +{ + return v.x == x && v.y == y && v.z == z; +} + +inline bool Vector::operator!=(const Vector& e) const +{ + return e.x != x || e.y != y || e.z != z; +} + +inline float Vector::DistTo(const Vector& v) const +{ + return (*this - v).Length(); +} + +inline float Vector::Length() const +{ + return sqrtf((x * x) + (y * y) + (z * z)); +} + +inline float Vector::LengthSqr() const +{ + return (x * x) + (y * y) + (z * z); +} + +inline float Vector::Length2D() const +{ + return sqrtf((x * x) + (y * y)); +} + +inline float Vector::Length2DSqr() const +{ + return (x * x) + (y * y); +} + +inline Vector Vector::Cross(const Vector& e) const +{ + return Vector((y * e.z) - (z * e.y), (z * e.x) - (x * e.z), (x * e.y) - (y * e.x)); +} + +inline float Vector::Dot(const Vector& e) const +{ + return (x * e.x) + (y * e.y) + (z * e.z); +} + +inline float Vector::Normalize() +{ + float l = Length(); + float m = 1.f / (l); + + *this *= m; + + return l; +} + +inline void Vector::Init(float ix = 0.0f, float iy = 0.0f, float iz = 0.0f) +{ + x = ix; y = iy; z = iz; +} + +inline void Vector::VectorClear(Vector& a) +{ + a.x = a.y = a.z = 0.0f; +} + +inline bool Vector::IsZero(float tolerance = 0.01f) +{ + return (x > -tolerance && x < tolerance && + y > -tolerance && y < tolerance && + z > -tolerance && z < tolerance); +} + +__forceinline void Vector::VectorCopy(const Vector& src, Vector& dst) +{ + dst.x = src.x; + dst.y = src.y; + dst.z = src.z; +} + diff --git a/source2-basehook/Utilities/Utilities.cpp b/source2-basehook/Utilities/Utilities.cpp new file mode 100644 index 0000000..ea64909 --- /dev/null +++ b/source2-basehook/Utilities/Utilities.cpp @@ -0,0 +1,74 @@ +#include "Utilities.hpp" + +uintptr_t Utilities::FindPattern(const char* Module, const char* Sig) +{ +#define IN_RANGE(x, a, b) (x >= a && x <= b) +#define GET_BITS(x) (IN_RANGE((x & (~0x20)), 'A', 'F') ? ((x & (~0x20)) - 'A' + 0xA): (IN_RANGE(x, '0', '9') ? x - '0': 0)) +#define GET_BYTE(x) (GET_BITS(x[0]) << 4 | GET_BITS(x[1])) + + const auto ModuleHandle = GetModuleHandleA(Module); + const auto DOSHeader = PIMAGE_DOS_HEADER(ModuleHandle); + const auto NTHeaders = PIMAGE_NT_HEADERS(reinterpret_cast<std::uint8_t*>(ModuleHandle) + DOSHeader->e_lfanew); + + uintptr_t StartAddress = (uintptr_t)GetModuleHandleA(Module); + uintptr_t Size = (StartAddress + (uintptr_t)NTHeaders->OptionalHeader.SizeOfImage); + + const char* Pat = Sig; + uintptr_t FirstMatch = 0; + for (uintptr_t pCur = StartAddress; pCur < Size; pCur++) + { + if (!*Pat) return FirstMatch; + if (*(PBYTE)Pat == ('\?') || *(BYTE*)pCur == GET_BYTE(Pat)) + { + if (!FirstMatch) FirstMatch = pCur; + if (!Pat[2]) return FirstMatch; + if (*(PWORD)Pat == ('\?\?') || *(PBYTE)Pat != ('\?')) Pat += 3; + else Pat += 2; + } + else + { + Pat = Sig; + FirstMatch = 0; + } + } + return NULL; +} + +uintptr_t Utilities::Dereference(uintptr_t Address, unsigned int Offset) +{ + if (Address == 0) + return 0; + + if (sizeof(uintptr_t) == 8) + return Address + (int)((*(int*)(Address + Offset) + Offset) + sizeof(int)); + + return (uintptr_t) * (unsigned long*)(Address + Offset); +} + +void Utilities::DumpNetVars() +{ + FILE* FileHandle; + FileHandle = fopen("G:\\NetVar_Dump.txt", "w"); + + for (ClientClass* ClientClasses = pClient->GetAllClasses(); ClientClasses; ClientClasses = ClientClasses->m_pNext) + { + if (!ClientClasses->RecvTable || !ClientClasses->RecvTable->NetvarsArray || !ClientClasses->m_pClassName) + continue; + + Msg(Color(151, 173, 209, 255), "%s : [%d] \n", ClientClasses->m_pClassName, ClientClasses->RecvTable->NumOfNetvars); + fprintf(FileHandle, "%s : [%d] \n", ClientClasses->m_pClassName, ClientClasses->RecvTable->NumOfNetvars); + + for (int i = 0; i < ClientClasses->RecvTable->NumOfNetvars; i++) + { + Netvar* Var = ClientClasses->RecvTable->NetvarsArray[i].Netvar; + + if (!Var || !Var->NetvarName || !Var->TypeName || !Var->Offset) + break; + + Msg(Color(91, 141, 222, 255), "\t[%d] %s -> 0x%x [%s] \n", i + 1, Var->NetvarName, Var->Offset, Var->TypeName); + fprintf(FileHandle, "\t[%d] %s -> 0x%x [%s] \n", i + 1, Var->NetvarName, Var->Offset, Var->TypeName); + } + } + + fclose(FileHandle); +}
\ No newline at end of file diff --git a/source2-basehook/Utilities/Utilities.hpp b/source2-basehook/Utilities/Utilities.hpp new file mode 100644 index 0000000..b94ba98 --- /dev/null +++ b/source2-basehook/Utilities/Utilities.hpp @@ -0,0 +1,9 @@ +#pragma once +#include "../Include.hpp" + +namespace Utilities +{ + uintptr_t FindPattern(const char* module, const char* sig); + uintptr_t Dereference(uintptr_t address, unsigned int offset); + void DumpNetVars(); +}
\ No newline at end of file diff --git a/source2-basehook/Utilities/VMTHook.hpp b/source2-basehook/Utilities/VMTHook.hpp new file mode 100644 index 0000000..b25b2af --- /dev/null +++ b/source2-basehook/Utilities/VMTHook.hpp @@ -0,0 +1,67 @@ +#pragma once +#include "../Include.hpp" + +class VMTHook +{ +public: + explicit VMTHook(void* ptr) + { + if (!ptr) + return; + + pClass = reinterpret_cast<uintptr_t**>(ptr); + pOriginalVMT = *pClass; + + const auto Size = Length(); + pHookedVMT = std::make_unique<uint64_t[]>(Size + 1); + + memcpy(&pHookedVMT.get()[1], pOriginalVMT, Size * sizeof uint64_t); + + pHookedVMT.get()[0] = static_cast<uintptr_t>(pOriginalVMT[-1]); + + PatchPtr(pHookedVMT.get()); + } + + ~VMTHook() + { + PatchPtr(pOriginalVMT); + } + + template<typename Function, typename Original> + Function HookFunction(uint64_t Index, Original _Function) + { + auto Old = pOriginalVMT[Index]; + pHookedVMT.get()[Index + 1] = reinterpret_cast<uintptr_t>(_Function); + return reinterpret_cast<Function>(Old); + } + +private: + + uint64_t Length() + { + uint64_t Index = 0; + const auto VMT = pOriginalVMT; + + for (Index = 0; VMT[Index]; Index++) + if (IS_INTRESOURCE(VMT[Index])) + break; + + return Index; + } + + void PatchPtr(uintptr_t* Replacement) + { + if (!pClass) + return; + + DWORD Old; + + VirtualProtect(pClass, sizeof uintptr_t, PAGE_READWRITE, &Old); + Replacement == pOriginalVMT ? *pClass = Replacement : *pClass = &Replacement[1]; + VirtualProtect(pClass, sizeof uintptr_t, Old, &Old); + } + + std::uintptr_t** pClass; + std::uintptr_t* pOriginalVMT; + std::unique_ptr<uint64_t[]> pHookedVMT; +};
\ No newline at end of file diff --git a/source2-basehook/source2-basehook.vcxproj b/source2-basehook/source2-basehook.vcxproj new file mode 100644 index 0000000..95b5493 --- /dev/null +++ b/source2-basehook/source2-basehook.vcxproj @@ -0,0 +1,193 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>16.0</VCProjectVersion> + <ProjectGuid>{787C4EF9-905C-44CA-872A-ACA1BD0FB7A8}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>Source2</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>MultiByte</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;_DEBUG;SOURCE2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableUAC>false</EnableUAC> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <PrecompiledHeaderFile> + </PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableUAC>false</EnableUAC> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;NDEBUG;SOURCE2_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableUAC>false</EnableUAC> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader>NotUsing</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <PrecompiledHeaderFile> + </PrecompiledHeaderFile> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableUAC>false</EnableUAC> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="Console.hpp" /> + <ClInclude Include="Hooks\CreateMove.hpp" /> + <ClInclude Include="Hooks\LevelInit.hpp" /> + <ClInclude Include="Hooks\PaintTraverse.hpp" /> + <ClInclude Include="Include.hpp" /> + <ClInclude Include="Base.hpp" /> + <ClInclude Include="Renderer\Renderer.hpp" /> + <ClInclude Include="Source2SDK\CEngineClient.hpp" /> + <ClInclude Include="Source2SDK\CEngineVGUI.hpp" /> + <ClInclude Include="Source2SDK\CGlobalVarsBase.hpp" /> + <ClInclude Include="Source2SDK\ClientClass.hpp" /> + <ClInclude Include="Source2SDK\Color.hpp" /> + <ClInclude Include="Source2SDK\CSource2Client.hpp" /> + <ClInclude Include="Source2SDK\CUserCmd.hpp" /> + <ClInclude Include="Source2SDK\IClientModeShared.hpp" /> + <ClInclude Include="Source2SDK\ISurface.hpp" /> + <ClInclude Include="Source2SDK\QAngle.hpp" /> + <ClInclude Include="Source2SDK\Schema.hpp" /> + <ClInclude Include="Source2SDK\SDK.hpp" /> + <ClInclude Include="Source2SDK\Vector.hpp" /> + <ClInclude Include="Utilities\Utilities.hpp" /> + <ClInclude Include="Utilities\VMTHook.hpp" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="Console.cpp" /> + <ClCompile Include="DllMain.cpp" /> + <ClCompile Include="Hooks\CreateMove.cpp" /> + <ClCompile Include="Hooks\LevelInit.cpp" /> + <ClCompile Include="Hooks\PaintTraverse.cpp" /> + <ClCompile Include="Base.cpp" /> + <ClCompile Include="Renderer\Renderer.cpp" /> + <ClCompile Include="Source2SDK\SDK.cpp" /> + <ClCompile Include="Utilities\Utilities.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/source2-basehook/source2-basehook.vcxproj.filters b/source2-basehook/source2-basehook.vcxproj.filters new file mode 100644 index 0000000..a06b011 --- /dev/null +++ b/source2-basehook/source2-basehook.vcxproj.filters @@ -0,0 +1,126 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + <Filter Include="Source2SDK"> + <UniqueIdentifier>{59d23501-0360-4bd6-822f-56c8f4a25ae3}</UniqueIdentifier> + </Filter> + <Filter Include="Utilities"> + <UniqueIdentifier>{3d1fdc6b-3344-41d0-a939-2aaee3928e35}</UniqueIdentifier> + </Filter> + <Filter Include="Hooks"> + <UniqueIdentifier>{cd5a248e-fda6-4328-aed5-fb5e0583c368}</UniqueIdentifier> + </Filter> + <Filter Include="Renderer"> + <UniqueIdentifier>{a6aa4a3b-4201-40f6-848c-ffcc9b1371c4}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="Console.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\CEngineClient.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\CSource2Client.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\CGlobalVarsBase.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\ClientClass.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Utilities\VMTHook.hpp"> + <Filter>Utilities</Filter> + </ClInclude> + <ClInclude Include="Include.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\SDK.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\ISurface.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Renderer\Renderer.hpp"> + <Filter>Renderer</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\Color.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\Vector.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Hooks\CreateMove.hpp"> + <Filter>Hooks</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\IClientModeShared.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\QAngle.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\CUserCmd.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\Schema.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Hooks\LevelInit.hpp"> + <Filter>Hooks</Filter> + </ClInclude> + <ClInclude Include="Base.hpp"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Utilities\Utilities.hpp"> + <Filter>Utilities</Filter> + </ClInclude> + <ClInclude Include="Source2SDK\CEngineVGUI.hpp"> + <Filter>Source2SDK</Filter> + </ClInclude> + <ClInclude Include="Hooks\PaintTraverse.hpp"> + <Filter>Hooks</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="Console.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Source2SDK\SDK.cpp"> + <Filter>Source2SDK</Filter> + </ClCompile> + <ClCompile Include="Renderer\Renderer.cpp"> + <Filter>Renderer</Filter> + </ClCompile> + <ClCompile Include="Hooks\CreateMove.cpp"> + <Filter>Hooks</Filter> + </ClCompile> + <ClCompile Include="Hooks\LevelInit.cpp"> + <Filter>Hooks</Filter> + </ClCompile> + <ClCompile Include="Base.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Utilities\Utilities.cpp"> + <Filter>Utilities</Filter> + </ClCompile> + <ClCompile Include="DllMain.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="Hooks\PaintTraverse.cpp"> + <Filter>Hooks</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/source2-basehook/source2-basehook.vcxproj.user b/source2-basehook/source2-basehook.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/source2-basehook/source2-basehook.vcxproj.user @@ -0,0 +1,4 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <PropertyGroup /> +</Project>
\ No newline at end of file |