aboutsummaryrefslogtreecommitdiff
path: root/source2-basehook/Hooks
diff options
context:
space:
mode:
authorjz0 <[email protected]>2020-05-03 22:38:59 +0300
committerjz0 <[email protected]>2020-05-03 22:38:59 +0300
commitfdb81a898151278a66af544dfae6bfcbbf9dc3d2 (patch)
tree8884fc5c21b3daf0a32cc145c4488b9e708deec4 /source2-basehook/Hooks
downloadarchived-source2-basehook-fdb81a898151278a66af544dfae6bfcbbf9dc3d2.tar.xz
archived-source2-basehook-fdb81a898151278a66af544dfae6bfcbbf9dc3d2.zip
Initial commit
Diffstat (limited to 'source2-basehook/Hooks')
-rw-r--r--source2-basehook/Hooks/CreateMove.cpp15
-rw-r--r--source2-basehook/Hooks/CreateMove.hpp9
-rw-r--r--source2-basehook/Hooks/LevelInit.cpp13
-rw-r--r--source2-basehook/Hooks/LevelInit.hpp8
-rw-r--r--source2-basehook/Hooks/PaintTraverse.cpp28
-rw-r--r--source2-basehook/Hooks/PaintTraverse.hpp10
6 files changed, 83 insertions, 0 deletions
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);
+