diff --git a/TempleWare-CS2/TempleWare-CS2.vcxproj b/TempleWare-CS2/TempleWare-CS2.vcxproj
index a2aa1d8..2dae834 100644
--- a/TempleWare-CS2/TempleWare-CS2.vcxproj
+++ b/TempleWare-CS2/TempleWare-CS2.vcxproj
@@ -171,6 +171,7 @@
+
@@ -228,6 +229,7 @@
+
diff --git a/output/animationsystem_dll.cs b/TempleWare-CS2/output/animationsystem_dll.cs
similarity index 100%
rename from output/animationsystem_dll.cs
rename to TempleWare-CS2/output/animationsystem_dll.cs
diff --git a/output/animationsystem_dll.hpp b/TempleWare-CS2/output/animationsystem_dll.hpp
similarity index 100%
rename from output/animationsystem_dll.hpp
rename to TempleWare-CS2/output/animationsystem_dll.hpp
diff --git a/output/animationsystem_dll.json b/TempleWare-CS2/output/animationsystem_dll.json
similarity index 100%
rename from output/animationsystem_dll.json
rename to TempleWare-CS2/output/animationsystem_dll.json
diff --git a/output/animationsystem_dll.rs b/TempleWare-CS2/output/animationsystem_dll.rs
similarity index 100%
rename from output/animationsystem_dll.rs
rename to TempleWare-CS2/output/animationsystem_dll.rs
diff --git a/output/buttons.cs b/TempleWare-CS2/output/buttons.cs
similarity index 100%
rename from output/buttons.cs
rename to TempleWare-CS2/output/buttons.cs
diff --git a/output/buttons.hpp b/TempleWare-CS2/output/buttons.hpp
similarity index 100%
rename from output/buttons.hpp
rename to TempleWare-CS2/output/buttons.hpp
diff --git a/output/buttons.json b/TempleWare-CS2/output/buttons.json
similarity index 100%
rename from output/buttons.json
rename to TempleWare-CS2/output/buttons.json
diff --git a/output/buttons.rs b/TempleWare-CS2/output/buttons.rs
similarity index 100%
rename from output/buttons.rs
rename to TempleWare-CS2/output/buttons.rs
diff --git a/output/client_dll.cs b/TempleWare-CS2/output/client_dll.cs
similarity index 100%
rename from output/client_dll.cs
rename to TempleWare-CS2/output/client_dll.cs
diff --git a/output/client_dll.hpp b/TempleWare-CS2/output/client_dll.hpp
similarity index 100%
rename from output/client_dll.hpp
rename to TempleWare-CS2/output/client_dll.hpp
diff --git a/output/client_dll.json b/TempleWare-CS2/output/client_dll.json
similarity index 100%
rename from output/client_dll.json
rename to TempleWare-CS2/output/client_dll.json
diff --git a/output/client_dll.rs b/TempleWare-CS2/output/client_dll.rs
similarity index 100%
rename from output/client_dll.rs
rename to TempleWare-CS2/output/client_dll.rs
diff --git a/output/engine2_dll.cs b/TempleWare-CS2/output/engine2_dll.cs
similarity index 100%
rename from output/engine2_dll.cs
rename to TempleWare-CS2/output/engine2_dll.cs
diff --git a/output/engine2_dll.hpp b/TempleWare-CS2/output/engine2_dll.hpp
similarity index 100%
rename from output/engine2_dll.hpp
rename to TempleWare-CS2/output/engine2_dll.hpp
diff --git a/output/engine2_dll.json b/TempleWare-CS2/output/engine2_dll.json
similarity index 100%
rename from output/engine2_dll.json
rename to TempleWare-CS2/output/engine2_dll.json
diff --git a/output/engine2_dll.rs b/TempleWare-CS2/output/engine2_dll.rs
similarity index 100%
rename from output/engine2_dll.rs
rename to TempleWare-CS2/output/engine2_dll.rs
diff --git a/output/host_dll.cs b/TempleWare-CS2/output/host_dll.cs
similarity index 100%
rename from output/host_dll.cs
rename to TempleWare-CS2/output/host_dll.cs
diff --git a/output/host_dll.hpp b/TempleWare-CS2/output/host_dll.hpp
similarity index 100%
rename from output/host_dll.hpp
rename to TempleWare-CS2/output/host_dll.hpp
diff --git a/output/host_dll.json b/TempleWare-CS2/output/host_dll.json
similarity index 100%
rename from output/host_dll.json
rename to TempleWare-CS2/output/host_dll.json
diff --git a/output/host_dll.rs b/TempleWare-CS2/output/host_dll.rs
similarity index 100%
rename from output/host_dll.rs
rename to TempleWare-CS2/output/host_dll.rs
diff --git a/output/info.json b/TempleWare-CS2/output/info.json
similarity index 100%
rename from output/info.json
rename to TempleWare-CS2/output/info.json
diff --git a/output/interfaces.cs b/TempleWare-CS2/output/interfaces.cs
similarity index 100%
rename from output/interfaces.cs
rename to TempleWare-CS2/output/interfaces.cs
diff --git a/output/interfaces.hpp b/TempleWare-CS2/output/interfaces.hpp
similarity index 100%
rename from output/interfaces.hpp
rename to TempleWare-CS2/output/interfaces.hpp
diff --git a/output/interfaces.json b/TempleWare-CS2/output/interfaces.json
similarity index 100%
rename from output/interfaces.json
rename to TempleWare-CS2/output/interfaces.json
diff --git a/output/interfaces.rs b/TempleWare-CS2/output/interfaces.rs
similarity index 100%
rename from output/interfaces.rs
rename to TempleWare-CS2/output/interfaces.rs
diff --git a/output/materialsystem2_dll.cs b/TempleWare-CS2/output/materialsystem2_dll.cs
similarity index 100%
rename from output/materialsystem2_dll.cs
rename to TempleWare-CS2/output/materialsystem2_dll.cs
diff --git a/output/materialsystem2_dll.hpp b/TempleWare-CS2/output/materialsystem2_dll.hpp
similarity index 100%
rename from output/materialsystem2_dll.hpp
rename to TempleWare-CS2/output/materialsystem2_dll.hpp
diff --git a/output/materialsystem2_dll.json b/TempleWare-CS2/output/materialsystem2_dll.json
similarity index 100%
rename from output/materialsystem2_dll.json
rename to TempleWare-CS2/output/materialsystem2_dll.json
diff --git a/output/materialsystem2_dll.rs b/TempleWare-CS2/output/materialsystem2_dll.rs
similarity index 100%
rename from output/materialsystem2_dll.rs
rename to TempleWare-CS2/output/materialsystem2_dll.rs
diff --git a/output/networksystem_dll.cs b/TempleWare-CS2/output/networksystem_dll.cs
similarity index 100%
rename from output/networksystem_dll.cs
rename to TempleWare-CS2/output/networksystem_dll.cs
diff --git a/output/networksystem_dll.hpp b/TempleWare-CS2/output/networksystem_dll.hpp
similarity index 100%
rename from output/networksystem_dll.hpp
rename to TempleWare-CS2/output/networksystem_dll.hpp
diff --git a/output/networksystem_dll.json b/TempleWare-CS2/output/networksystem_dll.json
similarity index 100%
rename from output/networksystem_dll.json
rename to TempleWare-CS2/output/networksystem_dll.json
diff --git a/output/networksystem_dll.rs b/TempleWare-CS2/output/networksystem_dll.rs
similarity index 100%
rename from output/networksystem_dll.rs
rename to TempleWare-CS2/output/networksystem_dll.rs
diff --git a/output/offsets.cs b/TempleWare-CS2/output/offsets.cs
similarity index 100%
rename from output/offsets.cs
rename to TempleWare-CS2/output/offsets.cs
diff --git a/output/offsets.hpp b/TempleWare-CS2/output/offsets.hpp
similarity index 100%
rename from output/offsets.hpp
rename to TempleWare-CS2/output/offsets.hpp
diff --git a/output/offsets.json b/TempleWare-CS2/output/offsets.json
similarity index 100%
rename from output/offsets.json
rename to TempleWare-CS2/output/offsets.json
diff --git a/output/offsets.rs b/TempleWare-CS2/output/offsets.rs
similarity index 100%
rename from output/offsets.rs
rename to TempleWare-CS2/output/offsets.rs
diff --git a/output/panorama_dll.cs b/TempleWare-CS2/output/panorama_dll.cs
similarity index 100%
rename from output/panorama_dll.cs
rename to TempleWare-CS2/output/panorama_dll.cs
diff --git a/output/panorama_dll.hpp b/TempleWare-CS2/output/panorama_dll.hpp
similarity index 100%
rename from output/panorama_dll.hpp
rename to TempleWare-CS2/output/panorama_dll.hpp
diff --git a/output/panorama_dll.json b/TempleWare-CS2/output/panorama_dll.json
similarity index 100%
rename from output/panorama_dll.json
rename to TempleWare-CS2/output/panorama_dll.json
diff --git a/output/panorama_dll.rs b/TempleWare-CS2/output/panorama_dll.rs
similarity index 100%
rename from output/panorama_dll.rs
rename to TempleWare-CS2/output/panorama_dll.rs
diff --git a/output/particles_dll.cs b/TempleWare-CS2/output/particles_dll.cs
similarity index 100%
rename from output/particles_dll.cs
rename to TempleWare-CS2/output/particles_dll.cs
diff --git a/output/particles_dll.hpp b/TempleWare-CS2/output/particles_dll.hpp
similarity index 100%
rename from output/particles_dll.hpp
rename to TempleWare-CS2/output/particles_dll.hpp
diff --git a/output/particles_dll.json b/TempleWare-CS2/output/particles_dll.json
similarity index 100%
rename from output/particles_dll.json
rename to TempleWare-CS2/output/particles_dll.json
diff --git a/output/particles_dll.rs b/TempleWare-CS2/output/particles_dll.rs
similarity index 100%
rename from output/particles_dll.rs
rename to TempleWare-CS2/output/particles_dll.rs
diff --git a/output/pulse_system_dll.cs b/TempleWare-CS2/output/pulse_system_dll.cs
similarity index 100%
rename from output/pulse_system_dll.cs
rename to TempleWare-CS2/output/pulse_system_dll.cs
diff --git a/output/pulse_system_dll.hpp b/TempleWare-CS2/output/pulse_system_dll.hpp
similarity index 100%
rename from output/pulse_system_dll.hpp
rename to TempleWare-CS2/output/pulse_system_dll.hpp
diff --git a/output/pulse_system_dll.json b/TempleWare-CS2/output/pulse_system_dll.json
similarity index 100%
rename from output/pulse_system_dll.json
rename to TempleWare-CS2/output/pulse_system_dll.json
diff --git a/output/pulse_system_dll.rs b/TempleWare-CS2/output/pulse_system_dll.rs
similarity index 100%
rename from output/pulse_system_dll.rs
rename to TempleWare-CS2/output/pulse_system_dll.rs
diff --git a/output/rendersystemdx11_dll.cs b/TempleWare-CS2/output/rendersystemdx11_dll.cs
similarity index 100%
rename from output/rendersystemdx11_dll.cs
rename to TempleWare-CS2/output/rendersystemdx11_dll.cs
diff --git a/output/rendersystemdx11_dll.hpp b/TempleWare-CS2/output/rendersystemdx11_dll.hpp
similarity index 100%
rename from output/rendersystemdx11_dll.hpp
rename to TempleWare-CS2/output/rendersystemdx11_dll.hpp
diff --git a/output/rendersystemdx11_dll.json b/TempleWare-CS2/output/rendersystemdx11_dll.json
similarity index 100%
rename from output/rendersystemdx11_dll.json
rename to TempleWare-CS2/output/rendersystemdx11_dll.json
diff --git a/output/rendersystemdx11_dll.rs b/TempleWare-CS2/output/rendersystemdx11_dll.rs
similarity index 100%
rename from output/rendersystemdx11_dll.rs
rename to TempleWare-CS2/output/rendersystemdx11_dll.rs
diff --git a/output/resourcesystem_dll.cs b/TempleWare-CS2/output/resourcesystem_dll.cs
similarity index 100%
rename from output/resourcesystem_dll.cs
rename to TempleWare-CS2/output/resourcesystem_dll.cs
diff --git a/output/resourcesystem_dll.hpp b/TempleWare-CS2/output/resourcesystem_dll.hpp
similarity index 100%
rename from output/resourcesystem_dll.hpp
rename to TempleWare-CS2/output/resourcesystem_dll.hpp
diff --git a/output/resourcesystem_dll.json b/TempleWare-CS2/output/resourcesystem_dll.json
similarity index 100%
rename from output/resourcesystem_dll.json
rename to TempleWare-CS2/output/resourcesystem_dll.json
diff --git a/output/resourcesystem_dll.rs b/TempleWare-CS2/output/resourcesystem_dll.rs
similarity index 100%
rename from output/resourcesystem_dll.rs
rename to TempleWare-CS2/output/resourcesystem_dll.rs
diff --git a/output/scenesystem_dll.cs b/TempleWare-CS2/output/scenesystem_dll.cs
similarity index 100%
rename from output/scenesystem_dll.cs
rename to TempleWare-CS2/output/scenesystem_dll.cs
diff --git a/output/scenesystem_dll.hpp b/TempleWare-CS2/output/scenesystem_dll.hpp
similarity index 100%
rename from output/scenesystem_dll.hpp
rename to TempleWare-CS2/output/scenesystem_dll.hpp
diff --git a/output/scenesystem_dll.json b/TempleWare-CS2/output/scenesystem_dll.json
similarity index 100%
rename from output/scenesystem_dll.json
rename to TempleWare-CS2/output/scenesystem_dll.json
diff --git a/output/scenesystem_dll.rs b/TempleWare-CS2/output/scenesystem_dll.rs
similarity index 100%
rename from output/scenesystem_dll.rs
rename to TempleWare-CS2/output/scenesystem_dll.rs
diff --git a/output/schemasystem_dll.cs b/TempleWare-CS2/output/schemasystem_dll.cs
similarity index 100%
rename from output/schemasystem_dll.cs
rename to TempleWare-CS2/output/schemasystem_dll.cs
diff --git a/output/schemasystem_dll.hpp b/TempleWare-CS2/output/schemasystem_dll.hpp
similarity index 100%
rename from output/schemasystem_dll.hpp
rename to TempleWare-CS2/output/schemasystem_dll.hpp
diff --git a/output/schemasystem_dll.json b/TempleWare-CS2/output/schemasystem_dll.json
similarity index 100%
rename from output/schemasystem_dll.json
rename to TempleWare-CS2/output/schemasystem_dll.json
diff --git a/output/schemasystem_dll.rs b/TempleWare-CS2/output/schemasystem_dll.rs
similarity index 100%
rename from output/schemasystem_dll.rs
rename to TempleWare-CS2/output/schemasystem_dll.rs
diff --git a/output/server_dll.cs b/TempleWare-CS2/output/server_dll.cs
similarity index 100%
rename from output/server_dll.cs
rename to TempleWare-CS2/output/server_dll.cs
diff --git a/output/server_dll.hpp b/TempleWare-CS2/output/server_dll.hpp
similarity index 100%
rename from output/server_dll.hpp
rename to TempleWare-CS2/output/server_dll.hpp
diff --git a/output/server_dll.json b/TempleWare-CS2/output/server_dll.json
similarity index 100%
rename from output/server_dll.json
rename to TempleWare-CS2/output/server_dll.json
diff --git a/output/server_dll.rs b/TempleWare-CS2/output/server_dll.rs
similarity index 100%
rename from output/server_dll.rs
rename to TempleWare-CS2/output/server_dll.rs
diff --git a/output/soundsystem_dll.cs b/TempleWare-CS2/output/soundsystem_dll.cs
similarity index 100%
rename from output/soundsystem_dll.cs
rename to TempleWare-CS2/output/soundsystem_dll.cs
diff --git a/output/soundsystem_dll.hpp b/TempleWare-CS2/output/soundsystem_dll.hpp
similarity index 100%
rename from output/soundsystem_dll.hpp
rename to TempleWare-CS2/output/soundsystem_dll.hpp
diff --git a/output/soundsystem_dll.json b/TempleWare-CS2/output/soundsystem_dll.json
similarity index 100%
rename from output/soundsystem_dll.json
rename to TempleWare-CS2/output/soundsystem_dll.json
diff --git a/output/soundsystem_dll.rs b/TempleWare-CS2/output/soundsystem_dll.rs
similarity index 100%
rename from output/soundsystem_dll.rs
rename to TempleWare-CS2/output/soundsystem_dll.rs
diff --git a/output/vphysics2_dll.cs b/TempleWare-CS2/output/vphysics2_dll.cs
similarity index 100%
rename from output/vphysics2_dll.cs
rename to TempleWare-CS2/output/vphysics2_dll.cs
diff --git a/output/vphysics2_dll.hpp b/TempleWare-CS2/output/vphysics2_dll.hpp
similarity index 100%
rename from output/vphysics2_dll.hpp
rename to TempleWare-CS2/output/vphysics2_dll.hpp
diff --git a/output/vphysics2_dll.json b/TempleWare-CS2/output/vphysics2_dll.json
similarity index 100%
rename from output/vphysics2_dll.json
rename to TempleWare-CS2/output/vphysics2_dll.json
diff --git a/output/vphysics2_dll.rs b/TempleWare-CS2/output/vphysics2_dll.rs
similarity index 100%
rename from output/vphysics2_dll.rs
rename to TempleWare-CS2/output/vphysics2_dll.rs
diff --git a/output/worldrenderer_dll.cs b/TempleWare-CS2/output/worldrenderer_dll.cs
similarity index 100%
rename from output/worldrenderer_dll.cs
rename to TempleWare-CS2/output/worldrenderer_dll.cs
diff --git a/output/worldrenderer_dll.hpp b/TempleWare-CS2/output/worldrenderer_dll.hpp
similarity index 100%
rename from output/worldrenderer_dll.hpp
rename to TempleWare-CS2/output/worldrenderer_dll.hpp
diff --git a/output/worldrenderer_dll.json b/TempleWare-CS2/output/worldrenderer_dll.json
similarity index 100%
rename from output/worldrenderer_dll.json
rename to TempleWare-CS2/output/worldrenderer_dll.json
diff --git a/output/worldrenderer_dll.rs b/TempleWare-CS2/output/worldrenderer_dll.rs
similarity index 100%
rename from output/worldrenderer_dll.rs
rename to TempleWare-CS2/output/worldrenderer_dll.rs
diff --git a/TempleWare-CS2/source/cs2/datatypes/keyvalues/keyvalues.cpp b/TempleWare-CS2/source/cs2/datatypes/keyvalues/keyvalues.cpp
index 628c16d..115f2d6 100644
--- a/TempleWare-CS2/source/cs2/datatypes/keyvalues/keyvalues.cpp
+++ b/TempleWare-CS2/source/cs2/datatypes/keyvalues/keyvalues.cpp
@@ -34,7 +34,6 @@ CKeyValues3* CKeyValues3::create_material_from_resource()
using fnSetTypeKV3 = CKeyValues3 * (__fastcall*)(CKeyValues3*, unsigned int, unsigned int);
static const fnSetTypeKV3 oSetTypeKV3 = reinterpret_cast(M::FindPattern("tier0.dll", ("40 53 48 83 EC 30 48 8B D9 49")));
-
- CKeyValues3* pKeyValue = new CKeyValues3[0x10];
+ CKeyValues3* pKeyValue = new CKeyValues3;
return oSetTypeKV3(pKeyValue, 1U, 6U);
}
\ No newline at end of file
diff --git a/TempleWare-CS2/source/cs2/entity/CCSPlayerController/CCSPlayerController.h b/TempleWare-CS2/source/cs2/entity/CCSPlayerController/CCSPlayerController.h
index 366f3d0..92fc6b8 100644
--- a/TempleWare-CS2/source/cs2/entity/CCSPlayerController/CCSPlayerController.h
+++ b/TempleWare-CS2/source/cs2/entity/CCSPlayerController/CCSPlayerController.h
@@ -1,6 +1,6 @@
#pragma once
#include
-#pragma once
+#include "../handle.h"
#include "../../../templeware/utils/memory/memorycommon.h"
#include "../../../templeware/utils/math/vector/vector.h"
#include "../../../templeware/utils/schema/schema.h"
@@ -14,6 +14,7 @@ public:
SCHEMA_ADD_OFFSET(bool, IsLocalPlayer, 0x6F0);
SCHEMA_ADD_OFFSET(CBaseHandle, m_hPawn, 0x62C);
+ SCHEMA_ADD_OFFSET(CBaseHandle, m_hObserverPawn, 0x48);
SCHEMA_ADD_OFFSET(const char*, m_sSanitizedPlayerName, 0x778);
private:
diff --git a/TempleWare-CS2/source/cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h b/TempleWare-CS2/source/cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h
index d9eaf64..63cd20d 100644
--- a/TempleWare-CS2/source/cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h
+++ b/TempleWare-CS2/source/cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h
@@ -12,6 +12,7 @@ public:
SCHEMA_ADD_OFFSET(Vector_t, m_vOldOrigin, 0x1324);
SCHEMA_ADD_OFFSET(Vector_t, m_vecViewOffset, 0xCB0);
SCHEMA_ADD_OFFSET(CCSPlayer_WeaponServices*, m_pWeaponServices, 0x11A8);
+ SCHEMA_ADD_OFFSET(CBaseHandle, m_hController, 0x133C);
C_CSPlayerPawn(uintptr_t address);
C_CSWeaponBase* GetActiveWeapon()const;
diff --git a/TempleWare-CS2/source/includes.h b/TempleWare-CS2/source/includes.h
index c14da4d..48814d2 100644
--- a/TempleWare-CS2/source/includes.h
+++ b/TempleWare-CS2/source/includes.h
@@ -6,6 +6,7 @@
#include "../external/imgui/imgui.h"
#include "../external/imgui/imgui_impl_win32.h"
#include "../external/imgui/imgui_impl_dx11.h"
+#include "cs2/entity/handle.h"
typedef HRESULT(__stdcall* Present) (IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Flags);
typedef LRESULT(CALLBACK* WNDPROC)(HWND, UINT, WPARAM, LPARAM);
diff --git a/TempleWare-CS2/source/templeware/config/config.cpp b/TempleWare-CS2/source/templeware/config/config.cpp
index c1cbd07..ae877a9 100644
--- a/TempleWare-CS2/source/templeware/config/config.cpp
+++ b/TempleWare-CS2/source/templeware/config/config.cpp
@@ -63,5 +63,22 @@ namespace Config {
bool triggerbot = false;
bool always_on_triggerbot = false;
int triggerbot_key = 0x05; // Например, VK_X или другой
+ int triggerbot_alt_key = 0x06; // Альтернативная кнопка по умолчанию (например, VK_Y)
float triggerbot_delay = 0.0f;
+ int rcsActivationShots = 1;
+
+ // --- Для отображения наблюдателей ---
+ bool showSpectators = true;
+ ImVec4 spectatorListColor = ImVec4(1.0f, 1.0f, 1.0f, 1.0f);
+ ImVec4 spectatorListBgColor = ImVec4(0.0f, 0.0f, 0.0f, 0.7f);
+ float spectatorListOpacity = 0.8f;
+
+ bool silent_aim = true;
+ float silent_aim_fov = 90.0f;
+ float silent_aim_smooth = 0.0f;
+ int silent_aim_bone = Config::BONE_HEAD;
+ int silent_aim_key = 0x12; // VK_DELETE по умолчанию
+ bool always_on_silent_aim = false;
+ float silent_aim_smooth_slider = 0.0f; // Новый параметр для ползунка смуза
+ bool silent_shooterAfterAim = false; // Аналог shooterAfterAim для сайлент аимбота
}
diff --git a/TempleWare-CS2/source/templeware/config/config.h b/TempleWare-CS2/source/templeware/config/config.h
index 898bfea..b4709b3 100644
--- a/TempleWare-CS2/source/templeware/config/config.h
+++ b/TempleWare-CS2/source/templeware/config/config.h
@@ -70,5 +70,22 @@ namespace Config {
extern bool triggerbot;
extern bool always_on_triggerbot;
extern int triggerbot_key;
+ extern int triggerbot_alt_key; // Альтернативная кнопка для триггербота
extern float triggerbot_delay;
+ extern int rcsActivationShots;
+
+ // --- Для отображения наблюдателей ---
+ extern bool showSpectators;
+ extern ImVec4 spectatorListColor;
+ extern ImVec4 spectatorListBgColor;
+ extern float spectatorListOpacity;
+
+ extern bool silent_aim;
+ extern float silent_aim_fov;
+ extern float silent_aim_smooth;
+ extern int silent_aim_bone;
+ extern int silent_aim_key;
+ extern bool always_on_silent_aim;
+ extern float silent_aim_smooth_slider; // Новый параметр для ползунка смуза
+ extern bool silent_shooterAfterAim; // Аналог shooterAfterAim для сайлент аимбота
}
diff --git a/TempleWare-CS2/source/templeware/config/configmanager.h b/TempleWare-CS2/source/templeware/config/configmanager.h
index 975d395..b70f299 100644
--- a/TempleWare-CS2/source/templeware/config/configmanager.h
+++ b/TempleWare-CS2/source/templeware/config/configmanager.h
@@ -130,9 +130,11 @@ namespace internal_config
j["showNameTags"] = Config::showNameTags;
j["triggerbot_hold_lmb"] = Config::triggerbot_hold_lmb;
j["shooterAfterAim"] = Config::shooterAfterAim;
+ j["silent_shooterAfterAim"] = Config::silent_shooterAfterAim;
j["always_on_triggerbot"] = Config::always_on_triggerbot;
j["triggerbot"] = Config::triggerbot;
j["triggerbot_key"] = Config::triggerbot_key;
+ j["triggerbot_alt_key"] = Config::triggerbot_alt_key;
j["triggerbot_delay"] = Config::triggerbot_delay;
j["enemyChamsInvisible"] = Config::enemyChamsInvisible;
@@ -170,6 +172,7 @@ namespace internal_config
Config::fovCircleColor.z,
Config::fovCircleColor.w
};
+ j["rcsActivationShots"] = Config::rcsActivationShots;
auto filePath = GetConfigPath(configName);
std::ofstream ofs(filePath);
@@ -243,9 +246,11 @@ namespace internal_config
Config::showNameTags = j.value("showNameTags", false);
Config::triggerbot_hold_lmb = j.value("triggerbot_hold_lmb", false);
Config::shooterAfterAim = j.value("shooterAfterAim", false);
+ Config::silent_shooterAfterAim = j.value("silent_shooterAfterAim", false);
Config::always_on_triggerbot = j.value("always_on_triggerbot", false);
Config::triggerbot = j.value("triggerbot", false);
Config::triggerbot_key = j.value("triggerbot_key", 0x05);
+ Config::triggerbot_alt_key = j.value("triggerbot_alt_key", 0x06);
Config::triggerbot_delay = j.value("triggerbot_delay", 0.0f);
Config::antiflash = j.value("antiflash", false);
@@ -315,6 +320,8 @@ namespace internal_config
Config::fovCircleColor.w = arr[3].get();
}
+ Config::rcsActivationShots = j.value("rcsActivationShots", 1);
+
ifs.close();
}
diff --git a/TempleWare-CS2/source/templeware/features/aim/CUserCmd.h b/TempleWare-CS2/source/templeware/features/aim/CUserCmd.h
new file mode 100644
index 0000000..e030e48
--- /dev/null
+++ b/TempleWare-CS2/source/templeware/features/aim/CUserCmd.h
@@ -0,0 +1,29 @@
+#pragma once
+#include
+#include
+#include "../../../templeware/utils/math/vector/vector.h"
+
+struct CCmdQAngle {
+ QAngle_t angValue;
+};
+
+class CBaseUserCmdPB {
+public:
+ char pad_0x00[0x40];
+ CCmdQAngle* pViewangles; // 0x40
+ // ... другие поля не нужны для silent aim
+};
+
+class CCSGOUserCmdPB {
+public:
+ char pad_0x00[0x18];
+ CBaseUserCmdPB* pBase; // 0x18
+ // ... другие поля не нужны для silent aim
+};
+
+class CUserCmd {
+public:
+ char pad_0x00[0x18];
+ CCSGOUserCmdPB pBase; // 0x18
+ // ... другие поля не нужны для silent aim
+};
\ No newline at end of file
diff --git a/TempleWare-CS2/source/templeware/features/aim/aim.cpp b/TempleWare-CS2/source/templeware/features/aim/aim.cpp
index 42e290d..9bd40d3 100644
--- a/TempleWare-CS2/source/templeware/features/aim/aim.cpp
+++ b/TempleWare-CS2/source/templeware/features/aim/aim.cpp
@@ -4,13 +4,33 @@
#include "../../../templeware/hooks/hooks.h"
#include "../../../templeware/config/config.h"
#include "../../utils/memory/patternscan/patternscan.h"
+#include "../visuals/visuals.h"
+#include "CUserCmd.h"
+#include "../../../templeware/utils/schema/schema.h"
#include
#include
-#include "../../menu/hud.h"
-#include "../../menu/menu.h"
#include
#include
+#include
+#include "../../menu/hud.h"
+#include "../../menu/menu.h"
+
+// Адреса из дампа (актуально для 2024-07-18)
+#define DW_SENSITIVITY 0x1A6A9D8
+#define DW_SENSITIVITY_SENS 0x40
+
+float GetGameSensitivity() {
+ static float fallback = 2.0f;
+ HMODULE hClient = GetModuleHandleA("client.dll");
+ if (!hClient) return fallback;
+ uintptr_t sensBase = reinterpret_cast(hClient) + DW_SENSITIVITY;
+ uintptr_t sensPtr = *reinterpret_cast(sensBase);
+ if (!sensPtr) return fallback;
+ float sens = *reinterpret_cast(sensPtr + DW_SENSITIVITY_SENS);
+ if (sens < 0.01f || sens > 20.0f) return fallback;
+ return sens;
+}
// Индексы костей (актуально для CS2)
constexpr int BONE_INDEX_HEAD = 6; // Head
@@ -107,25 +127,30 @@ Vector_t GetEntityEyePos(const C_CSPlayerPawn* Entity) {
return Result;
}
+// Удаляем все вспомогательные функции инкапсуляции
+
void Aimbot() {
static C_CSPlayerPawn* lockedTarget = nullptr;
static bool prevAimbotState = false;
static bool targetWasLost = false;
static QAngle_t last_punch_angle = {0,0,0};
static int shotCount = 0;
+ float sensitivity = GetGameSensitivity();
bool aimbotActive = Config::always_on_aimbot ? true : Config::aimbot;
// --- shooterAfterAim + triggerbot_key ---
if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
aimbotActive = true;
}
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
+ if (cached_players.empty() || !lp || !lp->handle().valid() || lp->getHealth() <= 0)
+ return;
Vector_t lep = GetEntityEyePos(lp);
QAngle_t* viewangles = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
bool isShooting = (GetAsyncKeyState(Config::triggerbot_key) & 0x8000) || (GetAsyncKeyState(VK_LBUTTON) & 0x8000);
int shotsFired = lp ? lp->getShotsFired() : 0;
shotCount = shotsFired;
- g_DebugString = "debug: " + std::to_string(shotsFired);
+ //g_DebugString = "debug: " + std::to_string(shotsFired) + "Sens: " + std::to_string(sensitivity);
if (Config::aimbot_on_lmb && !Config::always_on_aimbot) {
aimbotActive = isShooting;
@@ -141,77 +166,54 @@ void Aimbot() {
// --- Новый режим: always_on_aimbot ---
if (Config::always_on_aimbot) {
- int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
float bestFov = Config::aimbot_fov;
- C_CSPlayerPawn* bestTarget = nullptr;
+ PlayerCache* bestTarget = nullptr;
QAngle_t bestAngle = { 0, 0, 0 };
-
- for (int i = 1; i <= nMaxHighestEntity; i++) {
- auto Entity = I::GameEntity->Instance->Get(i);
- if (!Entity)
+ for (auto& Player : cached_players) {
+ if (!Player.handle.valid() || Player.health <= 0 || Player.handle.index() == INVALID_EHANDLE_INDEX)
continue;
- if (!Entity->handle().valid())
+ if (Config::teamCheck && (Player.team_num == cached_local.team))
continue;
- SchemaClassInfoData_t* _class = nullptr;
- Entity->dump_class_info(&_class);
- if (!_class)
- continue;
- const uint32_t hash = HASH(_class->szName);
- if (hash == HASH("C_CSPlayerPawn")) {
- C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
- if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
- continue;
- if (pawn->getHealth() <= 0)
- continue;
- if (Config::team_check && pawn->getTeam() == lp->getTeam())
- continue;
- Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
- QAngle_t angle = CalcAngles(target_pos, lep);
- angle.x *= -1.f;
- angle.y += 180.f;
- const float fov = GetFov(*viewangles, angle);
- if (!std::isfinite(fov) || fov > bestFov)
- continue;
- bestFov = fov;
- bestTarget = pawn;
- bestAngle = angle;
- }
- }
- if (bestTarget) {
- Vector_t target_pos = GetAimbotTargetPos(bestTarget, lep, *viewangles);
- //Vector_t target_pos = GetEntityEyePos(bestTarget);
+ Vector_t target_pos = Player.position + Player.viewOffset;
QAngle_t angle = CalcAngles(target_pos, lep);
angle.x *= -1.f;
angle.y += 180.f;
- QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
- if (isShooting) {
- last_punch_angle = ang_punch_angle;
+ const float fov = GetFov(*viewangles, angle);
+ if (!std::isfinite(fov) || fov > bestFov)
+ continue;
+ bestFov = fov;
+ bestTarget = &Player;
+ bestAngle = angle;
+ }
+ if (bestTarget) {
+ Vector_t target_pos = bestTarget->position + bestTarget->viewOffset;
+ QAngle_t angle = CalcAngles(target_pos, lep);
+ angle.x *= -1.f;
+ angle.y += 180.f;
+ QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
+ // --- RCS ---
+ bool rcsActive = false;
+ if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
+ rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
+ } else {
+ rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
+ }
+ if (rcsActive && shotsFired > 1) {
+ // Для прямого изменения viewangles: делить НЕ нужно
+ //QAngle_t punchDelta = cur_punch_angle - last_punch_angle;
+ //g_DebugString = "debug: " + std::to_string(punchDelta.x);
+ angle -= cur_punch_angle * 2.f;
+ last_punch_angle = cur_punch_angle;
} else {
last_punch_angle = {0,0,0};
}
- // --- RCS ---
- bool rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > 1);
- if (rcsActive)
- angle -= last_punch_angle * 2.f;
angle.z = 0.f;
angle = angle.Normalize();
- // --- RCS ---
- QAngle_t delta = (angle - *viewangles).Normalize();
- if (rcsActive) {
- float smooth_rcs = Config::aimbot_smooth;
- if (Config::aimbot_dynamic_smooth) {
- float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
- float maxFov = Config::aimbot_fov;
- float factor = (maxFov > 0.01f) ? (fov / maxFov) : 0.f;
- smooth_rcs = Config::aimbot_smooth + (Config::aimbot_smooth * factor * Config::aimbot_dynamic_smooth_factor);
- }
- smooth_rcs = std::fmax(smooth_rcs / 10.f, 1.0f);
- angle -= last_punch_angle * 2.f * smooth_rcs;
- }
+
// --- Smooth ---
+ QAngle_t delta = (angle - *viewangles).Normalize();
if (Config::aimbot_smooth > 0.f) {
QAngle_t cur = *viewangles;
- QAngle_t delta = (angle - cur).Normalize();
float smooth = Config::aimbot_smooth;
if (Config::aimbot_dynamic_smooth) {
float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
@@ -251,12 +253,10 @@ void Aimbot() {
const uint32_t hash = HASH(_class->szName);
if (hash == HASH("C_CSPlayerPawn")) {
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
- if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
- continue;
- if (pawn->getHealth() <= 0)
- continue;
- if (Config::team_check && pawn->getTeam() == lp->getTeam())
- continue;
+ if (!pawn) continue;
+ if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
+ if (pawn->getHealth() <= 0) continue;
+ if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
QAngle_t angle = CalcAngles(target_pos, lep);
angle.x *= -1.f;
@@ -287,10 +287,19 @@ void Aimbot() {
// Если есть захваченная цель и кнопка удерживается
if (aimbotActive && lockedTarget) {
// Проверяем, что цель всё ещё валидна
- if (!lockedTarget->handle().valid() || lockedTarget->getHealth() <= 0) {
+ if (!lp || !lp->handle().valid() || lp->getHealth() <= 0) {
+ lockedTarget = nullptr;
+ targetWasLost = false;
+ last_punch_angle = {0,0,0};
+ return;
+ }
+ if (
+ lockedTarget->get_entity_by_handle() == lp->get_entity_by_handle() ||
+ lockedTarget->getHealth() <= 0 ||
+ !lockedTarget->handle().valid()
+ ) {
lockedTarget = nullptr;
targetWasLost = true;
- // Не ищем новую цель до повторного нажатия!
last_punch_angle = {0,0,0}; // сброс rcs
}
else {
@@ -298,31 +307,25 @@ void Aimbot() {
QAngle_t angle = CalcAngles(target_pos, lep);
angle.x *= -1.f;
angle.y += 180.f;
- QAngle_t ang_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
- if (isShooting) {
- last_punch_angle = ang_punch_angle;
+ QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
+ // --- RCS ---
+ bool rcsActive = false;
+ if (Config::shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
+ rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
+ } else {
+ rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > Config::rcsActivationShots);
+ }
+ if (rcsActive && shotCount > 1) {
+ // Для прямого изменения viewangles: делить НЕ нужно
+ //QAngle_t punchDelta = cur_punch_angle - last_punch_angle;
+ //g_DebugString = "debug: " + std::to_string(punchDelta.x);
+ angle -= cur_punch_angle * 2.f;
+ last_punch_angle = cur_punch_angle;
} else {
last_punch_angle = {0,0,0};
}
- // --- RCS ---
- bool rcsActive = (Config::rcs || Config::shooterAfterAim) && (shotCount > 1);
- if (rcsActive)
- angle -= last_punch_angle * 2.f;
angle.z = 0.f;
angle = angle.Normalize();
- // --- RCS ---
- QAngle_t delta = (angle - *viewangles).Normalize();
- if (rcsActive) {
- float smooth_rcs = Config::aimbot_smooth;
- if (Config::aimbot_dynamic_smooth) {
- float fov = sqrtf(delta.x * delta.x + delta.y * delta.y);
- float maxFov = Config::aimbot_fov;
- float factor = (maxFov > 0.01f) ? (fov / maxFov) : 0.f;
- smooth_rcs = Config::aimbot_smooth + (Config::aimbot_smooth * factor * Config::aimbot_dynamic_smooth_factor);
- }
- smooth_rcs = std::fmax(smooth_rcs / 10.f, 1.0f);
- angle -= last_punch_angle * 2.f * smooth_rcs;
- }
// --- Smooth ---
if (Config::aimbot_smooth > 0.f) {
QAngle_t cur = *viewangles;
@@ -363,12 +366,10 @@ void Aimbot() {
const uint32_t hash = HASH(_class->szName);
if (hash == HASH("C_CSPlayerPawn")) {
C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
- if (pawn->get_entity_by_handle() == lp->get_entity_by_handle())
- continue;
- if (pawn->getHealth() <= 0)
- continue;
- if (Config::team_check && pawn->getTeam() == lp->getTeam())
- continue;
+ if (!pawn) continue;
+ if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
+ if (pawn->getHealth() <= 0) continue;
+ if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
Vector_t target_pos = GetEntityEyePos(pawn);//GetAimbotTargetPos(pawn, lep);
QAngle_t angle = CalcAngles(target_pos, lep);
angle.x *= -1.f;
@@ -387,26 +388,139 @@ void Aimbot() {
}
prevAimbotState = aimbotActive;
-
- //if (Config::shooterAfterAim) {
- // if (g_ShowMenu) return;
- // C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
- // bool onEnemy = false;
- // if (lp) {
- // int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
- // if (crosshairIdx > 0) {
- // auto target = I::GameEntity->Instance->Get(crosshairIdx);
- // if (target && target->getHealth() > 0 && (!Config::team_check || target->getTeam() != lp->getTeam()))
- // onEnemy = true;
- // }
- // }
- // // Если врага нет под прицелом — всегда блокируем ЛКМ
- // if (!onEnemy && (GetAsyncKeyState(VK_LBUTTON) & 0x8000)) {
- // INPUT input = { 0 };
- // input.type = INPUT_MOUSE;
- // input.mi.dwFlags = MOUSEEVENTF_LEFTUP;
- // SendInput(1, &input, sizeof(INPUT));
- // }
- // // return; // Не делаем return, чтобы аимбот работал всегда
- //}
+}
+
+void SilentAimbot(CUserCmd* pCmd) {
+ if (!Config::silent_aim || !pCmd) return;
+ static C_CSPlayerPawn* lockedTarget = nullptr;
+ static bool prevSilentState = false;
+ static QAngle_t last_punch_angle = {0,0,0};
+ static int shotCount = 0;
+ C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
+ if (!lp || !lp->handle().valid() || lp->getHealth() <= 0) return;
+ Vector_t lep = GetEntityEyePos(lp);
+ QAngle_t* cur = (QAngle_t*)(modules.getModule("client") + 0x1A78650);
+ if (!cur) return;
+ bool silentActive = Config::always_on_silent_aim ? true : (GetAsyncKeyState(Config::silent_aim_key) & 0x8000);
+ // --- shooterAfterAim + triggerbot_key для сайлент аимбота ---
+ if (Config::silent_shooterAfterAim && (GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
+ silentActive = true;
+ }
+ int shotsFired = lp ? lp->getShotsFired() : 0;
+ shotCount = shotsFired;
+
+ // Если кнопка только что нажата — ищем новую цель
+ if (silentActive && !prevSilentState) {
+ int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
+ float bestFov = Config::aimbot_fov;
+ C_CSPlayerPawn* bestTarget = nullptr;
+ QAngle_t bestAngle = { 0, 0, 0 };
+ for (int i = 1; i <= nMaxHighestEntity; i++) {
+ auto Entity = I::GameEntity->Instance->Get(i);
+ if (!Entity) continue;
+ if (!Entity->handle().valid()) continue;
+ SchemaClassInfoData_t* _class = nullptr;
+ Entity->dump_class_info(&_class);
+ if (!_class) continue;
+ const uint32_t hash = HASH(_class->szName);
+ if (hash == HASH("C_CSPlayerPawn")) {
+ C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
+ if (!pawn) continue;
+ if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
+ if (pawn->getHealth() <= 0) continue;
+ if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
+ Vector_t target_pos = GetAimbotTargetPos(pawn, lep, *cur);
+ QAngle_t angle = CalcAngles(target_pos, lep);
+ angle.x *= -1.f;
+ angle.y += 180.f;
+ float fov = GetFov(*cur, angle);
+ if (!std::isfinite(fov) || fov > bestFov) continue;
+ bestFov = fov;
+ bestTarget = pawn;
+ bestAngle = angle;
+ }
+ }
+ lockedTarget = bestTarget;
+ last_punch_angle = {0,0,0};
+ }
+
+ // Если кнопка зажата, цели нет — постоянный поиск цели
+ if (silentActive && !lockedTarget) {
+ int nMaxHighestEntity = I::GameEntity->Instance->GetHighestEntityIndex();
+ float bestFov = Config::aimbot_fov;
+ C_CSPlayerPawn* bestTarget = nullptr;
+ QAngle_t bestAngle = { 0, 0, 0 };
+ for (int i = 1; i <= nMaxHighestEntity; i++) {
+ auto Entity = I::GameEntity->Instance->Get(i);
+ if (!Entity) continue;
+ if (!Entity->handle().valid()) continue;
+ SchemaClassInfoData_t* _class = nullptr;
+ Entity->dump_class_info(&_class);
+ if (!_class) continue;
+ const uint32_t hash = HASH(_class->szName);
+ if (hash == HASH("C_CSPlayerPawn")) {
+ C_CSPlayerPawn* pawn = (C_CSPlayerPawn*)Entity;
+ if (!pawn) continue;
+ if (pawn->get_entity_by_handle() == lp->get_entity_by_handle()) continue;
+ if (pawn->getHealth() <= 0) continue;
+ if (Config::team_check && pawn->getTeam() == lp->getTeam()) continue;
+ Vector_t target_pos = GetAimbotTargetPos(pawn, lep, *cur);
+ QAngle_t angle = CalcAngles(target_pos, lep);
+ angle.x *= -1.f;
+ angle.y += 180.f;
+ float fov = GetFov(*cur, angle);
+ if (!std::isfinite(fov) || fov > bestFov) continue;
+ bestFov = fov;
+ bestTarget = pawn;
+ bestAngle = angle;
+ }
+ }
+ lockedTarget = bestTarget;
+ last_punch_angle = {0,0,0};
+ }
+
+ // Если кнопка отпущена — сбрасываем захват
+ if (!silentActive) {
+ lockedTarget = nullptr;
+ last_punch_angle = {0,0,0};
+ }
+
+ // Если есть захваченная цель и кнопка удерживается
+ if (silentActive && lockedTarget) {
+ // Проверяем, что цель всё ещё валидна
+ if (!lp || !lp->handle().valid() || lp->getHealth() <= 0 ||
+ lockedTarget->get_entity_by_handle() == lp->get_entity_by_handle() ||
+ lockedTarget->getHealth() <= 0 ||
+ !lockedTarget->handle().valid() ||
+ (Config::team_check && lockedTarget->getTeam() == lp->getTeam())) {
+ lockedTarget = nullptr;
+ last_punch_angle = {0,0,0};
+ prevSilentState = silentActive;
+ return;
+ }
+ Vector_t target_pos = GetAimbotTargetPos(lockedTarget, lep, *cur);
+ QAngle_t angle = CalcAngles(target_pos, lep);
+ angle.x *= -1.f;
+ angle.y += 180.f;
+ //QAngle_t cur_punch_angle = *(QAngle_t*)((uintptr_t)lp + SchemaFinder::Get(hash_32_fnv1a_const("C_CSPlayerPawn->m_aimPunchAngle")));
+ //// --- RCS ---
+ //bool rcsActive = (Config::rcs || Config::silent_shooterAfterAim) && (shotCount > Config::rcsActivationShots);
+ //if (rcsActive && shotCount > 1) {
+ // angle -= cur_punch_angle * 2.f;
+ // last_punch_angle = cur_punch_angle;
+ //} else {
+ // last_punch_angle = {0,0,0};
+ //}
+ //angle.z = 0.f;
+ //angle = angle.Normalize();
+ // --- Smooth ---
+ if (Config::silent_aim_smooth > 0.f) {
+ QAngle_t delta = (angle - *cur).Normalize();
+ float smooth = Config::silent_aim_smooth;
+ angle = *cur + delta * (1.f / smooth);
+ angle = angle.Normalize();
+ }
+ *cur = angle;
+ }
+ prevSilentState = silentActive;
}
diff --git a/TempleWare-CS2/source/templeware/features/aim/aim.h b/TempleWare-CS2/source/templeware/features/aim/aim.h
index 1dadf42..2d4fff9 100644
--- a/TempleWare-CS2/source/templeware/features/aim/aim.h
+++ b/TempleWare-CS2/source/templeware/features/aim/aim.h
@@ -1,3 +1,6 @@
#pragma once
+#include "CUserCmd.h"
+
void Aimbot();
+void SilentAimbot(CUserCmd* pCmd);
diff --git a/TempleWare-CS2/source/templeware/features/spectators/spectators.cpp b/TempleWare-CS2/source/templeware/features/spectators/spectators.cpp
new file mode 100644
index 0000000..fa8e491
--- /dev/null
+++ b/TempleWare-CS2/source/templeware/features/spectators/spectators.cpp
@@ -0,0 +1,120 @@
+#include "spectators.h"
+#include "../../interfaces/interfaces.h"
+#include "../../hooks/hooks.h"
+#include "../../../../external/imgui/imgui.h"
+#include "../../../cs2/entity/CCSPlayerController/CCSPlayerController.h"
+#include "../visuals/visuals.h"
+#include "../../menu/hud.h"
+#include
+#include
+#include "../../players/players.h"
+#include "../../../cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h"
+
+namespace Spectators {
+
+ bool IsPlayerSpectatingYou(CCSPlayerController* controller, C_CSPlayerPawn* localPlayer) {
+ if (!controller || !localPlayer) return false;
+ if (controller->IsLocalPlayer()) return false;
+
+ uintptr_t pObserverServices = *reinterpret_cast(
+ reinterpret_cast(controller) +
+ SchemaFinder::Get(hash_32_fnv1a_const("CCSPlayerController->m_pObserverServices"))
+ );
+ if (!pObserverServices) return false;
+
+ CBaseHandle hObserverTarget = *reinterpret_cast(
+ pObserverServices +
+ SchemaFinder::Get(hash_32_fnv1a_const("CPlayer_ObserverServices->m_hObserverTarget"))
+ );
+ if (!hObserverTarget.valid()) return false;
+
+ g_DebugString = "pObserverServices";
+
+ // Получаем указатель на pawn, за которым наблюдают
+ auto* observerPawn = reinterpret_cast(
+ I::GameEntity->Instance->Get(hObserverTarget.index())
+ );
+ if (!observerPawn) return false;
+
+ g_DebugString = "pObserverServices";
+
+ g_DebugString = observerPawn->handle().index() + " " + localPlayer->handle().index();
+ // Сравниваем указатели
+ return observerPawn->handle().index() == localPlayer->handle().index();
+ }
+
+ std::vector GetSpectators() {
+ std::vector spectators;
+ if (!H::oGetLocalPlayer || !I::GameEntity || !I::GameEntity->Instance) {
+ g_DebugString = "[Spectators] Не инициализированы (GetSpectators): "
+ + std::string(!H::oGetLocalPlayer ? "oGetLocalPlayer " : "")
+ + std::string(!I::GameEntity ? "GameEntity " : "")
+ + std::string((I::GameEntity && !I::GameEntity->Instance) ? "GameEntity->Instance " : "");
+ return spectators;
+ }
+ C_CSPlayerPawn* localPlayer = H::oGetLocalPlayer(0);
+ if (!localPlayer) {
+ g_DebugString = "[Spectators] localPlayer nullptr (GetSpectators)";
+ return spectators;
+ }
+
+ int maxIdx = I::GameEntity->Instance->GetHighestEntityIndex();
+
+ for (int i = 1; i <= maxIdx; ++i) {
+ auto* entity = I::GameEntity->Instance->Get(i);
+ if (!entity) continue;
+ SchemaClassInfoData_t* classInfo = nullptr;
+ entity->dump_class_info(&classInfo);
+ if (!classInfo || strcmp(classInfo->szName, "CCSPlayerController") != 0)
+ continue;
+ auto* controller = reinterpret_cast(entity);
+ if (!controller) continue;
+ if (!controller->m_hPawn().valid()) continue;
+
+ if (!IsPlayerSpectatingYou(controller, localPlayer))
+ continue;
+
+ const char* nameStr = controller->m_sSanitizedPlayerName();
+ std::string name = (nameStr && strlen(nameStr) > 0) ? nameStr : "Unknown";
+
+ spectators.emplace_back(name, false, 0, 0);
+ }
+ return spectators;
+ }
+
+ void RenderPlayersDebugList() {
+ ImGui::Begin("Players Debug List", nullptr, ImGuiWindowFlags_AlwaysAutoResize);
+ if (!H::oGetLocalPlayer) {
+ ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] oGetLocalPlayer не инициализирован");
+ ImGui::End();
+ return;
+ }
+ if (!I::GameEntity) {
+ ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] GameEntity не инициализирован");
+ ImGui::End();
+ return;
+ }
+ if (!I::GameEntity->Instance) {
+ ImGui::TextColored(ImVec4(1, 0, 0, 1), "[Spectators] GameEntity->Instance не инициализирован");
+ ImGui::End();
+ return;
+ }
+ //if (!g_DebugString.empty()) {
+ // ImGui::TextColored(ImVec4(1, 0, 0, 1), "%s", g_DebugString.c_str());
+ // ImGui::End();
+ // return;
+ //}
+ ImGui::Text("Name | Team | Alive | Spectating You");
+ ImGui::Separator();
+ auto spectators = GetSpectators();
+ for (const auto& spectator : spectators) {
+ ImGui::Text("%-20s | %4d | %5s | %s",
+ spectator.name.c_str(),
+ spectator.team,
+ spectator.isAlive ? "yes" : "no",
+ "yes"); // Все из GetSpectators наблюдают за вами
+ }
+ ImGui::End();
+ }
+
+} // namespace Spectators
\ No newline at end of file
diff --git a/TempleWare-CS2/source/templeware/features/spectators/spectators.h b/TempleWare-CS2/source/templeware/features/spectators/spectators.h
new file mode 100644
index 0000000..f23dc5a
--- /dev/null
+++ b/TempleWare-CS2/source/templeware/features/spectators/spectators.h
@@ -0,0 +1,23 @@
+#pragma once
+#include "../../../../external/imgui/imgui.h"
+#include "../../../cs2/entity/C_CSPlayerPawn/C_CSPlayerPawn.h"
+#include "../../../cs2/entity/C_BaseEntity/C_BaseEntity.h"
+#include "../../config/config.h"
+#include "../../../cs2/entity/CCSPlayerController/CCSPlayerController.h"
+
+struct SpectatorInfo {
+ std::string name;
+ bool isLocalPlayer;
+ int team;
+ bool isAlive;
+
+ SpectatorInfo(const std::string& n, bool local, int t, bool alive)
+ : name(n), isLocalPlayer(local), team(t), isAlive(alive) {}
+};
+
+namespace Spectators {
+ void RenderSpectatorList();
+ std::vector GetSpectators();
+ bool IsPlayerSpectatingYou(CCSPlayerController* controller, C_CSPlayerPawn* localPlayer);
+ void RenderPlayersDebugList();
+}
\ No newline at end of file
diff --git a/TempleWare-CS2/source/templeware/features/triggerbot/triggerbot.cpp b/TempleWare-CS2/source/templeware/features/triggerbot/triggerbot.cpp
index 3a867ea..ba83411 100644
--- a/TempleWare-CS2/source/templeware/features/triggerbot/triggerbot.cpp
+++ b/TempleWare-CS2/source/templeware/features/triggerbot/triggerbot.cpp
@@ -32,67 +32,137 @@ void SimulateLMBUp() {
SendInput(1, &input, sizeof(INPUT));
}
+// Управление удержанием ЛКМ
+void SetLMBHeld(bool held) {
+ static bool lmbHeld = false;
+ if (held && !lmbHeld) {
+ SimulateLMBDown();
+ lmbHeld = true;
+ } else if (!held && lmbHeld) {
+ SimulateLMBUp();
+ lmbHeld = false;
+ }
+}
+
static DWORD lastShotTime = 0;
void Triggerbot() {
static DWORD lastShotTime = 0;
- static bool lmbHeld = false;
static bool firstShot = true;
+ // --- Альтернативная кнопка: триггербот по наведению на врага с задержкой ---
+ if (Config::triggerbot_alt_key && (GetAsyncKeyState(Config::triggerbot_alt_key) & 0x8000)) {
+ C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
+ if (!lp || lp->getHealth() <= 0) { SetLMBHeld(false); return; }
+ int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
+ if (crosshairIdx <= 0) { SetLMBHeld(false); return; }
+ auto target = I::GameEntity->Instance->Get(crosshairIdx);
+ if (!target) { SetLMBHeld(false); return; }
+ if (target->getHealth() <= 0) { SetLMBHeld(false); return; }
+ if (Config::team_check && target->getTeam() == lp->getTeam()) { SetLMBHeld(false); return; }
+ DWORD64 now = GetTickCount64();
+ static DWORD64 lastAltShotTime = 0;
+ if (now - lastAltShotTime < static_cast(Config::triggerbot_delay)) {
+ SetLMBHeld(false);
+ return;
+ }
+ SimulateLMBClick();
+ lastAltShotTime = now;
+ return;
+ }
if (!Config::triggerbot)
return;
- if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000))
+ if (!Config::always_on_triggerbot && Config::triggerbot_key && !(GetAsyncKeyState(Config::triggerbot_key) & 0x8000)) {
+ SetLMBHeld(false);
+ firstShot = true;
return;
+ }
if (GetAsyncKeyState(VK_LBUTTON) & 0x8000) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
- }
+ SetLMBHeld(false);
firstShot = true;
return;
}
C_CSPlayerPawn* lp = H::oGetLocalPlayer(0);
- if (!lp || lp->getHealth() <= 0) { firstShot = true; return; }
+ if (!lp || lp->getHealth() <= 0) { firstShot = true; SetLMBHeld(false); return; }
int crosshairIdx = *(int*)((uintptr_t)lp + 0x1458); // m_iIDEntIndex
- //g_DebugString = "debug: " + std::to_string(crosshairIdx);
- if (crosshairIdx <= 0) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
+ int shotsFired = lp ? lp->getShotsFired() : 0;
+ DWORD64 now = GetTickCount64();
+ if (Config::shooterAfterAim) {
+ if (shotsFired > 0) {
+ // После первого выстрела просто удерживаем ЛКМ, игнорируя все условия
+ SetLMBHeld(true);
+ return;
+ } else {
+ // До первого выстрела — обычная логика триггербота
+ if (crosshairIdx <= 0) {
+ SetLMBHeld(false);
+ firstShot = true;
+ return;
+ }
+ auto target = I::GameEntity->Instance->Get(crosshairIdx);
+ if (!target) {
+ SetLMBHeld(false);
+ firstShot = true;
+ return;
+ }
+ if (target->getHealth() <= 0) {
+ SetLMBHeld(false);
+ firstShot = true;
+ return;
+ }
+ if (Config::team_check && target->getTeam() == lp->getTeam()) {
+ SetLMBHeld(false);
+ firstShot = true;
+ return;
+ }
+ if (!Config::triggerbot_hold_lmb) {
+ if (now - lastShotTime < static_cast(Config::triggerbot_delay)) {
+ SetLMBHeld(false);
+ firstShot = true;
+ return;
+ }
+ }
+ if (Config::triggerbot_hold_lmb) {
+ if (firstShot) {
+ SimulateLMBClick();
+ firstShot = false;
+ lastShotTime = now;
+ return;
+ } else {
+ SetLMBHeld(true);
+ }
+ lastShotTime = now;
+ return;
+ }
+ SimulateLMBClick();
+ lastShotTime = now;
+ firstShot = true;
+ return;
}
+ }
+ // --- Обычная логика триггербота, если shooterAfterAim выключен ---
+ if (crosshairIdx <= 0) {
+ SetLMBHeld(false);
firstShot = true;
return;
}
auto target = I::GameEntity->Instance->Get(crosshairIdx);
if (!target) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
- }
+ SetLMBHeld(false);
firstShot = true;
return;
}
if (target->getHealth() <= 0) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
- }
+ SetLMBHeld(false);
firstShot = true;
return;
}
if (Config::team_check && target->getTeam() == lp->getTeam()) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
- }
+ SetLMBHeld(false);
firstShot = true;
return;
}
- DWORD64 now = GetTickCount64();
if (!Config::triggerbot_hold_lmb) {
if (now - lastShotTime < static_cast(Config::triggerbot_delay)) {
- if (lmbHeld) {
- SimulateLMBUp();
- lmbHeld = false;
- }
+ SetLMBHeld(false);
firstShot = true;
return;
}
@@ -103,9 +173,8 @@ void Triggerbot() {
firstShot = false;
lastShotTime = now;
return;
- } else if (!lmbHeld) {
- SimulateLMBDown();
- lmbHeld = true;
+ } else {
+ SetLMBHeld(true);
}
lastShotTime = now;
return;
diff --git a/TempleWare-CS2/source/templeware/features/visuals/visuals.cpp b/TempleWare-CS2/source/templeware/features/visuals/visuals.cpp
index 5eafb26..09c7b40 100644
--- a/TempleWare-CS2/source/templeware/features/visuals/visuals.cpp
+++ b/TempleWare-CS2/source/templeware/features/visuals/visuals.cpp
@@ -40,20 +40,16 @@ void Esp::cache()
if (!entityInfo) continue;
if (strcmp(entityInfo->szName, "C_CSPlayerPawn") == 0) {
- bool exists = std::any_of(Players::pawns.begin(), Players::pawns.end(),
- [&](const C_CSPlayerPawn& pawn) { return pawn.getAddress() == entityPointer; });
- if (!exists) {
- Players::pawns.emplace_back(entityPointer);
+ if (!Players::pawns.contains(entityPointer)) {
+ Players::pawns.insert(entityPointer);
std::cout << "Added pawn " << Players::pawns.size() << "\n";
}
continue;
}
if (strcmp(entityInfo->szName, "CCSPlayerController") == 0) {
- bool exists = std::any_of(Players::controllers.begin(), Players::controllers.end(),
- [&](const CCSPlayerController& controller) { return controller.getAddress() == entityPointer; });
- if (!exists) {
- Players::controllers.emplace_back(entityPointer);
+ if (!Players::controllers.contains(entityPointer)) {
+ Players::controllers.insert(entityPointer);
}
continue;
}
diff --git a/TempleWare-CS2/source/templeware/hooks/hooks.cpp b/TempleWare-CS2/source/templeware/hooks/hooks.cpp
index a3797f8..79cb2b8 100644
--- a/TempleWare-CS2/source/templeware/hooks/hooks.cpp
+++ b/TempleWare-CS2/source/templeware/hooks/hooks.cpp
@@ -27,9 +27,6 @@ void __fastcall H::hkFrameStageNotify(void* a1, int stage)
// frame_render_stage | 9
if (stage == 9 && oGetLocalPlayer(0)) {
Esp::cache();
-
- Aimbot();
- Triggerbot(); // <--- вызов триггербота
}
}
@@ -41,6 +38,13 @@ void* __fastcall H::hkLevelInit(void* pClientModeShared, const char* szNewMap) {
return LevelInit.GetOriginal()(pClientModeShared, szNewMap);
}
+bool __fastcall H::hkCreateMove(void* pInput, int nSlot, void* pCmd) {
+ //Aimbot();
+ SilentAimbot(reinterpret_cast(pCmd));
+ Triggerbot();
+ return CreateMove.GetOriginal()(pInput, nSlot, pCmd);
+}
+
void H::Hooks::init() {
oGetWeaponData = *reinterpret_cast(M::patternScan("client", ("48 8B 81 ? ? ? ? 85 D2 78 ? 48 83 FA ? 73 ? F3 0F 10 84 90 ? ? ? ? C3 F3 0F 10 80 ? ? ? ? C3 CC CC CC CC")) + 0x3);
@@ -53,6 +57,7 @@ void H::Hooks::init() {
GetRenderFov.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? F3 0F 11 45 00 48 8B 5C 24 40"), 1), &hkGetRenderFov);
LevelInit.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? C6 83 ? ? ? ? ? C6 83"), 1), &hkLevelInit);
RenderFlashBangOverlay.Add((void*)M::patternScan("client", ("85 D2 0F 88 ? ? ? ? 55 56 41 55")), &hkRenderFlashbangOverlay);
+ CreateMove.Add((void*)M::patternScan("client", ("48 8B C4 4C 89 40 18 48 89 48 08 55 53 57 41 54 48 8D A8")), &hkCreateMove);
MH_EnableHook(MH_ALL_HOOKS);
}
diff --git a/TempleWare-CS2/source/templeware/hooks/hooks.h b/TempleWare-CS2/source/templeware/hooks/hooks.h
index f1be6d0..936f7b5 100644
--- a/TempleWare-CS2/source/templeware/hooks/hooks.h
+++ b/TempleWare-CS2/source/templeware/hooks/hooks.h
@@ -16,6 +16,7 @@ namespace H {
void* __fastcall hkLevelInit(void* pClientModeShared, const char* szNewMap);
void __fastcall hkChamsObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
void __fastcall hkRenderFlashbangOverlay(void* a1, void* a2, void* a3, void* a4, void* a5);
+ bool __fastcall hkCreateMove(void* pInput, int nSlot, void* pCmd);
inline float g_flActiveFov;
float hkGetRenderFov(void* rcx);
@@ -25,6 +26,7 @@ namespace H {
inline CInlineHookObj GetRenderFov = { };
inline CInlineHookObj LevelInit = { };
inline CInlineHookObj RenderFlashBangOverlay = { };
+ inline CInlineHookObj CreateMove = { };
// inline hooks
inline int oGetWeaponData;
diff --git a/TempleWare-CS2/source/templeware/menu/hud.cpp b/TempleWare-CS2/source/templeware/menu/hud.cpp
index 098cf12..c184bac 100644
--- a/TempleWare-CS2/source/templeware/menu/hud.cpp
+++ b/TempleWare-CS2/source/templeware/menu/hud.cpp
@@ -6,6 +6,7 @@
#include
#include
#include
+#include "../features/spectators/spectators.h"
std::string g_DebugString;
@@ -79,4 +80,16 @@ void Hud::render() {
ImU32 debugColor = IM_COL32(255, 255, 0, 255); // жёлтый
ImGui::GetBackgroundDrawList()->AddText(debugPos, debugColor, g_DebugString.c_str());
}
+
+ // Отображение списка наблюдателей
+ //Spectators::RenderSpectatorList();
+ //Spectators::RenderPlayersDebugList();
+
+
+ // Тестовая информация для отладки
+ //static int testCounter = 0;
+ //testCounter++;
+ //if (testCounter % 60 == 0) { // Каждую секунду (при 60 FPS)
+ // g_DebugString = "Spectator test: " + std::to_string(Spectators::GetSpectators().size()) + " players found";
+ //}
}
\ No newline at end of file
diff --git a/TempleWare-CS2/source/templeware/menu/hud.h b/TempleWare-CS2/source/templeware/menu/hud.h
index a5af872..8eac84b 100644
--- a/TempleWare-CS2/source/templeware/menu/hud.h
+++ b/TempleWare-CS2/source/templeware/menu/hud.h
@@ -1,5 +1,6 @@
#pragma once
#include
+#include "../features/spectators/spectators.h"
extern std::string g_DebugString;
class Hud {
diff --git a/TempleWare-CS2/source/templeware/menu/menu.cpp b/TempleWare-CS2/source/templeware/menu/menu.cpp
index a6d5fa0..e43dd57 100644
--- a/TempleWare-CS2/source/templeware/menu/menu.cpp
+++ b/TempleWare-CS2/source/templeware/menu/menu.cpp
@@ -131,10 +131,10 @@ void Menu::render() {
ImGui::Separator();
- const char* tabNames[] = { "Aim", "Visuals", "Misc", "Config" };
+ const char* tabNames[] = { "Aim", "Silent Aim", "Visuals", "Misc", "Config" };
if (ImGui::BeginTabBar("MainTabBar", ImGuiTabBarFlags_NoTooltip)) {
- for (int i = 0; i < 4; i++) {
+ for (int i = 0; i < 5; i++) {
if (ImGui::BeginTabItem(tabNames[i])) {
activeTab = i;
ImGui::EndTabItem();
@@ -164,6 +164,7 @@ void Menu::render() {
ImGui::Checkbox("Team Check", &Config::team_check);
ImGui::Checkbox("Aimbot on LMB", &Config::aimbot_on_lmb);
ImGui::SliderFloat("Smooth", &Config::aimbot_smooth, 0.f, 10.f, "%.2f");
+ ImGui::SliderFloat("Aimbot FOV", &Config::aimbot_fov, 1.f, 180.f, "%1.0f");
ImGui::Checkbox("Dynamic Smooth", &Config::aimbot_dynamic_smooth);
if (Config::aimbot_dynamic_smooth) {
ImGui::SliderFloat("Dynamic Smooth Factor", &Config::aimbot_dynamic_smooth_factor, 0.1f, 25.0f, "%.2f");
@@ -173,6 +174,7 @@ void Menu::render() {
ImGui::ColorEdit4("Circle Color##FovColor", (float*)&Config::fovCircleColor);
}
ImGui::Checkbox("Recoil Control", &Config::rcs);
+ ImGui::SliderInt("RCS Activation Shots", &Config::rcsActivationShots, 0, 10);
ImGui::EndChild();
ImGui::SameLine();
@@ -186,12 +188,35 @@ void Menu::render() {
ImGui::Text("Key:");
ImGui::SameLine();
keybind.menuButton(Config::triggerbot_key);
+ ImGui::Text("Alt Key:");
+ ImGui::SameLine();
+ keybind.menuButton(Config::triggerbot_alt_key);
ImGui::SliderFloat("Delay (ms)", &Config::triggerbot_delay, 0.0f, 500.0f, "%.0f");
ImGui::EndChild();
}
break;
- case 1:
+ case 1: // Silent Aim
+ {
+ ImGui::BeginChild("SilentAimLeft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f - 5, 0), true);
+ ImGui::Text("Silent Aim");
+ ImGui::Separator();
+ ImGui::Checkbox("Enable##SilentAim", &Config::silent_aim);
+ const char* boneNames[] = { "Head", "Neck", "Body", "Nearest" };
+ ImGui::Combo("Silent Aim Bone", &Config::silent_aim_bone, boneNames, IM_ARRAYSIZE(boneNames));
+ ImGui::Text("Key:");
+ ImGui::SameLine();
+ keybind.menuButton(Config::silent_aim_key);
+ ImGui::Checkbox("Always On##SilentAim", &Config::always_on_silent_aim);
+ ImGui::Checkbox("Shooter After Aim##Silent", &Config::silent_shooterAfterAim); // Новый чекбокс
+ ImGui::SliderFloat("Smooth##SilentAim", &Config::silent_aim_smooth_slider, 0.f, 10.f, "%.2f");
+ Config::silent_aim_smooth = Config::silent_aim_smooth_slider; // Применяем значение ползунка к логике
+ ImGui::SliderFloat("Silent Aim FOV", &Config::silent_aim_fov, 1.f, 180.f, "%1.0f");
+ ImGui::EndChild();
+ }
+ break;
+
+ case 2:
{
ImGui::BeginChild("VisualsLeft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f - 5, 0), true);
ImGui::Text("Player ESP");
@@ -208,6 +233,17 @@ void Menu::render() {
ImGui::Checkbox("Health Bar", &Config::showHealth);
ImGui::Checkbox("Name Tags", &Config::showNameTags);
+ ImGui::Spacing();
+ ImGui::Text("Spectators");
+ ImGui::Separator();
+
+ ImGui::Checkbox("Show Spectators", &Config::showSpectators);
+ if (Config::showSpectators) {
+ ImGui::ColorEdit4("Spectator Text Color", (float*)&Config::spectatorListColor);
+ ImGui::ColorEdit4("Spectator Background Color", (float*)&Config::spectatorListBgColor);
+ ImGui::SliderFloat("Spectator List Opacity", &Config::spectatorListOpacity, 0.0f, 1.0f, "%.2f");
+ }
+
ImGui::Spacing();
ImGui::Text("World");
ImGui::Separator();
@@ -263,7 +299,7 @@ void Menu::render() {
}
break;
- case 2:
+ case 3:
{
ImGui::BeginChild("MiscLeft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f - 5, 0), true);
ImGui::Text("Movement");
@@ -284,7 +320,7 @@ void Menu::render() {
}
break;
- case 3:
+ case 4:
{
ImGui::BeginChild("ConfigLeft", ImVec2(ImGui::GetContentRegionAvail().x * 0.5f - 5, 0), true);
ImGui::Text("General");
diff --git a/TempleWare-CS2/source/templeware/players/players.cpp b/TempleWare-CS2/source/templeware/players/players.cpp
index 6f850a6..a75f253 100644
--- a/TempleWare-CS2/source/templeware/players/players.cpp
+++ b/TempleWare-CS2/source/templeware/players/players.cpp
@@ -1,5 +1,10 @@
#include "players.h"
#include "../offsets/offsets.h"
-//@not used anymore
-//std::vector Players::controllers;
-//std::vector Players::pawns;
\ No newline at end of file
+#include
+std::unordered_set pawns;
+std::unordered_set controllers;
+
+void ClearAll() {
+ pawns.clear();
+ controllers.clear();
+}
\ No newline at end of file
diff --git a/TempleWare-CS2/source/templeware/players/players.h b/TempleWare-CS2/source/templeware/players/players.h
index 76b0536..f102df2 100644
--- a/TempleWare-CS2/source/templeware/players/players.h
+++ b/TempleWare-CS2/source/templeware/players/players.h
@@ -5,4 +5,10 @@
#include
#include
-//@not used anymore
\ No newline at end of file
+#include
+//@not used anymore
+
+extern std::unordered_set pawns;
+extern std::unordered_set controllers;
+
+void ClearAll();
\ No newline at end of file
diff --git a/examples/cs2-silent-aim-master/.clang-format b/examples/cs2-silent-aim-master/.clang-format
new file mode 100644
index 0000000..984335c
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.clang-format
@@ -0,0 +1,156 @@
+# created by asphyxia for clang-format 15.0.2 version #
+# alphabetically aranged (except global options) #
+# https://clang.llvm.org/docs/ClangFormatStyleOptions.html #
+
+# global options
+DisableFormat: false
+BasedOnStyle: Microsoft
+Language: Cpp
+Standard: c++20
+
+# @todo: remove variables that equal defaults
+
+AccessModifierOffset: -4
+AlignAfterOpenBracket: DontAlign # @test: use false # @note: when set to 'DontAlign', dependent on 'ContinuationIndentWidth'
+AlignArrayOfStructures: None
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
+AlignConsecutiveMacros: None
+AlignEscapedNewlines: Left
+AlignOperands: DontAlign # @test: use false # @note: when set to 'DontAlign', dependent on 'ContinuationIndentWidth'; when set to 'AlignAfterOperator', dependent on 'BreakBeforeBinaryOperators'
+AlignTrailingComments: false
+AllowAllArgumentsOnNextLine: false # @note: ignores 'BinPackArguments'
+AllowAllParametersOfDeclarationOnNextLine: false # @note: ignores 'BinPackArguments'
+AllowShortBlocksOnASingleLine: Empty
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortIfStatementsOnASingleLine: Never
+AllowShortLambdasOnASingleLine: Inline
+AllowShortLoopsOnASingleLine: false
+AlwaysBreakAfterReturnType: None # @note: when set to 'None', dependent on 'PenaltyReturnTypeOnItsOwnLine'
+AlwaysBreakBeforeMultilineStrings: false # @note: if true, dependent on 'ContinuationIndentWidth'
+#AlwaysBreakTemplateDeclarations: Yes # @test: to make it work correctly with 'RequiresClausePosition' leave it unspecified # @note: when set to 'No', dependent on 'PenaltyBreakTemplateDeclaration'
+#AttributeMacros: # @todo: tweak
+BinPackArguments: true
+BinPackParameters: true
+BitFieldColonSpacing: Both
+BraceWrapping:
+ AfterCaseLabel: true
+ AfterControlStatement: Always
+ AfterEnum: true
+ AfterFunction: true
+ AfterNamespace: true
+ AfterStruct: true
+ AfterUnion: true
+ AfterExternBlock: true
+ BeforeCatch: true
+ BeforeElse: true
+ BeforeLambdaBody: true
+ BeforeWhile: false
+ IndentBraces: false
+ SplitEmptyFunction: false # @note: dependent on 'AfterFunction' and 'AllowShortFunctionsOnASingleLine'
+ SplitEmptyRecord: false # @note: dependent on 'AfterClass'
+ SplitEmptyNamespace: true # @note: dependent on 'AfterNamespace'
+#BreakAfterAttributes: Never # @todo: clan-format 16
+#BreakArrays: false # @todo: clang-format 16 # @note: supported only for JSON
+BreakBeforeBinaryOperators: None
+BreakBeforeBraces: Custom # @note: when set to 'Custom', dependent on 'BraceWrapping'
+BreakBeforeConceptDeclarations: Never
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializers: AfterColon
+#BreakInheritanceList: AfterComma # @note: to disable this, only leaving it unspecified works
+BreakStringLiterals: false
+ColumnLimit: 0
+CompactNamespaces: false # @test: what if i gonna use nested namespaces like Foo::Bar?
+#ConstructorInitializerIndentWidth: 0 # @test: tweak
+ContinuationIndentWidth: 0
+Cpp11BracedListStyle: false
+DerivePointerAlignment: false # @note: if true, 'PointerAlignment' is only used as a fallback if none can be derived
+EmptyLineAfterAccessModifier: Never # @note: when set to 'Leave' or 'Always', dependent on 'MaxEmptyLinesToKeep'
+EmptyLineBeforeAccessModifier: LogicalBlock
+FixNamespaceComments: false # @note: if true, dependent on 'ShortNamespaceLines'
+IncludeBlocks: Regroup # @note: when set to 'Regroup', dependent on 'IncludeCategories'
+#IncludeCategories: # @todo: tweak
+#IncludeIsMainRegex: # @todo: tweak
+IndentAccessModifiers: false # @note: if false, dependent on 'AccessModifierOffset'; if true, ignores 'AccessModifierOffset'
+IndentCaseBlocks: false
+IndentCaseLabels: false
+IndentExternBlock: AfterExternBlock # @note: when set to 'AfterExternBlock', dependent on 'BraceWrapping.AfterExternBlock'
+IndentGotoLabels: true
+IndentPPDirectives: None
+IndentRequiresClause: false # @note: if true, dependent on 'RequiresClausePosition'
+IndentWidth: 4
+IndentWrappedFunctionNames: true
+InsertBraces: false
+InsertTrailingCommas: None # @note: when set to 'Wrapped', conflicts with 'BinPackArguments'
+KeepEmptyLinesAtTheStartOfBlocks: false
+LambdaBodyIndentation: Signature
+#LineEnding: LF # @todo: clang-format 16
+MaxEmptyLinesToKeep: 1
+NamespaceIndentation: All
+PPIndentWidth: -1 # @note: when set to '-1', dependent on 'IndentWidth'
+PackConstructorInitializers: NextLine # @todo: after clang-format 16 set this to 'NextLineOnly'
+# @test: tweak
+# ---
+PenaltyBreakAssignment: 0
+PenaltyBreakBeforeFirstCallParameter: 0
+PenaltyBreakComment: 0
+PenaltyBreakFirstLessLess: 0
+PenaltyBreakOpenParenthesis: 0
+PenaltyBreakString: 0
+PenaltyBreakTemplateDeclaration: 0
+PenaltyExcessCharacter: 0
+PenaltyIndentedWhitespace: 0
+PenaltyReturnTypeOnItsOwnLine: 0
+# ---
+PointerAlignment: Left
+QualifierAlignment: Custom # @note: when set to 'Custom', dependent on 'QualifierOrder'; warning! setting this option to something other than 'Leave' could lead to incorrect code formatting
+QualifierOrder: ['inline', 'static', 'constexpr', 'const', 'volatile', 'type', 'restrict']
+ReferenceAlignment: Pointer # @note: when set to 'Pointer', dependent on 'PointerAlignment'
+ReflowComments: false
+#RemoveSemicolon: false # @todo: clang-format 16 # @note: warning! setting this option to true could lead to incorrect code formatting
+RequiresClausePosition: WithPreceding # @test: this doesn't seem to work correctly when 'AlwaysBreakTemplateDeclarations' is set
+#RequiresExpressionIndentation: OuterScope # @todo: clang-format 16
+SeparateDefinitionBlocks: Always # @todo: use 'Leave'?
+ShortNamespaceLines: 0
+SortIncludes: Never # @test: CaseInsensitive
+SortUsingDeclarations: true # @todo: after clang-format 16 change to 'Lexicographic'
+SpaceAfterCStyleCast: false
+SpaceAfterLogicalNot: false
+SpaceAfterTemplateKeyword: true
+SpaceAroundPointerQualifiers: Default # @note: when set to 'Default', dependent on 'PointerAlignment'
+SpaceBeforeAssignmentOperators: true
+SpaceBeforeCaseColon: false
+SpaceBeforeCpp11BracedList: false
+SpaceBeforeCtorInitializerColon: true
+SpaceBeforeInheritanceColon: true
+SpaceBeforeParens: Custom # @note: when set to 'Custom', dependent on 'SpaceBeforeParensOptions'
+SpaceBeforeParensOptions:
+ AfterControlStatements: true
+ AfterForeachMacros: false
+ AfterFunctionDeclarationName: false
+ AfterIfMacros: false
+ AfterOverloadedOperator: false
+ AfterRequiresInClause: true
+ AfterRequiresInExpression: false
+ BeforeNonEmptyParentheses: false
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceBeforeSquareBrackets: false
+SpaceInEmptyBlock: true # @todo: this doesn't work for braced initilization for some reason
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1 # @test: tweak
+SpacesInAngles: Never
+SpacesInCStyleCastParentheses: false
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
+SpacesInLineCommentPrefix: # @note: dependent on 'ReflowComments'
+ Minimum: 1
+ Maximum: -1
+SpacesInParentheses: false
+SpacesInSquareBrackets: false
+#TabWidth: # @todo: tweak or leave it as it is
+UseCRLF: false # @todo: remove after clang-format 16
+UseTab: Always # @todo: tweak
+#WhitespaceSensitiveMacros: # @todo: tweak
diff --git a/examples/cs2-silent-aim-master/.editorconfig b/examples/cs2-silent-aim-master/.editorconfig
new file mode 100644
index 0000000..f2d59c0
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.editorconfig
@@ -0,0 +1,74 @@
+root = true
+
+[*]
+# Default parameters
+indent_style = tab
+indent_size = 4
+end_of_line = lf
+trim_trailing_whitespace = true
+insert_final_newline = true
+
+[*.{c,cc,cpp,cppm,cxx,h,hh,hpp,hxx,inl,ipp,ixx,tlh,tli,hlsl,hlsli}]
+
+# Code style parameters Visual C++
+cpp_generate_documentation_comments = doxygen_triple_slash
+
+# Formatting parameters Visual C++
+cpp_indent_braces = false
+cpp_indent_multi_line_relative_to = innermost_parenthesis
+cpp_indent_within_parentheses = indent
+cpp_indent_preserve_within_parentheses = true
+cpp_indent_case_contents = true
+cpp_indent_case_labels = false
+cpp_indent_case_contents_when_block = false
+cpp_indent_lambda_braces_when_parameter = true
+cpp_indent_goto_labels = one_left
+cpp_indent_preprocessor = leftmost_column
+cpp_indent_access_specifiers = false
+cpp_indent_namespace_contents = true
+cpp_indent_preserve_comments = false
+cpp_new_line_before_open_brace_namespace = new_line
+cpp_new_line_before_open_brace_type = new_line
+cpp_new_line_before_open_brace_function = new_line
+cpp_new_line_before_open_brace_block = new_line
+cpp_new_line_before_open_brace_lambda = ignore
+cpp_new_line_scope_braces_on_separate_lines = true
+cpp_new_line_close_brace_same_line_empty_type = true
+cpp_new_line_close_brace_same_line_empty_function = true
+cpp_new_line_before_catch = true
+cpp_new_line_before_else = true
+cpp_new_line_before_while_in_do_while = false
+cpp_space_before_function_open_parenthesis = remove
+cpp_space_within_parameter_list_parentheses = false
+cpp_space_between_empty_parameter_list_parentheses = false
+cpp_space_after_keywords_in_control_flow_statements = true
+cpp_space_within_control_flow_statement_parentheses = false
+cpp_space_before_lambda_open_parenthesis = false
+cpp_space_within_cast_parentheses = false
+cpp_space_after_cast_close_parenthesis = false
+cpp_space_within_expression_parentheses = false
+cpp_space_before_block_open_brace = true
+cpp_space_between_empty_braces = true
+cpp_space_before_initializer_list_open_brace = false
+cpp_space_within_initializer_list_braces = true
+cpp_space_preserve_in_initializer_list = true
+cpp_space_before_open_square_bracket = false
+cpp_space_within_square_brackets = false
+cpp_space_before_empty_square_brackets = false
+cpp_space_between_empty_square_brackets = true
+cpp_space_group_square_brackets = true
+cpp_space_within_lambda_brackets = false
+cpp_space_between_empty_lambda_brackets = true
+cpp_space_before_comma = false
+cpp_space_after_comma = true
+cpp_space_remove_around_member_operators = true
+cpp_space_before_inheritance_colon = true
+cpp_space_before_constructor_colon = true
+cpp_space_remove_before_semicolon = true
+cpp_space_after_semicolon = true
+cpp_space_remove_around_unary_operator = true
+cpp_space_around_binary_operator = insert
+cpp_space_around_assignment_operator = insert
+cpp_space_pointer_reference_alignment = left
+cpp_space_around_ternary_operator = insert
+cpp_wrap_preserve_blocks = one_liners
diff --git a/examples/cs2-silent-aim-master/.gitattributes b/examples/cs2-silent-aim-master/.gitattributes
new file mode 100644
index 0000000..4f37c2d
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.gitattributes
@@ -0,0 +1,64 @@
+###############################################################################
+# Set default behavior to automatically normalize line endings.
+###############################################################################
+* text=auto
+
+###############################################################################
+# Set default behavior for command prompt diff.
+#
+# This is need for earlier builds of msysgit that does not have it on by
+# default for csharp files.
+# Note: This is only used by command line
+###############################################################################
+#*.cs diff=csharp
+
+###############################################################################
+# Set the merge driver for project and solution files
+#
+# Merging from the command prompt will add diff markers to the files if there
+# are conflicts (Merging from VS is not affected by the settings below, in VS
+# the diff markers are never inserted). Diff markers may cause the following
+# file extensions to fail to load in VS. An alternative would be to treat
+# these files as binary and thus will always conflict and require user
+# intervention with every merge. To do so, just uncomment the entries below
+###############################################################################
+#*.sln merge=binary
+#*.csproj merge=binary
+#*.vbproj merge=binary
+#*.vcxproj merge=binary
+#*.vcproj merge=binary
+#*.dbproj merge=binary
+#*.fsproj merge=binary
+#*.lsproj merge=binary
+#*.wixproj merge=binary
+#*.modelproj merge=binary
+#*.sqlproj merge=binary
+#*.wwaproj merge=binary
+
+###############################################################################
+# behavior for image files
+#
+# image files are treated as binary by default.
+###############################################################################
+#*.jpg binary
+#*.png binary
+#*.gif binary
+
+###############################################################################
+# diff behavior for common document formats
+#
+# Convert binary document formats to text before diffing them. This feature
+# is only available from the command line. Turn it on by uncommenting the
+# entries below.
+###############################################################################
+#*.doc diff=astextplain
+#*.DOC diff=astextplain
+#*.docx diff=astextplain
+#*.DOCX diff=astextplain
+#*.dot diff=astextplain
+#*.DOT diff=astextplain
+#*.pdf diff=astextplain
+#*.PDF diff=astextplain
+#*.rtf diff=astextplain
+#*.RTF diff=astextplain
+*.h linguist-language=C++
diff --git a/examples/cs2-silent-aim-master/.github/FUNDING.yml b/examples/cs2-silent-aim-master/.github/FUNDING.yml
new file mode 100644
index 0000000..746acc2
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.github/FUNDING.yml
@@ -0,0 +1 @@
+ko_fi: maecry22
diff --git a/examples/cs2-silent-aim-master/.github/ISSUE_TEMPLATE/bug_report.md b/examples/cs2-silent-aim-master/.github/ISSUE_TEMPLATE/bug_report.md
new file mode 100644
index 0000000..99d8964
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.github/ISSUE_TEMPLATE/bug_report.md
@@ -0,0 +1,23 @@
+---
+name: Bug report
+about: Create a report to help us improve
+title: ''
+labels: bug
+assignees: maecry
+
+---
+
+**Describe the bug**
+A clear and concise description of what the bug is.
+
+**To Reproduce**
+Steps to reproduce the behavior:
+
+**Expected behavior**
+A clear and concise description of what you expected to happen.
+
+**Screenshots**
+If applicable, add screenshots to help explain your problem.
+
+**Additional context**
+Add any other context about the problem here.
diff --git a/examples/cs2-silent-aim-master/.github/workflows/msbuild.yml b/examples/cs2-silent-aim-master/.github/workflows/msbuild.yml
new file mode 100644
index 0000000..03ff3a3
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.github/workflows/msbuild.yml
@@ -0,0 +1,24 @@
+name: msbuild
+
+on:
+ push:
+ branches: [ "master" ]
+ pull_request:
+ branches: [ "master" ]
+permissions:
+ contents: read
+jobs:
+ build:
+ runs-on: windows-2022
+ strategy:
+ matrix:
+ toolset: [v143, ClangCL]
+ configuration: [Debug, Release]
+ steps:
+ - name: setup actions
+ uses: actions/checkout@v3
+ - name: setup environment
+ uses: microsoft/setup-msbuild@v1.1
+ - name: build
+ shell: cmd
+ run: msbuild asphyxia.sln /p:Configuration=${{matrix.configuration}} /p:Platform=x64 /p:PlatformToolset=${{ matrix.toolset }}
diff --git a/examples/cs2-silent-aim-master/.gitignore b/examples/cs2-silent-aim-master/.gitignore
new file mode 100644
index 0000000..9491a2f
--- /dev/null
+++ b/examples/cs2-silent-aim-master/.gitignore
@@ -0,0 +1,363 @@
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Ww][Ii][Nn]32/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Oo]ut/
+[Ll]og/
+[Ll]ogs/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUnit
+*.VisualState.xml
+TestResult.xml
+nunit-*.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# ASP.NET Scaffolding
+ScaffoldingReadMe.txt
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Coverlet is a free, cross platform Code Coverage Tool
+coverage*.json
+coverage*.xml
+coverage*.info
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# NuGet Symbol Packages
+*.snupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- [Bb]ackup.rdl
+*- [Bb]ackup ([0-9]).rdl
+*- [Bb]ackup ([0-9][0-9]).rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+# Ionide (cross platform F# VS Code tools) working folder
+.ionide/
+
+# Fody - auto-generated XML schema
+FodyWeavers.xsd
\ No newline at end of file
diff --git a/examples/cs2-silent-aim-master/LICENSE b/examples/cs2-silent-aim-master/LICENSE
new file mode 100644
index 0000000..d3a9b63
--- /dev/null
+++ b/examples/cs2-silent-aim-master/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2023 maecry
+
+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/examples/cs2-silent-aim-master/asphyxia.sln b/examples/cs2-silent-aim-master/asphyxia.sln
new file mode 100644
index 0000000..8e8ac9e
--- /dev/null
+++ b/examples/cs2-silent-aim-master/asphyxia.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cstrike", "cstrike\cstrike.vcxproj", "{DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|x64 = Debug|x64
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Debug|x64.ActiveCfg = Debug|x64
+ {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Debug|x64.Build.0 = Debug|x64
+ {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Release|x64.ActiveCfg = Release|x64
+ {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/examples/cs2-silent-aim-master/cstrike/aimRangePainter.hpp b/examples/cs2-silent-aim-master/cstrike/aimRangePainter.hpp
new file mode 100644
index 0000000..a098c81
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/aimRangePainter.hpp
@@ -0,0 +1,22 @@
+#pragma once
+#include "painter.h"
+#include "core/variables.h"
+#include "core/interfaces.h"
+#include "sdk/interfaces/iswapchaindx11.h"
+class AimRangePainter : public Painter
+{
+public:
+ virtual void Draw(ImDrawList* pDrawList) override
+ {
+ if (C_GET(bool, Vars.bLegitbot))
+ {
+ DXGI_SWAP_CHAIN_DESC sd;
+ I::SwapChain->pDXGISwapChain->GetDesc(&sd);
+ pDrawList->AddCircle({ sd.BufferDesc.Width / 2.f, sd.BufferDesc.Height / 2.f }, C_GET(float , Vars.aim_range), IM_COL32(255, 0, 0, 255), 0.3);
+ }
+
+
+ }
+
+
+};
diff --git a/examples/cs2-silent-aim-master/cstrike/common.h b/examples/cs2-silent-aim-master/cstrike/common.h
new file mode 100644
index 0000000..18cfc16
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/common.h
@@ -0,0 +1,252 @@
+#pragma once
+
+/*
+ * current build of cheat, change this when you made noticeable changes
+ * - used for automatic adaptation mechanism of configuration files from previous versions
+ */
+
+#define CS_VERSION 1000
+
+/*
+ * current build of CS2
+ * - used to verify game version
+ */
+
+#define CS_PRODUCTSTRINGVERSION CS_XOR("1.40.2.6")
+
+/*
+ * game's modules
+ */
+#define CLIENT_DLL CS_XOR(L"client.dll")
+#define ENGINE2_DLL CS_XOR(L"engine2.dll")
+#define SCHEMASYSTEM_DLL CS_XOR(L"schemasystem.dll")
+#define INPUTSYSTEM_DLL CS_XOR(L"inputsystem.dll")
+#define SDL3_DLL CS_XOR(L"SDL3.dll")
+#define TIER0_DLL CS_XOR(L"tier0.dll")
+#define NAVSYSTEM_DLL CS_XOR(L"navsystem.dll")
+#define RENDERSYSTEM_DLL CS_XOR(L"rendersystemdx11.dll")
+#define LOCALIZE_DLL CS_XOR(L"localize.dll")
+#define DBGHELP_DLL CS_XOR(L"dbghelp.dll")
+#define GAMEOVERLAYRENDERER_DLL CS_XOR(L"GameOverlayRenderer64.dll")
+#define PARTICLES_DLL CS_XOR(L"particles.dll")
+#define SCENESYSTEM_DLL CS_XOR(L"scenesystem.dll")
+#define MATERIAL_SYSTEM2_DLL CS_XOR(L"materialsystem2.dll")
+#define MATCHMAKING_DLL CS_XOR(L"matchmaking.dll")
+#define RESOURCESYSTEM_DLL CS_XOR(L"resourcesystem.dll")
+/*
+ * define to specify default string encryption
+ */
+#ifdef _DEBUG
+#define CS_XOR(STRING) STRING
+#else
+#define JM_XORSTR_DISABLE_AVX_INTRINSICS
+// used: string encryption
+#include "xorstr.h"
+#define CS_XOR(STRING) xorstr_(STRING)
+#endif
+
+// define to enable logging output to console
+#ifdef _DEBUG
+#define CS_LOG_CONSOLE
+#endif
+
+// define to enable logging output to file
+#define CS_LOG_FILE
+
+// define to enable additional run-time checks
+#ifdef _DEBUG
+#define CS_PARANOID
+#endif
+
+/*
+ * define to search all possible occurrences for pattern and log if pattern isn't unique
+ * - useful for keeping patterns up to date and preventing possible inconsistent behavior
+ */
+#ifdef _DEBUG
+#define CS_PARANOID_PATTERN_UNIQUENESS
+#endif
+
+/*
+ * define to overwrite configuration file formatter implementation
+ */
+#define CS_CONFIGURATION_BINARY
+// name of the default configuration file
+#define CS_CONFIGURATION_DEFAULT_FILE_NAME L"default"
+
+// define to force disable behavior based on "Run-Time Type Information", even if available
+//#define CS_NO_RTTI
+
+// @todo: use #warning instead of static asserts when c++23 comes out
+
+#pragma region common_architecture_specific
+#if defined(i386) || defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__) || defined(__i386) || defined(_M_IX86) || defined(_X86_) || defined(__THW_INTEL__) || defined(__I86__) || defined(__INTEL__)
+#define CS_ARCH_X86
+#elif defined(__LP64__) || (defined(__x86_64__) && !defined(__ILP32__)) || defined(_M_X64) || defined(__ia64) || defined(_M_IA64) || defined(__aarch64__) || defined(__powerpc64__)
+#define CS_ARCH_X64
+#else
+static_assert(false, "could not determine the target architecture, consider define it manually!");
+#endif
+
+#pragma region common_compiler_specific
+#ifdef _MSC_VER
+#define CS_COMPILER_MSC
+#endif
+#ifdef __clang__ // @note: clang-cl have defined both 'CS_COMPILER_CLANG' and 'CS_COMPILER_MSC'
+#define CS_COMPILER_CLANG
+#endif
+
+#ifdef __has_builtin
+#define CS_HAS_BUILTIN(BUILTIN) __has_builtin(BUILTIN)
+#else
+#define CS_HAS_BUILTIN(BUILTIN) 0
+#endif
+
+#ifdef CS_COMPILER_MSC
+// treat "discarding return value of function with 'nodiscard' attribute" warning as error
+#pragma warning(error : 4834)
+#endif
+
+#ifdef CS_COMPILER_CLANG
+#pragma clang diagnostic ignored "-Wunused-private-field"
+#endif
+
+#if defined(CS_COMPILER_MSC) || defined(CS_COMPILER_CLANG)
+#define CS_NAKED __declspec(naked)
+#endif
+
+// @todo: platform dependent / but currently we shouldn't give fuck on it
+#define CS_CDECL __cdecl
+#define CS_STDCALL __stdcall
+#define CS_FASTCALL __fastcall
+#define CS_THISCALL __thiscall
+#define CS_VECTORCALL __vectorcall
+#pragma endregion
+
+#pragma region common_implementation_specific
+#define _CS_INTERNAL_CONCATENATE(LEFT, RIGHT) LEFT##RIGHT
+#define _CS_INTERNAL_STRINGIFY(NAME) #NAME
+#define _CS_INTERNAL_UNPARENTHESIZE(...) __VA_ARGS__
+
+// convert plain text to string
+#define CS_STRINGIFY(NAME) _CS_INTERNAL_STRINGIFY(NAME)
+// concatenate plain text
+#define CS_CONCATENATE(LEFT, RIGHT) _CS_INTERNAL_CONCATENATE(LEFT, RIGHT)
+// unparenthesize variadic arguments
+#define CS_UNPARENTHESIZE(...) _CS_INTERNAL_UNPARENTHESIZE(__VA_ARGS__)
+
+// calculate elements count of fixed-size C array
+#define CS_ARRAYSIZE(ARRAY) (sizeof(ARRAY) / sizeof(ARRAY[0]))
+
+// calculate the offset of a struct member variable, in bytes
+#if defined(_CRT_USE_BUILTIN_OFFSETOF) || CS_HAS_BUILTIN(__builtin_offsetof)
+#define CS_OFFSETOF(STRUCT, MEMBER) __builtin_offsetof(STRUCT, MEMBER)
+#else
+#define CS_OFFSETOF(STRUCT, MEMBER) reinterpret_cast(std::addressof(static_cast(nullptr)->MEMBER))
+#endif
+
+#ifndef CS_NO_RTTI
+#if defined(CS_COMPILER_MSC) && !defined(_CPPRTTI)
+#define CS_NO_RTTI
+#elif defined(CS_COMPILER_CLANG)
+#if !__has_feature(cxx_rtti)
+#define CS_NO_RTTI
+#endif
+#endif
+#endif
+
+#ifndef CS_INLINE
+#if defined(CS_COMPILER_MSC)
+#define CS_INLINE __forceinline
+#else
+// referenced to clang documentation, this is enough: https://clang.llvm.org/compatibility.html
+#define CS_INLINE inline
+#endif
+#endif
+
+#ifndef CS_RETURN_ADDRESS
+#if defined(CS_COMPILER_MSC)
+#define CS_RETURN_ADDRESS() _ReturnAddress()
+#elif defined(CS_COMPILER_CLANG)
+#define CS_RETURN_ADDRESS() __builtin_return_address(0)
+#else
+static_assert(false, "it is expected you to define CS_RETURN_ADDRESS() into something that will get the return address off the stack!")
+#define CS_RETURN_ADDRESS()
+#endif
+#endif
+
+#ifndef CS_FRAME_ADDRESS
+#if defined(CS_COMPILER_MSC)
+#define CS_FRAME_ADDRESS() _AddressOfReturnAddress()
+#elif defined(CS_COMPILER_CLANG)
+// @note: it isn't always what we're expecting, compiler dependent
+#define CS_FRAME_ADDRESS() __builtin_frame_address(0)
+#else
+static_assert(false, "it is expected you to define CS_FRAME_ADDRESS() into something that will get the address of the method's stack frame!")
+#define CS_FRAME_ADDRESS()
+#endif
+#endif
+
+#ifndef CS_DEBUG_BREAK
+#if defined(CS_COMPILER_MSC)
+#define CS_DEBUG_BREAK() __debugbreak()
+#elif defined(CS_COMPILER_CLANG)
+#define CS_DEBUG_BREAK() __builtin_debugtrap()
+#else
+static_assert(false, "it is expected you to define CS_DEBUG_BREAK() into something that will break in a debugger!");
+#define CS_DEBUG_BREAK()
+#endif
+#endif
+
+#ifndef CS_ASSERT
+#ifdef _DEBUG
+#define CS_ASSERT(EXPRESSION) static_cast(!!(EXPRESSION) || (CS_DEBUG_BREAK(), 0))
+#else
+// disable assertion for release builds
+#define CS_ASSERT(EXPRESSION) static_cast(0)
+#endif
+#endif
+
+#if !defined(CS_CONFIGURATION_BINARY) && !defined(CS_CONFIGURATION_JSON) && !defined(CS_CONFIGURATION_TOML)
+static_assert(false, "it is expected you to define one of the available configuration file formatters!");
+
+// fallback to binary formatter by default
+#define CS_CONFIGURATION_BINARY
+#endif
+
+#ifndef CS_CONFIGURATION_FILE_EXTENSION
+#if defined(CS_CONFIGURATION_BINARY)
+#define CS_CONFIGURATION_FILE_EXTENSION L".bin"
+#elif defined(CS_CONFIGURATION_JSON)
+#define CS_CONFIGURATION_FILE_EXTENSION L".json"
+#elif defined(CS_CONFIGURATION_TOML)
+#define CS_CONFIGURATION_FILE_EXTENSION L".toml"
+#endif
+#endif
+#pragma endregion
+
+/*
+ * explicitly delete the following constructors, to prevent attempts on using them:
+ * constructor, move-constructor, copy-constructor
+ */
+#define CS_CLASS_NO_CONSTRUCTOR(CLASS) \
+ CLASS() = delete; \
+ CLASS(CLASS&&) = delete; \
+ CLASS(const CLASS&) = delete;
+
+/*
+ * explicitly delete the following assignment operators, to prevent attempts on using them:
+ * move-assignment, copy-assignment
+ */
+#define CS_CLASS_NO_ASSIGNMENT(CLASS) \
+ CLASS& operator=(CLASS&&) = delete; \
+ CLASS& operator=(const CLASS&) = delete;
+
+// explicitly delete any class initializer to prevent attempts on using them
+#define CS_CLASS_NO_INITIALIZER(CLASS) \
+ CS_CLASS_NO_CONSTRUCTOR(CLASS) \
+ CS_CLASS_NO_ASSIGNMENT(CLASS)
+
+// explicitly delete class heap allocator and deallocator, to prevent attempts on using class at heap memory
+#define CS_CLASS_NO_ALLOC() \
+ void* operator new(const std::size_t nSize) = delete; \
+ void operator delete(void* pMemory) = delete;
diff --git a/examples/cs2-silent-aim-master/cstrike/core.cpp b/examples/cs2-silent-aim-master/cstrike/core.cpp
new file mode 100644
index 0000000..ecbf424
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core.cpp
@@ -0,0 +1,261 @@
+// used: [win] shgetknownfolderpath
+#include
+
+#include "core.h"
+
+// used: features setup
+#include "features.h"
+// used: string copy
+#include "utilities/crt.h"
+// used: mem
+#include "utilities/memory.h"
+// used: l_print
+#include "utilities/log.h"
+// used: inputsystem setup/restore
+#include "utilities/inputsystem.h"
+// used: draw destroy
+#include "utilities/draw.h"
+
+// used: interfaces setup/destroy
+#include "core/interfaces.h"
+// used: sdk setup
+#include "core/sdk.h"
+// used: config setup & variables
+#include "core/variables.h"
+// used: hooks setup/destroy
+#include "core/hooks.h"
+// used: schema setup/dump
+#include "core/schema.h"
+// used: convar setup
+#include "core/convars.h"
+// used: menu
+#include "core/menu.h"
+
+// used: product version
+#include "sdk/interfaces/iengineclient.h"
+
+bool CORE::GetWorkingPath(wchar_t* wszDestination)
+{
+ //const wchar_t* wszModuleName = MEM::GetModuleBaseFileName(static_cast(hDll), true);
+ CRT::StringCopy(wszDestination, L"C:\\.asphyxia\\");
+ // create directory if it doesn't exist
+ if (!::CreateDirectoryW(wszDestination, nullptr))
+ {
+ if (const DWORD dwError = ::GetLastError(); dwError != ERROR_ALREADY_EXISTS)
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to create default working directory, because one or more intermediate directories don't exist");
+ return false;
+ }
+ }
+
+ return true;
+}
+
+static bool Setup(HMODULE hModule)
+{
+
+#if 1
+#ifdef CS_LOG_CONSOLE
+ if (!L::AttachConsole(CS_XOR(L"asphyxia developer-mode")))
+ {
+ CS_ASSERT(false); // failed to attach console
+ return false;
+ }
+#endif
+#ifdef CS_LOG_FILE
+ if (!L::OpenFile(CS_XOR(L"asphyxia.log")))
+ {
+ CS_ASSERT(false); // failed to open file
+ return false;
+ }
+#endif
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("logging system initialization completed");
+
+ // setup game's exported functions
+ if (!MEM::Setup())
+ {
+ CS_ASSERT(false); // failed to setup memory system
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("memory system initialization completed");
+
+ if (!MATH::Setup())
+ {
+ CS_ASSERT(false); // failed to setup math system
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("math system initialization completed");
+
+ // grab game's interfaces
+ if (!I::Setup())
+ {
+ CS_ASSERT(false); // failed to setup interfaces
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("interfaces initialization completed");
+
+ if (!SDK::Setup())
+ {
+ CS_ASSERT(false); // failed to setup sdk
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("sdk initialization completed");
+
+ // setup input system and replace game's window messages processor with our
+ if (!IPT::Setup())
+ {
+ CS_ASSERT(false); // failed to setup input system
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("input system initialization completed");
+
+ // @note: sleep to wait finishing font building
+ D::Setup(IPT::hWindow, I::Device, I::DeviceContext);
+ MENU::UpdateStyle(nullptr);
+ while (D::bInitialized == false)
+ ::Sleep(200U);
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("renderer backend initialization completed");
+
+ // initialize feature-related stuff
+ if (!F::Setup())
+ {
+ CS_ASSERT(false); // failed to setup features
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("features initialization completed");
+
+ // iterate all valid modules for schema
+ std::vector vecNeededModules = { CS_XOR("client.dll"), CS_XOR("engine2.dll"), CS_XOR("schemasystem.dll") };
+ for (auto& szModule : vecNeededModules)
+ {
+ if (!SCHEMA::Setup(CS_XOR(L"schema.txt"), szModule.c_str()))
+ {
+ CS_ASSERT(false); // failed to setup schema system
+ return false;
+ }
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("schema system initialization completed");
+
+ if (!CONVAR::Dump(CS_XOR(L"convars.txt")))
+ {
+ CS_ASSERT(false); // failed to setup convars system
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars dumped completed, output: \"convars.txt\"");
+
+ if (!CONVAR::Setup())
+ {
+ CS_ASSERT(false); // failed to setup convars system
+ return false;
+ }
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("convars system initialization completed");
+
+ // setup hooks
+ if (!H::Setup())
+ {
+ CS_ASSERT(false); // failed to setup hooks
+ return false;
+ }
+ L_PRINT(LOG_NONE) << CS_XOR("hooks initialization completed");
+
+ // setup values to save/load cheat variables into/from files and load default configuration
+ if (!C::Setup(CS_XOR(CS_CONFIGURATION_DEFAULT_FILE_NAME)))
+ // this error is not critical, only show that
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to setup and/or load default configuration");
+ else
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_GREEN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("configuration system initialization completed");
+
+ // @note: this doesn't affect much, but it's good to know if we're using different version of the game
+ if (CRT::StringCompare(I::Engine->GetProductVersionString(), CS_PRODUCTSTRINGVERSION) != 0)
+ L_PRINT(LOG_WARNING) << L::SetColor(LOG_COLOR_FORE_YELLOW | LOG_COLOR_FORE_INTENSITY) << CS_XOR("version mismatch! local CS2 version: ") << CS_PRODUCTSTRINGVERSION << CS_XOR(", current CS2 version: ") << I::Engine->GetProductVersionString() << CS_XOR(". asphyxia might not function as normal.");
+
+ L_PRINT(LOG_NONE) << L::SetColor(LOG_COLOR_FORE_CYAN | LOG_COLOR_FORE_INTENSITY) << CS_XOR("asphyxia initialization completed, version: ") << CS_STRINGIFY(CS_VERSION);
+ return true;
+#endif
+
+
+
+
+}
+
+// @todo: some of those may crash while closing process, because we dont have any dependencies from the game modules, it means them can be unloaded and destruct interfaces etc before our module | modify ldrlist?
+static void Destroy()
+{
+ // restore window messages processor to original
+ IPT::Destroy();
+
+ // restore hooks
+ H::Destroy();
+
+ // destroy renderer backend
+ D::Destroy();
+
+ // destroy chams dependent stuff
+ F::Destroy();
+
+#ifdef CS_LOG_CONSOLE
+ L::DetachConsole();
+#endif
+#ifdef CS_LOG_FILE
+ L::CloseFile();
+#endif
+}
+
+DWORD WINAPI PanicThread(LPVOID lpParameter)
+{
+ // don't let proceed unload until user press specified key
+ while (!IPT::IsKeyReleased(C_GET(unsigned int, Vars.nPanicKey)))
+ ::Sleep(500UL);
+
+ // call detach code and exit this thread
+ ::FreeLibraryAndExitThread(static_cast(lpParameter), EXIT_SUCCESS);
+}
+
+extern "C" BOOL WINAPI _CRT_INIT(HMODULE hModule, DWORD dwReason, LPVOID lpReserved);
+
+BOOL APIENTRY CoreEntryPoint(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
+{
+ // Disables the DLL_THREAD_ATTACH and DLL_THREAD_DETACH notifications for the specified dynamic-link library (DLL). This can reduce the size of the working set for some applications
+ DisableThreadLibraryCalls(hModule);
+
+ // process destroy of the cheat before crt calls atexit table
+ if (dwReason == DLL_PROCESS_DETACH)
+ Destroy();
+
+ // dispatch reason for c-runtime, initialize/destroy static variables, TLS etc
+ if (!_CRT_INIT(hModule, dwReason, lpReserved))
+ return FALSE;
+
+ if (dwReason == DLL_PROCESS_ATTACH)
+ {
+ CORE::hProcess = MEM::GetModuleBaseHandle(nullptr);
+
+ // basic process check
+ if (CORE::hProcess == nullptr)
+ return FALSE;
+
+ /*
+ * check did all game modules have been loaded
+ * @note: navsystem.dll is the last loaded module
+ */
+ if (MEM::GetModuleBaseHandle(NAVSYSTEM_DLL) == nullptr)
+ return FALSE;
+
+ // save our module handle
+ CORE::hDll = hModule;
+
+ // check did we perform main initialization successfully
+ if (!Setup(hModule))
+ {
+ // undo the things we've done
+ Destroy();
+ return FALSE;
+ }
+
+ // create panic thread, it isn't critical error if it fails
+ if (const HANDLE hThread = ::CreateThread(nullptr, 0U, &PanicThread, hModule, 0UL, nullptr); hThread != nullptr)
+ ::CloseHandle(hThread);
+ }
+
+ return TRUE;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core.h b/examples/cs2-silent-aim-master/cstrike/core.h
new file mode 100644
index 0000000..aadd6f4
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core.h
@@ -0,0 +1,15 @@
+#pragma once
+
+namespace CORE
+{
+ /* @section: get */
+ /// @param[out] wszDestination output for working path where files will be saved (default: "%userprofile%\documents\.crown")
+ /// @returns: true if successfully got the path, false otherwise
+ bool GetWorkingPath(wchar_t* wszDestination);
+
+ /* @section: values */
+ // handle of self module
+ inline void* hDll = nullptr;
+ // current process handle
+ inline void* hProcess = nullptr;
+}
\ No newline at end of file
diff --git a/examples/cs2-silent-aim-master/cstrike/core/config.cpp b/examples/cs2-silent-aim-master/cstrike/core/config.cpp
new file mode 100644
index 0000000..c9703b9
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/config.cpp
@@ -0,0 +1,406 @@
+// used: [win] winapi
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include
+
+#include "config.h"
+// used: getworkingpath
+#include "../core.h"
+// used: l_print
+#include "../utilities/log.h"
+// used: integertostring
+#include "../utilities/crt.h"
+// used: heapalloc, heapfree
+#include "../utilities/memory.h"
+
+// used: formatter implementation
+#if defined(CS_CONFIGURATION_BINARY)
+#include "../../extensions/binary.h"
+#elif defined(CS_CONFIGURATION_JSON)
+#include "../../extensions/json.h"
+#elif defined(CS_CONFIGURATION_TOML)
+#include "../../extensions/toml.h"
+#endif
+
+// default configurations working path
+static wchar_t wszConfigurationsPath[MAX_PATH];
+
+#pragma region config_user_data_type
+
+std::size_t C::UserDataType_t::GetSerializationSize() const
+{
+ std::size_t nTotalDataSize = 0U;
+
+ for (const UserDataMember_t& member : vecMembers)
+ nTotalDataSize += sizeof(FNV1A_t[2]) + member.nDataSize;
+
+ return nTotalDataSize;
+}
+
+#pragma endregion
+
+#pragma region config_variable_object
+
+void C::VariableObject_t::SetStorage(const void* pValue)
+{
+ // check is available to store value in the local storage
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ {
+ CRT::MemorySet(&this->storage.uLocal, 0U, sizeof(this->storage.uLocal));
+ CRT::MemoryCopy(&this->storage.uLocal, pValue, this->nStorageSize);
+ }
+ // otherwise use heap memory to store it
+ else
+ {
+ CS_ASSERT(this->storage.pHeap != nullptr); // tried to access non allocated storage
+
+ CRT::MemorySet(this->storage.pHeap, 0U, this->nStorageSize);
+ CRT::MemoryCopy(this->storage.pHeap, pValue, this->nStorageSize);
+ }
+}
+
+std::size_t C::VariableObject_t::GetSerializationSize() const
+{
+ std::size_t nSerializationSize = this->nStorageSize;
+
+ // denote a custom serialization size when it different from the storage size
+ switch (this->uTypeHash)
+ {
+ // lookup for array data type
+ case FNV1A::HashConst("bool[]"):
+ case FNV1A::HashConst("int[]"):
+ case FNV1A::HashConst("unsigned int[]"):
+ case FNV1A::HashConst("float[]"):
+ case FNV1A::HashConst("char[][]"):
+ // arrays also serialize their size
+ nSerializationSize += sizeof(std::size_t);
+ break;
+ // lookup for user-defined data type
+ default:
+ {
+ for (const UserDataType_t& userType : vecUserTypes)
+ {
+ if (userType.uTypeHash == this->uTypeHash)
+ {
+ nSerializationSize = sizeof(std::size_t) + userType.GetSerializationSize();
+ break;
+ }
+ }
+ break;
+ }
+ }
+
+ return nSerializationSize;
+}
+
+#pragma endregion
+
+bool C::Setup(const wchar_t* wszDefaultFileName)
+{
+ if (!CORE::GetWorkingPath(wszConfigurationsPath))
+ return false;
+
+ CRT::StringCat(wszConfigurationsPath, CS_XOR(L"settings\\"));
+
+ // create directory if it doesn't exist
+ if (!::CreateDirectoryW(wszConfigurationsPath, nullptr))
+ {
+ if (::GetLastError() != ERROR_ALREADY_EXISTS)
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to create configurations directory, because one or more intermediate directories don't exist");
+ return false;
+ }
+ }
+
+ // @note: define custom data types we want to serialize
+ AddUserType(FNV1A::HashConst("KeyBind_t"),
+ {
+ UserDataMember_t{ FNV1A::HashConst("uKey"), FNV1A::HashConst("unsigned int"), &KeyBind_t::uKey },
+ UserDataMember_t{ FNV1A::HashConst("nMode"), FNV1A::HashConst("int"), &KeyBind_t::nMode }
+ });
+
+ AddUserType(FNV1A::HashConst("ColorPickerVar_t"),
+ {
+ UserDataMember_t{ FNV1A::HashConst("bRainbow"), FNV1A::HashConst("bool"), &ColorPickerVar_t::bRainbow },
+ UserDataMember_t{ FNV1A::HashConst("flRainbowSpeed"), FNV1A::HashConst("float"), &ColorPickerVar_t::flRainbowSpeed },
+ UserDataMember_t{ FNV1A::HashConst("colPrimary"), FNV1A::HashConst("Color_t"), &ColorPickerVar_t::colValue },
+ });
+
+ AddUserType(FNV1A::HashConst("TextOverlayVar_t"),
+ {
+ UserDataMember_t{ FNV1A::HashConst("bEnable"), FNV1A::HashConst("bool"), &TextOverlayVar_t::bEnable },
+ UserDataMember_t{ FNV1A::HashConst("flThickness"), FNV1A::HashConst("float"), &TextOverlayVar_t::flThickness },
+ UserDataMember_t{ FNV1A::HashConst("colPrimary"), FNV1A::HashConst("Color_t"), &TextOverlayVar_t::colPrimary },
+ UserDataMember_t{ FNV1A::HashConst("colOutline"), FNV1A::HashConst("Color_t"), &TextOverlayVar_t::colOutline }
+ });
+
+ AddUserType(FNV1A::HashConst("FrameOverlayVar_t"),
+ {
+ UserDataMember_t{ FNV1A::HashConst("bEnable"), FNV1A::HashConst("bool"), &FrameOverlayVar_t::bEnable },
+ UserDataMember_t{ FNV1A::HashConst("flThickness"), FNV1A::HashConst("float"), &FrameOverlayVar_t::flThickness },
+ UserDataMember_t{ FNV1A::HashConst("flRounding"), FNV1A::HashConst("float"), &FrameOverlayVar_t::flRounding },
+ UserDataMember_t{ FNV1A::HashConst("colPrimary"), FNV1A::HashConst("Color_t"), &FrameOverlayVar_t::colPrimary },
+ UserDataMember_t{ FNV1A::HashConst("colOutline"), FNV1A::HashConst("Color_t"), &FrameOverlayVar_t::colOutline }
+ });
+
+ AddUserType(FNV1A::HashConst("BarOverlayVar_t"),
+ {
+ UserDataMember_t{ FNV1A::HashConst("bEnable"), FNV1A::HashConst("bool"), &BarOverlayVar_t::bEnable },
+ UserDataMember_t{ FNV1A::HashConst("bGradient"), FNV1A::HashConst("bool"), &BarOverlayVar_t::bGradient },
+ UserDataMember_t{ FNV1A::HashConst("bUseFactorColor"), FNV1A::HashConst("bool"), &BarOverlayVar_t::bUseFactorColor },
+ UserDataMember_t{ FNV1A::HashConst("flThickness"), FNV1A::HashConst("float"), &BarOverlayVar_t::flThickness },
+ UserDataMember_t{ FNV1A::HashConst("colPrimary"), FNV1A::HashConst("Color_t"), &BarOverlayVar_t::colPrimary },
+ UserDataMember_t{ FNV1A::HashConst("colSecondary"), FNV1A::HashConst("Color_t"), &BarOverlayVar_t::colSecondary },
+ UserDataMember_t{ FNV1A::HashConst("colBackground"), FNV1A::HashConst("Color_t"), &BarOverlayVar_t::colBackground },
+ UserDataMember_t{ FNV1A::HashConst("colOutline"), FNV1A::HashConst("Color_t"), &BarOverlayVar_t::colOutline }
+ });
+
+ // create default configuration
+ if (!CreateFile(wszDefaultFileName))
+ return false;
+
+ // store existing configurations list
+ Refresh();
+
+ return true;
+}
+
+#pragma region config_main
+
+void C::Refresh()
+{
+ // clear and free previous stored file names
+ vecFileNames.clear();
+
+ // make configuration files path filter
+ wchar_t wszPathFilter[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszPathFilter, wszConfigurationsPath), CS_XOR(L"*" CS_CONFIGURATION_FILE_EXTENSION));
+
+ // iterate through all files with our filter
+ WIN32_FIND_DATAW findData;
+ if (const HANDLE hFindFile = ::FindFirstFileW(wszPathFilter, &findData); hFindFile != INVALID_HANDLE_VALUE)
+ {
+ do
+ {
+ vecFileNames.push_back(new wchar_t[CRT::StringLength(findData.cFileName) + 1U]);
+ CRT::StringCopy(vecFileNames.back(), findData.cFileName);
+
+ L_PRINT(LOG_INFO) << CS_XOR("found configuration file: \"") << findData.cFileName << CS_XOR("\"");
+ } while (::FindNextFileW(hFindFile, &findData));
+
+ ::FindClose(hFindFile);
+ }
+}
+
+void C::AddUserType(const FNV1A_t uTypeHash, const std::initializer_list vecUserMembers)
+{
+ if (vecUserMembers.size() == 0U)
+ return;
+
+ UserDataType_t userDataType;
+ userDataType.uTypeHash = uTypeHash;
+
+ for (const auto& userDataMember : vecUserMembers)
+ userDataType.vecMembers.push_back(userDataMember);
+
+ vecUserTypes.emplace_back(CRT::Move(userDataType));
+}
+
+bool C::SaveFileVariable(const std::size_t nFileIndex, const VariableObject_t& variable)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+#if defined(CS_CONFIGURATION_BINARY)
+ if (BIN::SaveVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_JSON)
+ if (JSON::SaveVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_TOML)
+ if (TOML::SaveVariable(wszFilePath, variable))
+#endif
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool C::LoadFileVariable(const std::size_t nFileIndex, VariableObject_t& variable)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+#if defined(CS_CONFIGURATION_BINARY)
+ if (BIN::LoadVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_JSON)
+ if (JSON::LoadVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_TOML)
+ if (TOML::LoadVariable(wszFilePath, variable))
+#endif
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool C::RemoveFileVariable(const std::size_t nFileIndex, const VariableObject_t& variable)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+#if defined(CS_CONFIGURATION_BINARY)
+ if (BIN::RemoveVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_JSON)
+ if (JSON::RemoveVariable(wszFilePath, variable))
+#elif defined(CS_CONFIGURATION_TOML)
+ if (TOML::RemoveVariable(wszFilePath, variable))
+#endif
+ {
+ return true;
+ }
+
+ return false;
+}
+
+bool C::CreateFile(const wchar_t* wszFileName)
+{
+ const wchar_t* wszFileExtension = CRT::StringCharR(wszFileName, L'.');
+
+ // get length of the given filename and strip out extension if there any
+ const std::size_t nFileNameLength = (wszFileExtension != nullptr ? wszFileExtension - wszFileName : CRT::StringLength(wszFileName));
+ wchar_t* wszFullFileName = new wchar_t[nFileNameLength + CRT::StringLength(CS_CONFIGURATION_FILE_EXTENSION) + 1U];
+
+ // copy filename without extension
+ wchar_t* wszFullFileNameEnd = CRT::StringCopyN(wszFullFileName, wszFileName, nFileNameLength);
+ *wszFullFileNameEnd = L'\0';
+ // append correct extension to the filename
+ CRT::StringCat(wszFullFileNameEnd, CS_XOR(CS_CONFIGURATION_FILE_EXTENSION));
+
+ // add filename to the list
+ vecFileNames.push_back(wszFullFileName);
+
+ // create and save it by the index
+ if (SaveFile(vecFileNames.size() - 1U))
+ {
+ L_PRINT(LOG_INFO) << CS_XOR("created configuration file: \"") << wszFullFileName << CS_XOR("\"");
+ return true;
+ }
+
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to create configuration file: \"") << wszFullFileName << CS_XOR("\"");
+ return false;
+}
+
+bool C::SaveFile(const std::size_t nFileIndex)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+#if defined(CS_CONFIGURATION_BINARY)
+ if (BIN::SaveFile(wszFilePath))
+#elif defined(CS_CONFIGURATION_JSON)
+ if (JSON::SaveFile(wszFilePath))
+#elif defined(CS_CONFIGURATION_TOML)
+ if (TOML::SaveFile(wszFilePath))
+#endif
+ {
+ L_PRINT(LOG_INFO) << CS_XOR("saved configuration file: \"") << wszFileName << CS_XOR("\"");
+ return true;
+ }
+
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to save configuration file: \"") << wszFileName << CS_XOR("\"");
+ return false;
+}
+
+bool C::LoadFile(const std::size_t nFileIndex)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+#if defined(CS_CONFIGURATION_BINARY)
+ if (BIN::LoadFile(wszFilePath))
+#elif defined(CS_CONFIGURATION_JSON)
+ if (JSON::LoadFile(wszFilePath))
+#elif defined(CS_CONFIGURATION_TOML)
+ if (TOML::LoadFile(wszFilePath))
+#endif
+ {
+ L_PRINT(LOG_INFO) << CS_XOR("loaded configuration file: \"") << wszFileName << CS_XOR("\"");
+ return true;
+ }
+
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to load configuration file: \"") << wszFileName << CS_XOR("\"");
+ return false;
+}
+
+void C::RemoveFile(const std::size_t nFileIndex)
+{
+ const wchar_t* wszFileName = vecFileNames[nFileIndex];
+
+ // unable to delete default config
+ if (CRT::StringCompare(wszFileName, CS_XOR(CS_CONFIGURATION_DEFAULT_FILE_NAME CS_CONFIGURATION_FILE_EXTENSION)) == 0)
+ {
+ L_PRINT(LOG_WARNING) << CS_XOR("unable to remove default configuration file: \"") << wszFileName << CS_XOR("\"");
+ return;
+ }
+
+ wchar_t wszFilePath[MAX_PATH];
+ CRT::StringCat(CRT::StringCopy(wszFilePath, wszConfigurationsPath), wszFileName);
+
+ if (::DeleteFileW(wszFilePath))
+ {
+ // erase and free filename from the list
+ vecFileNames.erase(vecFileNames.cbegin() + nFileIndex);
+
+ L_PRINT(LOG_INFO) << CS_XOR("removed configuration file: \"") << wszFileName << CS_XOR("\"");
+ }
+}
+
+#pragma endregion
+
+#pragma region config_get
+
+std::size_t C::GetVariableIndex(const FNV1A_t uNameHash)
+{
+ for (std::size_t i = 0U; i < vecVariables.size(); i++)
+ {
+ if (vecVariables[i].uNameHash == uNameHash)
+ return i;
+ }
+
+ return C_INVALID_VARIABLE;
+}
+
+#pragma endregion
+
+#pragma region config_user_types
+void ColorPickerVar_t::UpdateRainbow()
+{
+ // @todo: improve + optimize this code
+ // progress rainbow color
+ if (this->bRainbow)
+ {
+ const float flTime = static_cast(ImGui::GetTime());
+ // create a rainbow color with copied alpha
+ float arrRainbowColors[] = {
+ sin(flTime * this->flRainbowSpeed) * 0.5f + 0.5f,
+ sin(flTime * this->flRainbowSpeed * MATH::_PI / 3) * 0.5f + 0.5f,
+ sin(flTime * this->flRainbowSpeed * MATH::_PI / 3) * 0.5f + 0.5f,
+ this->colValue.Base()
+ };
+
+ // set the rainbow color
+ this->colValue = Color_t::FromBase4(arrRainbowColors);
+ }
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/config.h b/examples/cs2-silent-aim-master/cstrike/core/config.h
new file mode 100644
index 0000000..0146c82
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/config.h
@@ -0,0 +1,443 @@
+#pragma once
+// used: [stl] vector
+#include
+// used: [stl] type_info
+#include
+// used: [win] undname_no_arguments
+#include
+
+#include "../common.h"
+#include "../sdk/datatypes/color.h"
+
+// used: l_print
+#include "../utilities/log.h"
+// used: heapalloc, heapfree
+#include "../utilities/memory.h"
+// used: fnv1a hashing
+#include "../utilities/fnv1a.h"
+
+#pragma region config_definitions
+#define C_ADD_VARIABLE(TYPE, NAME, DEFAULT) const std::size_t NAME = C::AddVariable(FNV1A::HashConst(#NAME), FNV1A::HashConst(#TYPE), DEFAULT);
+
+#define C_ADD_VARIABLE_ARRAY(TYPE, SIZE, NAME, DEFAULT) const std::size_t NAME = C::AddVariableArray(FNV1A::HashConst(#NAME), FNV1A::HashConst(#TYPE "[]"), DEFAULT);
+
+#define C_ADD_VARIABLE_ARRAY_ARRAY(TYPE, SIZE, SUBSIZE, NAME, DEFAULT) const std::size_t NAME = C::AddVariableArray(FNV1A::HashConst(#NAME), FNV1A::HashConst(#TYPE "[][]"), DEFAULT);
+
+#define C_INVALID_VARIABLE static_cast(-1)
+
+#define C_GET(TYPE, NAME) C::Get(NAME)
+
+#define C_GET_ARRAY(TYPE, SIZE, NAME, INDEX) C::Get(NAME)[INDEX]
+#pragma endregion
+
+#pragma region config_user_types
+enum class EKeyBindMode : int
+{
+ HOLD = 0,
+ TOGGLE
+};
+
+struct KeyBind_t
+{
+ constexpr KeyBind_t(const char* szName, const unsigned int uKey = 0U, const EKeyBindMode nMode = EKeyBindMode::HOLD) :
+ szName(szName), uKey(uKey), nMode(nMode) { }
+
+ bool bEnable = false;
+ const char* szName = nullptr;
+ unsigned int uKey = 0U;
+ EKeyBindMode nMode = EKeyBindMode::HOLD;
+};
+
+struct ColorPickerVar_t
+{
+ // default constructor
+ constexpr ColorPickerVar_t(const Color_t& colValue = Color_t(255, 255, 255), const bool bRainbow = false, const float flRainbowSpeed = 0.5f) :
+ colValue(colValue), bRainbow(bRainbow), flRainbowSpeed(flRainbowSpeed) { }
+
+ // @note: other contructors will only construct Color_t object and set rainbow to false and speed to 0.5f
+
+ // 8-bit color constructor (in: [0 .. 255])
+ constexpr ColorPickerVar_t(const std::uint8_t r, const std::uint8_t g, const std::uint8_t b, const std::uint8_t a = 255) :
+ colValue(r, g, b, a), bRainbow(false), flRainbowSpeed(0.5f) { }
+
+ // 8-bit color constructor (in: [0 .. 255])
+ constexpr ColorPickerVar_t(const int r, const int g, const int b, const int a = 255) :
+ colValue(r, g, b, a), bRainbow(false), flRainbowSpeed(0.5f) { }
+
+ // 8-bit array color constructor (in: [0.0 .. 1.0])
+ explicit constexpr ColorPickerVar_t(const std::uint8_t arrColor[4]) :
+ colValue(arrColor), bRainbow(false), flRainbowSpeed(0.5f) { }
+
+ // 32-bit packed color constructor (in: 0x00000000 - 0xFFFFFFFF)
+ explicit constexpr ColorPickerVar_t(const ImU32 uPackedColor) :
+ colValue(uPackedColor), bRainbow(false), flRainbowSpeed(0.5f) { }
+
+ // 32-bit color constructor (in: [0.0 .. 1.0])
+ constexpr ColorPickerVar_t(const float r, const float g, const float b, const float a = 1.0f) :
+ colValue(r, g, b, a), bRainbow(false), flRainbowSpeed(0.5f) { }
+
+ void UpdateRainbow();
+
+ Color_t colValue = Color_t(255, 255, 255);
+ bool bRainbow = false;
+ float flRainbowSpeed = 0.5f;
+};
+
+/// hold config variables for text component overlay
+struct TextOverlayVar_t
+{
+ constexpr TextOverlayVar_t(const bool bEnable, const float flThickness = 1.f, const Color_t& colPrimary = Color_t(255, 255, 255), const Color_t& colOutline = Color_t(0, 0, 0)) :
+ bEnable(bEnable), flThickness(flThickness), colPrimary(colPrimary), colOutline(colOutline) { }
+
+ bool bEnable = false;
+ float flThickness = 1.f;
+
+ Color_t colPrimary = Color_t(255, 255, 255);
+ Color_t colOutline = Color_t(0, 0, 0);
+};
+
+/// hold config variables for frame/box component overlay
+struct FrameOverlayVar_t
+{
+ constexpr FrameOverlayVar_t(const bool bEnable, const float flThickness = 1.f, const float flRounding = 0.f, const Color_t& colPrimary = Color_t(255, 255, 255), const Color_t& colOutline = Color_t(0, 0, 0)) :
+ bEnable(bEnable), flThickness(flThickness), flRounding(flRounding), colPrimary(colPrimary), colOutline(colOutline) { }
+
+ bool bEnable = false;
+ float flThickness = 1.f;
+ float flRounding = 0.f;
+
+ Color_t colPrimary = Color_t(255, 255, 255);
+ Color_t colOutline = Color_t(0, 0, 0);
+};
+
+/// hold config variables for bar component overlay
+struct BarOverlayVar_t
+{
+ constexpr BarOverlayVar_t(const bool bEnable, const bool bGradient = false, const bool bUseFactorColor = false, const float flThickness = 1.f, const Color_t& colPrimary = Color_t(255, 255, 255), const Color_t& colSecondary = Color_t(255, 255, 255), const Color_t& colBackground = Color_t(), const Color_t& colOutline = Color_t()) :
+ bEnable(bEnable), bGradient(bGradient), bUseFactorColor(bUseFactorColor), flThickness(flThickness), colPrimary(colPrimary), colSecondary(colSecondary), colBackground(colBackground), colOutline(colOutline) { }
+
+ bool bEnable = false;
+ bool bGradient = false;
+ bool bUseFactorColor = false;
+
+ float flThickness = 1.f;
+
+ Color_t colPrimary = Color_t(255, 255, 255);
+ Color_t colSecondary = Color_t(255, 255, 255);
+
+ Color_t colBackground = Color_t{};
+ Color_t colOutline = Color_t{};
+};
+
+#pragma endregion
+
+/*
+ * CONFIGURATION
+ * - cheat variables serialization/de-serialization manager
+ */
+namespace C
+{
+ // member of user-defined custom serialization structure
+ struct UserDataMember_t
+ {
+ // @todo: not sure is it possible and how todo this with projections, so currently done with pointer-to-member thing, probably could be optimized
+ template
+ constexpr UserDataMember_t(const FNV1A_t uNameHash, const FNV1A_t uTypeHash, const T C::*pMember) :
+ uNameHash(uNameHash), uTypeHash(uTypeHash), nDataSize(sizeof(std::remove_pointer_t)), uBaseOffset(reinterpret_cast(std::addressof(static_cast(nullptr)->*pMember))) { } // @test: 'CS_OFFSETOF' must expand to the same result but for some reason it doesn't
+
+ // hash of custom variable name
+ FNV1A_t uNameHash = 0U;
+ // hash of custom variable type
+ FNV1A_t uTypeHash = 0U;
+ // data size of custom variable type
+ std::size_t nDataSize = 0U;
+ // offset to the custom variable from the base of class
+ std::size_t uBaseOffset = 0U;
+ };
+
+ // user-defined custom serialization structure
+ struct UserDataType_t
+ {
+ [[nodiscard]] std::size_t GetSerializationSize() const;
+
+ FNV1A_t uTypeHash = 0U;
+ std::vector vecMembers = {};
+ };
+
+ // variable info and value storage holder
+ struct VariableObject_t
+ {
+ // @test: it's required value to be either trivially copyable or allocated/copied by new/placement-new operators, otherwise it may cause UB
+ template requires (!std::is_void_v && std::is_trivially_copyable_v)
+ VariableObject_t(const FNV1A_t uNameHash, const FNV1A_t uTypeHash, const T& valueDefault) :
+ uNameHash(uNameHash), uTypeHash(uTypeHash), nStorageSize(sizeof(T))
+ {
+#ifndef CS_NO_RTTI
+ // store RTTI address if available
+ this->pTypeInfo = &typeid(std::remove_cvref_t);
+#endif
+
+ // @todo: do not call setstorage, instead construct it by placement-new operator
+ // allocate storage on the heap if it doesnt't fit on the local one
+ if constexpr (sizeof(T) > sizeof(this->storage.uLocal))
+ this->storage.pHeap = MEM::HeapAlloc(this->nStorageSize);
+
+ SetStorage(&valueDefault);
+ }
+
+ VariableObject_t(VariableObject_t&& other) noexcept :
+ uNameHash(other.uNameHash), uTypeHash(other.uTypeHash), nStorageSize(other.nStorageSize)
+ {
+#ifndef CS_NO_RTTI
+ this->pTypeInfo = other.pTypeInfo;
+#endif
+
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ CRT::MemoryCopy(&this->storage.uLocal, &other.storage.uLocal, sizeof(this->storage.uLocal));
+ else
+ {
+ this->storage.pHeap = other.storage.pHeap;
+
+ // prevent it from being freed when the moved object is destroyed
+ other.storage.pHeap = nullptr;
+ }
+ }
+
+ VariableObject_t(const VariableObject_t& other) :
+ uNameHash(other.uNameHash), uTypeHash(other.uTypeHash), nStorageSize(other.nStorageSize)
+ {
+#ifndef CS_NO_RTTI
+ this->pTypeInfo = other.pTypeInfo;
+#endif
+
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ CRT::MemoryCopy(&this->storage.uLocal, &other.storage.uLocal, sizeof(this->storage.uLocal));
+ else if (other.storage.pHeap != nullptr)
+ {
+ this->storage.pHeap = MEM::HeapAlloc(this->nStorageSize);
+ CRT::MemoryCopy(this->storage.pHeap, other.storage.pHeap, this->nStorageSize);
+ }
+ }
+
+ ~VariableObject_t()
+ {
+ // check if heap memory is in use and allocated
+ if (this->nStorageSize > sizeof(this->storage.uLocal) && this->storage.pHeap != nullptr)
+ MEM::HeapFree(this->storage.pHeap);
+ }
+
+ VariableObject_t& operator=(VariableObject_t&& other) noexcept
+ {
+ // check if heap memory is in use and allocated
+ if (this->nStorageSize > sizeof(this->storage.uLocal) && this->storage.pHeap != nullptr)
+ MEM::HeapFree(this->storage.pHeap);
+
+ this->uNameHash = other.uNameHash;
+ this->uTypeHash = other.uTypeHash;
+ this->nStorageSize = other.nStorageSize;
+
+#ifndef CS_NO_RTTI
+ this->pTypeInfo = other.pTypeInfo;
+#endif
+
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ CRT::MemoryCopy(&this->storage.uLocal, &other.storage.uLocal, sizeof(this->storage.uLocal));
+ else
+ {
+ this->storage.pHeap = other.storage.pHeap;
+
+ // prevent it from being freed when the moved object is destroyed
+ other.storage.pHeap = nullptr;
+ }
+
+ return *this;
+ }
+
+ VariableObject_t& operator=(const VariableObject_t& other)
+ {
+ // check if heap memory is in use and allocated
+ if (this->nStorageSize > sizeof(this->storage.uLocal) && this->storage.pHeap != nullptr)
+ MEM::HeapFree(this->storage.pHeap);
+
+ this->uNameHash = other.uNameHash;
+ this->uTypeHash = other.uTypeHash;
+ this->nStorageSize = other.nStorageSize;
+
+#ifndef CS_NO_RTTI
+ this->pTypeInfo = other.pTypeInfo;
+#endif
+
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ CRT::MemoryCopy(&this->storage.uLocal, &other.storage.uLocal, sizeof(this->storage.uLocal));
+ else if (other.storage.pHeap != nullptr)
+ {
+ this->storage.pHeap = MEM::HeapAlloc(this->nStorageSize);
+ CRT::MemoryCopy(this->storage.pHeap, other.storage.pHeap, this->nStorageSize);
+ }
+
+ return *this;
+ }
+
+ /// @tparam bTypeSafe if true, activates additional comparison of source and requested type information, requires RTTI
+ /// @returns: pointer to the value storage, null if @a'bTypeSafe' is active and the access type does not match the variable type
+ template requires (std::is_object_v)
+ [[nodiscard]] const T* GetStorage() const
+ {
+#ifndef CS_NO_RTTI
+ // sanity check of stored value type and asked value type
+ if constexpr (bTypeSafe)
+ {
+ if (const std::type_info& currentTypeInfo = typeid(std::remove_cvref_t); this->pTypeInfo != nullptr && CRT::StringCompare(this->pTypeInfo->raw_name(), currentTypeInfo.raw_name()) != 0)
+ {
+ if (char szPresentTypeName[64] = {}, szAccessTypeName[64] = {};
+ MEM::fnUnDecorateSymbolName(this->pTypeInfo->raw_name() + 1U, szPresentTypeName, CS_ARRAYSIZE(szPresentTypeName), UNDNAME_NO_ARGUMENTS) != 0UL &&
+ MEM::fnUnDecorateSymbolName(currentTypeInfo.raw_name() + 1U, szAccessTypeName, CS_ARRAYSIZE(szAccessTypeName), UNDNAME_NO_ARGUMENTS) != 0UL)
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("accessing variable of type: \"") << szPresentTypeName << CS_XOR("\" with wrong type: \"") << szAccessTypeName << CS_XOR("\"");
+ }
+
+ CS_ASSERT(false); // storage value and asked data type mismatch
+ return nullptr;
+ }
+ }
+#endif
+
+ // check is value stored in the local storage
+ if (this->nStorageSize <= sizeof(this->storage.uLocal))
+ return reinterpret_cast*>(&this->storage.uLocal);
+
+ // otherwise it is allocated in the heap memory
+ CS_ASSERT(this->storage.pHeap != nullptr); // tried to access non allocated storage
+ return static_cast*>(this->storage.pHeap);
+ }
+
+ template requires (std::is_object_v)
+ [[nodiscard]] T* GetStorage()
+ {
+ return const_cast(static_cast(this)->GetStorage());
+ }
+
+ // replace variable contained value
+ void SetStorage(const void* pValue);
+ /// @returns: the size of the data to be serialized/de-serialized into/from the configuration file
+ [[nodiscard]] std::size_t GetSerializationSize() const;
+
+ // hash of variable name
+ FNV1A_t uNameHash = 0x0;
+ // hash of value type
+ FNV1A_t uTypeHash = 0x0;
+#ifndef CS_NO_RTTI
+ // address of RTTI type data for value type
+ const std::type_info* pTypeInfo = nullptr;
+#endif
+ // value storage size in bytes
+ std::size_t nStorageSize = 0U;
+
+ // value storage
+ union
+ {
+ void* pHeap;
+ std::uint8_t uLocal[sizeof(std::uintptr_t)]; // @test: expand local storage size to fit max possible size of trivial type so we can minimize heap allocations count
+ } storage = { nullptr };
+ };
+
+ // create directories and default configuration file
+ bool Setup(const wchar_t* wszDefaultFileName);
+
+ /* @section: main */
+ // loop through directory content and store all user configurations filenames
+ void Refresh();
+ /// register user-defined data structure type and it's member variables
+ /// @param[in] vecUserMembers member variables of structure that needs to be serialized/de-serialized
+ void AddUserType(const FNV1A_t uTypeHash, std::initializer_list vecUserMembers);
+ /// write/re-write single variable to existing configuration file
+ /// @returns: true if variable has been found or created and successfully written, false otherwise
+ bool SaveFileVariable(const std::size_t nFileIndex, const VariableObject_t& variable);
+ /// read single variable from existing configuration file
+ /// @remarks: when the version of cheat is greater than version of the configuration file and @a'variable' wasn't found, this function saves it and updates the version to the current one, note that it doesn't affect to return value
+ /// @returns: true if variable has been found and successfully read, false otherwise
+ bool LoadFileVariable(const std::size_t nFileIndex, VariableObject_t& variable);
+ /// erase single variable from existing configuration file
+ /// @returns: true if variable did not exist or was successfully removed, false otherwise
+ bool RemoveFileVariable(const std::size_t nFileIndex, const VariableObject_t& variable);
+ /// create a new configuration file and save it
+ /// @param[in] wszFileName file name of configuration file to save and write in
+ /// @returns: true if file has been successfully created and all variables were written to it, false otherwise
+ bool CreateFile(const wchar_t* wszFileName);
+ /// serialize variables into the configuration file
+ /// @param[in] nFileIndex index of the exist configuration file name
+ /// @returns: true if all variables were successfully written to the file, false otherwise
+ bool SaveFile(const std::size_t nFileIndex);
+ /// de-serialize variables from the configuration file
+ /// @param[in] nFileIndex index of the exist configuration file name
+ /// @returns: true if all variables were successfully loaded from the file, false otherwise
+ bool LoadFile(const std::size_t nFileIndex);
+ /// remove configuration file
+ /// @param[in] nFileIndex index of the exist configuration file name
+ void RemoveFile(const std::size_t nFileIndex);
+
+ /* @section: values */
+ // all user configuration filenames
+ inline std::vector vecFileNames = {};
+ // custom user-defined serialization data types
+ inline std::vector vecUserTypes = {};
+ // configuration variables storage
+ inline std::vector vecVariables = {};
+
+ /* @section: get */
+ /// @returns: index of variable with given name hash if it exist, 'C_INVALID_VARIABLE' otherwise
+ [[nodiscard]] std::size_t GetVariableIndex(const FNV1A_t uNameHash);
+
+ /// @tparam T type of variable we're going to get, must be exactly the same as when registered
+ /// @returns: variable value at given index
+ template
+ [[nodiscard]] T& Get(const std::size_t nIndex)
+ {
+ return *vecVariables[nIndex].GetStorage();
+ }
+
+ // @todo: get rid of templates, so it doesn't compile duplicates and we're able to merge things to .cpp
+ /// add new configuration variable
+ /// @returns: index of added variable
+ template requires (!std::is_array_v)
+ std::size_t AddVariable(const FNV1A_t uNameHash, const FNV1A_t uTypeHash, const T& valueDefault)
+ {
+ vecVariables.emplace_back(uNameHash, uTypeHash, valueDefault);
+ return vecVariables.size() - 1U;
+ }
+
+ /// add new configuration array variable initialized by single value
+ /// @returns: index of added array variable
+ template requires (std::is_array_v)
+ std::size_t AddVariableArray(const FNV1A_t uNameHash, const FNV1A_t uTypeHash, const std::remove_pointer_t> valueDefault)
+ {
+ using BaseType_t = std::remove_pointer_t>;
+
+ T arrValueDefault;
+ for (std::size_t i = 0U; i < sizeof(T) / sizeof(BaseType_t); i++)
+ arrValueDefault[i] = valueDefault;
+
+ vecVariables.emplace_back(uNameHash, uTypeHash, arrValueDefault);
+ return vecVariables.size() - 1U;
+ }
+
+ /// add new configuration array variable with multiple values initialized
+ /// @returns: index of added array variable
+ template requires (std::is_array_v)
+ std::size_t AddVariableArray(const FNV1A_t uNameHash, const FNV1A_t uTypeHash, std::initializer_list>> vecValuesDefault)
+ {
+ using BaseType_t = std::remove_pointer_t>;
+
+ T arrValueDefault;
+ CRT::MemorySet(arrValueDefault, 0U, sizeof(T));
+ CRT::MemoryCopy(arrValueDefault, vecValuesDefault.begin(), vecValuesDefault.size() * sizeof(BaseType_t));
+
+ vecVariables.emplace_back(uNameHash, uTypeHash, arrValueDefault);
+ return vecVariables.size() - 1U;
+ }
+
+ inline void RemoveVariable(const std::size_t nIndex)
+ {
+ vecVariables.erase(vecVariables.begin() + nIndex);
+ }
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/convars.cpp b/examples/cs2-silent-aim-master/cstrike/core/convars.cpp
new file mode 100644
index 0000000..594c901
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/convars.cpp
@@ -0,0 +1,163 @@
+// used: [stl] vector
+#include
+// used: [stl] find_if
+#include
+
+#include "convars.h"
+
+// used: convar interface
+#include "interfaces.h"
+#include "../sdk/interfaces/ienginecvar.h"
+// used: l_print
+#include "../utilities/log.h"
+
+// used: getworkingpath
+#include "../core.h"
+
+inline static void WriteConVarType(HANDLE hFile, const uint32_t nType)
+{
+ switch ((EConVarType)nType)
+ {
+ case EConVarType_Bool:
+ ::WriteFile(hFile, CS_XOR("[bool] "), CRT::StringLength(CS_XOR("[bool] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Int16:
+ ::WriteFile(hFile, CS_XOR("[int16] "), CRT::StringLength(CS_XOR("[int16] ")), nullptr, nullptr);
+ break;
+ case EConVarType_UInt16:
+ ::WriteFile(hFile, CS_XOR("[uint16] "), CRT::StringLength(CS_XOR("[uint16] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Int32:
+ ::WriteFile(hFile, CS_XOR("[int32] "), CRT::StringLength(CS_XOR("[int32] ")), nullptr, nullptr);
+ break;
+ case EConVarType_UInt32:
+ ::WriteFile(hFile, CS_XOR("[uint32] "), CRT::StringLength(CS_XOR("[uint32] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Int64:
+ ::WriteFile(hFile, CS_XOR("[int64] "), CRT::StringLength(CS_XOR("[int64] ")), nullptr, nullptr);
+ break;
+ case EConVarType_UInt64:
+ ::WriteFile(hFile, CS_XOR("[uint64] "), CRT::StringLength(CS_XOR("[uint64] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Float32:
+ ::WriteFile(hFile, CS_XOR("[float32] "), CRT::StringLength(CS_XOR("[float32] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Float64:
+ ::WriteFile(hFile, CS_XOR("[float64] "), CRT::StringLength(CS_XOR("[float64] ")), nullptr, nullptr);
+ break;
+ case EConVarType_String:
+ ::WriteFile(hFile, CS_XOR("[string] "), CRT::StringLength(CS_XOR("[string] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Color:
+ ::WriteFile(hFile, CS_XOR("[color] "), CRT::StringLength(CS_XOR("[color] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Vector2:
+ ::WriteFile(hFile, CS_XOR("[vector2] "), CRT::StringLength(CS_XOR("[vector2] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Vector3:
+ ::WriteFile(hFile, CS_XOR("[vector3] "), CRT::StringLength(CS_XOR("[vector3] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Vector4:
+ ::WriteFile(hFile, CS_XOR("[vector4] "), CRT::StringLength(CS_XOR("[vector4] ")), nullptr, nullptr);
+ break;
+ case EConVarType_Qangle:
+ ::WriteFile(hFile, CS_XOR("[qangle] "), CRT::StringLength(CS_XOR("[qangle] ")), nullptr, nullptr);
+ break;
+ default:
+ ::WriteFile(hFile, CS_XOR("[unknown-type] "), CRT::StringLength(CS_XOR("[unknown-type] ")), nullptr, nullptr);
+ break;
+ }
+}
+
+inline static void WriteConVarFlags(HANDLE hFile, const uint32_t nFlags)
+{
+ if (nFlags & FCVAR_CLIENTDLL)
+ ::WriteFile(hFile, CS_XOR("[client.dll] "), CRT::StringLength(CS_XOR("[client.dll] ")), nullptr, nullptr);
+ else if (nFlags & FCVAR_GAMEDLL)
+ ::WriteFile(hFile, CS_XOR("[games's dll] "), CRT::StringLength(CS_XOR("[games's dll] ")), nullptr, nullptr);
+
+ if (nFlags & FCVAR_PROTECTED)
+ ::WriteFile(hFile, CS_XOR("[protected] "), CRT::StringLength(CS_XOR("[protected] ")), nullptr, nullptr);
+
+ if (nFlags & FCVAR_CHEAT)
+ ::WriteFile(hFile, CS_XOR("[cheat] "), CRT::StringLength(CS_XOR("[cheat] ")), nullptr, nullptr);
+
+ if (nFlags & FCVAR_HIDDEN)
+ ::WriteFile(hFile, CS_XOR("[hidden] "), CRT::StringLength(CS_XOR("[hidden] ")), nullptr, nullptr);
+
+ if (nFlags & FCVAR_DEVELOPMENTONLY)
+ ::WriteFile(hFile, CS_XOR("[devonly] "), CRT::StringLength(CS_XOR("[devonly] ")), nullptr, nullptr);
+
+ ::WriteFile(hFile, CS_XOR("\n"), CRT::StringLength(CS_XOR("\n")), nullptr, nullptr);
+}
+
+bool CONVAR::Dump(const wchar_t* wszFileName)
+{
+ wchar_t wszDumpFilePath[MAX_PATH];
+ if (!CORE::GetWorkingPath(wszDumpFilePath))
+ return false;
+
+ CRT::StringCat(wszDumpFilePath, wszFileName);
+
+ HANDLE hOutFile = ::CreateFileW(wszDumpFilePath, GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
+ if (hOutFile == INVALID_HANDLE_VALUE)
+ return false;
+
+ // @todo: maybe remove this redundant? and put it inside CRT::String_t c'tor
+ const std::time_t time = std::time(nullptr);
+ std::tm timePoint;
+ localtime_s(&timePoint, &time);
+
+ CRT::String_t<64> szTimeBuffer(CS_XOR("[%d-%m-%Y %T] asphyxia | convars dump\n\n"), &timePoint);
+
+ // write current date, time and info
+ ::WriteFile(hOutFile, szTimeBuffer.Data(), szTimeBuffer.Length(), nullptr, nullptr);
+
+ for (int i = I::Cvar->listConvars.Head(); i != I::Cvar->listConvars.InvalidIndex(); i = I::Cvar->listConvars.Next(i))
+ {
+ CConVar* pConVar = I::Cvar->listConvars.Element(i);
+ if (pConVar != nullptr)
+ {
+ // dump to file
+ WriteConVarType(hOutFile, pConVar->nType);
+
+ CRT::String_t<526> szBuffer(CS_XOR("%s : \"%s\" "), pConVar->szName, pConVar->szDescription[0] == '\0' ? CS_XOR("no description") : pConVar->szDescription);
+ ::WriteFile(hOutFile, szBuffer.Data(), szBuffer.Length(), nullptr, nullptr);
+
+ // write flags
+ WriteConVarFlags(hOutFile, pConVar->nFlags);
+ }
+ }
+
+ ::CloseHandle(hOutFile);
+
+ return true;
+}
+
+bool CONVAR::Setup()
+{
+ bool bSuccess = true;
+
+ m_pitch = I::Cvar->Find(FNV1A::HashConst("m_pitch"));
+ bSuccess &= m_pitch != nullptr;
+
+ m_yaw = I::Cvar->Find(FNV1A::HashConst("m_yaw"));
+ bSuccess &= m_yaw != nullptr;
+
+ sensitivity = I::Cvar->Find(FNV1A::HashConst("sensitivity"));
+ bSuccess &= sensitivity != nullptr;
+
+ game_type = I::Cvar->Find(FNV1A::HashConst("game_type"));
+ bSuccess &= game_type != nullptr;
+
+ game_mode = I::Cvar->Find(FNV1A::HashConst("game_mode"));
+ bSuccess &= game_mode != nullptr;
+
+ mp_teammates_are_enemies = I::Cvar->Find(FNV1A::HashConst("mp_teammates_are_enemies"));
+ bSuccess &= mp_teammates_are_enemies != nullptr;
+
+ sv_autobunnyhopping = I::Cvar->Find(FNV1A::HashConst("sv_autobunnyhopping"));
+ bSuccess &= sv_autobunnyhopping != nullptr;
+
+ return bSuccess;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/convars.h b/examples/cs2-silent-aim-master/cstrike/core/convars.h
new file mode 100644
index 0000000..6da2069
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/convars.h
@@ -0,0 +1,22 @@
+#pragma once
+
+class CConVar;
+
+namespace CONVAR
+{
+ // dump convars to file
+ bool Dump(const wchar_t* wszFileName);
+ // setup convars
+ bool Setup();
+
+ inline CConVar* m_pitch = nullptr;
+ inline CConVar* m_yaw = nullptr;
+ inline CConVar* sensitivity = nullptr;
+
+ inline CConVar* game_type = nullptr;
+ inline CConVar* game_mode = nullptr;
+
+ inline CConVar* mp_teammates_are_enemies = nullptr;
+
+ inline CConVar* sv_autobunnyhopping = nullptr;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/hooks.cpp b/examples/cs2-silent-aim-master/cstrike/core/hooks.cpp
new file mode 100644
index 0000000..76bfba8
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/hooks.cpp
@@ -0,0 +1,303 @@
+#include "hooks.h"
+
+// used: variables
+#include "variables.h"
+
+// used: game's sdk
+#include "../sdk/interfaces/iswapchaindx11.h"
+#include "../sdk/interfaces/iviewrender.h"
+#include "../sdk/interfaces/cgameentitysystem.h"
+#include "../sdk/interfaces/ccsgoinput.h"
+#include "../sdk/interfaces/iinputsystem.h"
+#include "../sdk/interfaces/iengineclient.h"
+#include "../sdk/interfaces/inetworkclientservice.h"
+#include "../sdk/interfaces/iglobalvars.h"
+#include "../sdk/interfaces/imaterialsystem.h"
+#include "../sdk/interfaces/ipvs.h"
+
+// used: viewsetup
+#include "../sdk/datatypes/viewsetup.h"
+
+// used: entity
+#include "../sdk/entity.h"
+
+// used: get virtual function, find pattern, ...
+#include "../utilities/memory.h"
+// used: inputsystem
+#include "../utilities/inputsystem.h"
+// used: draw
+#include "../utilities/draw.h"
+
+// used: features callbacks
+#include "../features.h"
+// used: CRC rebuild
+#include "../features/CRC.h"
+
+// used: game's interfaces
+#include "interfaces.h"
+#include "sdk.h"
+
+// used: menu
+#include "menu.h"
+
+bool H::Setup()
+{
+ if (MH_Initialize() != MH_OK)
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to initialize minhook");
+
+ return false;
+ }
+ L_PRINT(LOG_INFO) << CS_XOR("minhook initialization completed");
+
+ if (!hkPresent.Create(MEM::GetVFunc(I::SwapChain->pDXGISwapChain, VTABLE::D3D::PRESENT), reinterpret_cast(&Present)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"Present\" hook has been created");
+
+ if (!hkResizeBuffers.Create(MEM::GetVFunc(I::SwapChain->pDXGISwapChain, VTABLE::D3D::RESIZEBUFFERS), reinterpret_cast(&ResizeBuffers)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"ResizeBuffers\" hook has been created");
+
+ // creat swap chain hook
+ IDXGIDevice* pDXGIDevice = NULL;
+ I::Device->QueryInterface(IID_PPV_ARGS(&pDXGIDevice));
+
+ IDXGIAdapter* pDXGIAdapter = NULL;
+ pDXGIDevice->GetAdapter(&pDXGIAdapter);
+
+ IDXGIFactory* pIDXGIFactory = NULL;
+ pDXGIAdapter->GetParent(IID_PPV_ARGS(&pIDXGIFactory));
+
+ if (!hkCreateSwapChain.Create(MEM::GetVFunc(pIDXGIFactory, VTABLE::DXGI::CREATESWAPCHAIN), reinterpret_cast(&CreateSwapChain)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"CreateSwapChain\" hook has been created");
+
+ pDXGIDevice->Release();
+ pDXGIDevice = nullptr;
+ pDXGIAdapter->Release();
+ pDXGIAdapter = nullptr;
+ pIDXGIFactory->Release();
+ pIDXGIFactory = nullptr;
+
+ // @ida: class CViewRender->OnRenderStart call GetMatricesForView
+ if (!hkGetMatrixForView.Create(MEM::FindPattern(CLIENT_DLL, CS_XOR("40 53 48 81 EC ? ? ? ? 49 8B C1")), reinterpret_cast(&GetMatrixForView)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"GetMatrixForView\" hook has been created");
+
+ // @ida: #STR: cl: CreateMove clamped invalid attack history index %d in frame history to -1. Was %d, frame history size %d.\n
+ if (!hkCreateMove.Create(MEM::GetVFunc(I::Input, VTABLE::CLIENT::CREATEMOVE), reinterpret_cast(&CreateMove)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"CreateMove\" hook has been created");
+
+ if (!hkMouseInputEnabled.Create(MEM::GetVFunc(I::Input, VTABLE::CLIENT::MOUSEINPUTENABLED), reinterpret_cast(&MouseInputEnabled)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"MouseInputEnabled\" hook has been created");
+
+ if (!hkFrameStageNotify.Create(MEM::GetVFunc(I::Client, VTABLE::CLIENT::FRAMESTAGENOTIFY), reinterpret_cast(&FrameStageNotify)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"FrameStageNotify\" hook has been created");
+
+ // @ida: ClientModeShared -> #STR: "mapname", "transition", "game_newmap"
+ if (!hkLevelInit.Create(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 ? 56 48 83 EC ? 48 8B 0D ? ? ? ? 48 8B F2")), reinterpret_cast(&LevelInit)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"LevelInit\" hook has been created");
+
+ // @ida: ClientModeShared -> #STR: "map_shutdown"
+ if (!hkLevelShutdown.Create(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 83 EC ? 48 8B 0D ? ? ? ? 48 8D 15 ? ? ? ? 45 33 C9 45 33 C0 48 8B 01 FF 50 ? 48 85 C0 74 ? 48 8B 0D ? ? ? ? 48 8B D0 4C 8B 01 41 FF 50 ? 48 83 C4")), reinterpret_cast(&LevelShutdown)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"LevelShutdown\" hook has been created");
+
+ // @note: seems to do nothing for now...
+ // @ida: ClientModeCSNormal->OverrideView idx 15
+ //v21 = flSomeWidthSize * 0.5;
+ //v22 = *flSomeHeightSize * 0.5;
+ //*(float*)(pSetup + 0x49C) = v21; // m_OrthoRight
+ //*(float*)(pSetup + 0x494) = -v21; // m_OrthoLeft
+ //*(float*)(pSetup + 0x498) = -v22; // m_OrthoTop
+ //*(float*)(pSetup + 0x4A0) = v22; // m_OrthoBottom
+ //if (!hkOverrideView.Create(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 56 41 57 48 83 EC ? 48 8B FA E8")), reinterpret_cast(&OverrideView)))
+ // return false;
+
+ //L_PRINT(LOG_INFO) << CS_XOR("\"OverrideView\" hook has been created");
+
+ if (!hkDrawObject.Create(MEM::FindPattern(SCENESYSTEM_DLL, CS_XOR("48 8B C4 53 41 54 41 55 48 81 EC ? ? ? ? 4D 63 E1")), reinterpret_cast(&DrawObject)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"DrawObject\" hook has been created");
+
+ if (!hkIsRelativeMouseMode.Create(MEM::GetVFunc(I::InputSystem, VTABLE::INPUTSYSTEM::ISRELATIVEMOUSEMODE), reinterpret_cast(&IsRelativeMouseMode)))
+ return false;
+ L_PRINT(LOG_INFO) << CS_XOR("\"IsRelativeMouseMode\" hook has been created");
+
+ return true;
+}
+
+void H::Destroy()
+{
+ MH_DisableHook(MH_ALL_HOOKS);
+ MH_RemoveHook(MH_ALL_HOOKS);
+
+ MH_Uninitialize();
+}
+
+HRESULT __stdcall H::Present(IDXGISwapChain* pSwapChain, UINT uSyncInterval, UINT uFlags)
+{
+ const auto oPresent = hkPresent.GetOriginal();
+
+ // recreate it if it's not valid
+ if (I::RenderTargetView == nullptr)
+ I::CreateRenderTarget();
+
+ // set our render target
+ if (I::RenderTargetView != nullptr)
+ I::DeviceContext->OMSetRenderTargets(1, &I::RenderTargetView, nullptr);
+
+ F::OnPresent();
+
+ return oPresent(I::SwapChain->pDXGISwapChain, uSyncInterval, uFlags);
+}
+
+HRESULT CS_FASTCALL H::ResizeBuffers(IDXGISwapChain* pSwapChain, std::uint32_t nBufferCount, std::uint32_t nWidth, std::uint32_t nHeight, DXGI_FORMAT newFormat, std::uint32_t nFlags)
+{
+ const auto oResizeBuffer = hkResizeBuffers.GetOriginal();
+
+ auto hResult = oResizeBuffer(pSwapChain, nBufferCount, nWidth, nHeight, newFormat, nFlags);
+ if (SUCCEEDED(hResult))
+ I::CreateRenderTarget();
+
+ return hResult;
+}
+
+HRESULT __stdcall H::CreateSwapChain(IDXGIFactory* pFactory, IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain)
+{
+ const auto oCreateSwapChain = hkCreateSwapChain.GetOriginal();
+
+ I::DestroyRenderTarget();
+ L_PRINT(LOG_INFO) << CS_XOR("render target view has been destroyed");
+
+ return oCreateSwapChain(pFactory, pDevice, pDesc, ppSwapChain);
+}
+
+long H::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ if (D::OnWndProc(hWnd, uMsg, wParam, lParam))
+ return 1L;
+
+ return ::CallWindowProcW(IPT::pOldWndProc, hWnd, uMsg, wParam, lParam);
+}
+
+ViewMatrix_t* CS_FASTCALL H::GetMatrixForView(CRenderGameSystem* pRenderGameSystem, IViewRender* pViewRender, ViewMatrix_t* pOutWorldToView, ViewMatrix_t* pOutViewToProjection, ViewMatrix_t* pOutWorldToProjection, ViewMatrix_t* pOutWorldToPixels)
+{
+ const auto oGetMatrixForView = hkGetMatrixForView.GetOriginal();
+ ViewMatrix_t* matResult = oGetMatrixForView(pRenderGameSystem, pViewRender, pOutWorldToView, pOutViewToProjection, pOutWorldToProjection, pOutWorldToPixels);
+
+ // get view matrix
+ SDK::ViewMatrix = *pOutWorldToProjection;
+ // get camera position
+ // @note: ida @GetMatrixForView(global_pointer, pRenderGameSystem + 16, ...)
+ SDK::CameraPosition = pViewRender->vecOrigin;
+
+ return matResult;
+}
+
+bool CS_FASTCALL H::CreateMove(CCSGOInput* pInput, int nSlot, bool bActive)
+{
+ const auto oCreateMove = hkCreateMove.GetOriginal();
+ const bool bResult = oCreateMove(pInput, nSlot, bActive);
+
+ if (!I::Engine->IsConnected() || !I::Engine->IsInGame())
+ return bResult;
+
+ CUserCmd* pCmd = SDK::Cmd = pInput->GetUserCmd();
+ if (pCmd == nullptr)
+ return bResult;
+
+ CBaseUserCmdPB* pBaseCmd = pCmd->csgoUserCmd.pBaseCmd;
+ if (pBaseCmd == nullptr)
+ return bResult;
+
+ SDK::LocalController = CCSPlayerController::GetLocalPlayerController();
+ if (SDK::LocalController == nullptr)
+ return bResult;
+
+ SDK::LocalPawn = I::GameResourceService->pGameEntitySystem->Get(SDK::LocalController->GetPawnHandle());
+ if (SDK::LocalPawn == nullptr)
+ return bResult;
+
+ F::OnCreateMove(pCmd, pBaseCmd, SDK::LocalController);
+
+ CRC::Save(pBaseCmd);
+ if (CRC::CalculateCRC(pBaseCmd) == true)
+ CRC::Apply(pCmd);
+
+ return bResult;
+}
+
+bool CS_FASTCALL H::MouseInputEnabled(void* pThisptr)
+{
+ const auto oMouseInputEnabled = hkMouseInputEnabled.GetOriginal();
+ return MENU::bMainWindowOpened ? false : oMouseInputEnabled(pThisptr);
+}
+
+void CS_FASTCALL H::FrameStageNotify(void* rcx, int nFrameStage)
+{
+ const auto oFrameStageNotify = hkFrameStageNotify.GetOriginal();
+ F::OnFrameStageNotify(nFrameStage);
+
+ return oFrameStageNotify(rcx, nFrameStage);
+}
+
+__int64* CS_FASTCALL H::LevelInit(void* pClientModeShared, const char* szNewMap)
+{
+ const auto oLevelInit = hkLevelInit.GetOriginal();
+ // if global variables are not captured during I::Setup or we join a new game, recapture it
+ if (I::GlobalVars == nullptr)
+ I::GlobalVars = *reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 0D ? ? ? ? 48 89 41")), 0x3, 0x7));
+
+ // disable model occlusion
+ I::PVS->Set(false);
+
+ return oLevelInit(pClientModeShared, szNewMap);
+}
+
+__int64 CS_FASTCALL H::LevelShutdown(void* pClientModeShared)
+{
+ const auto oLevelShutdown = hkLevelShutdown.GetOriginal();
+ // reset global variables since it got discarded by the game
+ I::GlobalVars = nullptr;
+
+ return oLevelShutdown(pClientModeShared);
+}
+
+void CS_FASTCALL H::OverrideView(void* pClientModeCSNormal, CViewSetup* pSetup)
+{
+ const auto oOverrideView = hkOverrideView.GetOriginal();
+ if (!I::Engine->IsConnected() || !I::Engine->IsInGame())
+ return hkOverrideView.GetOriginal()(pClientModeCSNormal, pSetup);
+
+ oOverrideView(pClientModeCSNormal, pSetup);
+}
+
+void CS_FASTCALL H::DrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
+{
+ const auto oDrawObject = hkDrawObject.GetOriginal();
+ if (!I::Engine->IsConnected() || !I::Engine->IsInGame())
+ return oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+
+ if (SDK::LocalController == nullptr || SDK::LocalPawn == nullptr)
+ return oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+
+ if (!F::OnDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2))
+ oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+}
+
+void* H::IsRelativeMouseMode(void* pThisptr, bool bActive)
+{
+ const auto oIsRelativeMouseMode = hkIsRelativeMouseMode.GetOriginal();
+
+ MENU::bMainActive = bActive;
+
+ if (MENU::bMainWindowOpened)
+ return oIsRelativeMouseMode(pThisptr, false);
+
+ return oIsRelativeMouseMode(pThisptr, bActive);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/hooks.h b/examples/cs2-silent-aim-master/cstrike/core/hooks.h
new file mode 100644
index 0000000..408e26d
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/hooks.h
@@ -0,0 +1,97 @@
+#pragma once
+
+// used: [d3d] api
+#include
+#include
+
+// used: chookobject
+#include "../utilities/detourhook.h"
+
+// used: viewmatrix_t
+#include "../sdk/datatypes/matrix.h"
+
+namespace VTABLE
+{
+ namespace D3D
+ {
+ enum
+ {
+ PRESENT = 8U,
+ RESIZEBUFFERS = 13U,
+ RESIZEBUFFERS_CSTYLE = 39U,
+ };
+ }
+
+ namespace DXGI
+ {
+ enum
+ {
+ CREATESWAPCHAIN = 10U,
+ };
+ }
+
+ namespace CLIENT
+ {
+ enum
+ {
+ CREATEMOVE = 5U,
+ MOUSEINPUTENABLED = 16U,
+ FRAMESTAGENOTIFY = 36U,
+ };
+ }
+
+ namespace INPUTSYSTEM
+ {
+ enum
+ {
+ ISRELATIVEMOUSEMODE = 78U,
+ };
+ }
+}
+
+class CRenderGameSystem;
+class IViewRender;
+class CCSGOInput;
+class CViewSetup;
+class CMeshData;
+
+namespace H
+{
+ bool Setup();
+ void Destroy();
+
+ /* @section: handlers */
+ // d3d11 & wndproc
+ HRESULT WINAPI Present(IDXGISwapChain* pSwapChain, UINT uSyncInterval, UINT uFlags);
+ HRESULT CS_FASTCALL ResizeBuffers(IDXGISwapChain* pSwapChain, std::uint32_t nBufferCount, std::uint32_t nWidth, std::uint32_t nHeight, DXGI_FORMAT newFormat, std::uint32_t nFlags);
+ HRESULT WINAPI CreateSwapChain(IDXGIFactory* pFactory, IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain);
+ long CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
+
+ // game's functions
+ ViewMatrix_t* CS_FASTCALL GetMatrixForView(CRenderGameSystem* pRenderGameSystem, IViewRender* pViewRender, ViewMatrix_t* pOutWorldToView, ViewMatrix_t* pOutViewToProjection, ViewMatrix_t* pOutWorldToProjection, ViewMatrix_t* pOutWorldToPixels);
+ bool CS_FASTCALL CreateMove(CCSGOInput* pInput, int nSlot, bool bActive);
+ bool CS_FASTCALL MouseInputEnabled(void* pThisptr);
+ void CS_FASTCALL FrameStageNotify(void* rcx, int nFrameStage);
+ __int64* CS_FASTCALL LevelInit(void* pClientModeShared, const char* szNewMap);
+ __int64 CS_FASTCALL LevelShutdown(void* pClientModeShared);
+ void CS_FASTCALL OverrideView(void* pClientModeCSNormal, CViewSetup* pSetup);
+ void CS_FASTCALL DrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
+ void* IsRelativeMouseMode(void* pThisptr, bool bActive);
+
+ /* @section: managers */
+ inline CBaseHookObject hkPresent = {};
+ inline CBaseHookObject hkResizeBuffers = {};
+ inline CBaseHookObject hkCreateSwapChain = {};
+ inline CBaseHookObject hkWndProc = {};
+
+ inline CBaseHookObject hkGetMatrixForView = {};
+ inline CBaseHookObject hkCreateMove = {};
+ inline CBaseHookObject hkMouseInputEnabled = {};
+ inline CBaseHookObject hkIsRelativeMouseMode = {};
+ inline CBaseHookObject hkFrameStageNotify = {};
+ inline CBaseHookObject hkLevelInit = {};
+ inline CBaseHookObject hkLevelShutdown = {};
+ inline CBaseHookObject hkOverrideView = {};
+
+ inline CBaseHookObject hkDrawObject = {};
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/interfaces.cpp b/examples/cs2-silent-aim-master/cstrike/core/interfaces.cpp
new file mode 100644
index 0000000..dfb30e6
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/interfaces.cpp
@@ -0,0 +1,251 @@
+// used: [d3d] api
+#include
+
+#include "interfaces.h"
+
+// used: findpattern, callvirtual, getvfunc...
+#include "../utilities/memory.h"
+
+// used: l_print
+#include "../utilities/log.h"
+
+// used: iswapchaindx11
+#include "../sdk/interfaces/iswapchaindx11.h"
+#include "../sdk/interfaces/iresourcesystem.h"
+
+#pragma region interfaces_get
+
+using InstantiateInterfaceFn_t = void* (*)();
+
+class CInterfaceRegister
+{
+public:
+ InstantiateInterfaceFn_t fnCreate;
+ const char* szName;
+ CInterfaceRegister* pNext;
+};
+
+static const CInterfaceRegister* GetRegisterList(const wchar_t* wszModuleName)
+{
+ void* hModule = MEM::GetModuleBaseHandle(wszModuleName);
+ if (hModule == nullptr)
+ return nullptr;
+
+ std::uint8_t* pCreateInterface = reinterpret_cast(MEM::GetExportAddress(hModule, CS_XOR("CreateInterface")));
+
+ if (pCreateInterface == nullptr)
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to get \"CreateInterface\" address");
+ return nullptr;
+ }
+
+ return *reinterpret_cast(MEM::ResolveRelativeAddress(pCreateInterface, 0x3, 0x7));
+}
+
+template
+T* Capture(const CInterfaceRegister* pModuleRegister, const char* szInterfaceName)
+{
+ for (const CInterfaceRegister* pRegister = pModuleRegister; pRegister != nullptr; pRegister = pRegister->pNext)
+ {
+ if (const std::size_t nInterfaceNameLength = CRT::StringLength(szInterfaceName);
+ // found needed interface
+ CRT::StringCompareN(szInterfaceName, pRegister->szName, nInterfaceNameLength) == 0 &&
+ // and we've given full name with hardcoded digits
+ (CRT::StringLength(pRegister->szName) == nInterfaceNameLength ||
+ // or it contains digits after name
+ CRT::StringToInteger(pRegister->szName + nInterfaceNameLength, nullptr, 10) > 0))
+ {
+ // capture our interface
+ void* pInterface = pRegister->fnCreate();
+
+#ifdef _DEBUG
+ // log interface address
+ L_PRINT(LOG_INFO) << CS_XOR("captured \"") << pRegister->szName << CS_XOR("\" interface at address: ") << L::AddFlags(LOG_MODE_INT_SHOWBASE | LOG_MODE_INT_FORMAT_HEX) << reinterpret_cast(pInterface);
+#else
+ L_PRINT(LOG_INFO) << CS_XOR("captured \"") << pRegister->szName << CS_XOR("\" interface");
+#endif
+
+ return static_cast(pInterface);
+ }
+ }
+
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to find interface \"") << szInterfaceName << CS_XOR("\"");
+ return nullptr;
+}
+
+#pragma endregion
+
+bool I::Setup()
+{
+ bool bSuccess = true;
+
+#pragma region interface_game_exported
+ const auto pTier0Handle = MEM::GetModuleBaseHandle(TIER0_DLL);
+ if (pTier0Handle == nullptr)
+ return false;
+
+ MemAlloc = *reinterpret_cast(MEM::GetExportAddress(pTier0Handle, CS_XOR("g_pMemAlloc")));
+ bSuccess &= (MemAlloc != nullptr);
+
+ const auto pSchemaSystemRegisterList = GetRegisterList(SCHEMASYSTEM_DLL);
+ if (pSchemaSystemRegisterList == nullptr)
+ return false;
+
+ SchemaSystem = Capture(pSchemaSystemRegisterList, SCHEMA_SYSTEM);
+ bSuccess &= (SchemaSystem != nullptr);
+
+ const auto pInputSystemRegisterList = GetRegisterList(INPUTSYSTEM_DLL);
+ if (pInputSystemRegisterList == nullptr)
+ return false;
+
+ InputSystem = Capture(pInputSystemRegisterList, INPUT_SYSTEM_VERSION);
+ bSuccess &= (InputSystem != nullptr);
+
+ const auto pEngineRegisterList = GetRegisterList(ENGINE2_DLL);
+ if (pEngineRegisterList == nullptr)
+ return false;
+
+ GameResourceService = Capture(pEngineRegisterList, GAME_RESOURCE_SERVICE_CLIENT);
+ bSuccess &= (GameResourceService != nullptr);
+
+ Engine = Capture(pEngineRegisterList, SOURCE2_ENGINE_TO_CLIENT);
+ bSuccess &= (Engine != nullptr);
+
+ NetworkClientService = Capture(pEngineRegisterList, NETWORK_CLIENT_SERVICE);
+ bSuccess &= (NetworkClientService != nullptr);
+
+ const auto pTier0RegisterList = GetRegisterList(TIER0_DLL);
+ if (pTier0RegisterList == nullptr)
+ return false;
+
+ Cvar = Capture(pTier0RegisterList, ENGINE_CVAR);
+ bSuccess &= (Cvar != nullptr);
+
+ const auto pClientRegister = GetRegisterList(CLIENT_DLL);
+ if (pClientRegister == nullptr)
+ return false;
+
+ Client = Capture(pClientRegister, SOURCE2_CLIENT);
+ bSuccess &= (Client != nullptr);
+
+ const auto pMaterialSystem2Register = GetRegisterList(MATERIAL_SYSTEM2_DLL);
+ if (pMaterialSystem2Register == nullptr)
+ return false;
+
+ MaterialSystem2 = Capture(pMaterialSystem2Register, MATERIAL_SYSTEM2);
+ bSuccess &= (MaterialSystem2 != nullptr);
+
+ const auto pResourceSystemRegisterList = GetRegisterList(RESOURCESYSTEM_DLL);
+ if (pResourceSystemRegisterList == nullptr)
+ return false;
+
+ ResourceSystem = Capture(pResourceSystemRegisterList, RESOURCE_SYSTEM);
+ bSuccess &= (ResourceSystem != nullptr);
+
+ if (ResourceSystem != nullptr)
+ {
+ ResourceHandleUtils = reinterpret_cast(ResourceSystem->QueryInterface(RESOURCE_HANDLE_UTILS));
+ bSuccess &= (ResourceHandleUtils != nullptr);
+ }
+
+#pragma endregion
+
+ // @ida: #STR: "r_gpu_mem_stats", "-threads", "CTSListBase: Misaligned list\n", "CTSQueue: Misaligned queue\n", "Display GPU memory usage.", "-r_max_device_threads"
+ SwapChain = **reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(RENDERSYSTEM_DLL, CS_XOR("66 0F 7F 0D ? ? ? ? 66 0F 7F 05 ? ? ? ? 0F 1F 40")), 0x4, 0x8));
+ bSuccess &= (SwapChain != nullptr);
+
+ // grab's d3d11 interfaces for later use
+ if (SwapChain != nullptr)
+ {
+ if (FAILED(SwapChain->pDXGISwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&Device)))
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to get device from swapchain");
+ CS_ASSERT(false);
+ return false;
+ }
+ else
+ // we successfully got device, so we can get immediate context
+ Device->GetImmediateContext(&DeviceContext);
+ }
+ bSuccess &= (Device != nullptr && DeviceContext != nullptr);
+
+ Input = *reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 8B 0D ? ? ? ? E8 ? ? ? ? 8B BE 84 12 00 00")), 0x3, 0x7));
+ bSuccess &= (Input != nullptr);
+
+ // @ida: STR '%s: %f tick(%d) curtime(%f) OnSequenceCycleChanged: %s : %d=[%s]'
+ GlobalVars = *reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 0D ? ? ? ? 48 89 41")), 0x3, 0x7));
+ bSuccess &= (GlobalVars != nullptr);
+
+ PVS = reinterpret_cast(MEM::ResolveRelativeAddress(MEM::FindPattern(ENGINE2_DLL, CS_XOR("48 8D 0D ? ? ? ? 33 D2 FF 50")), 0x3, 0x7));
+ bSuccess &= (PVS != nullptr);
+
+ GameTraceManager = *reinterpret_cast(MEM::GetAbsoluteAddress(MEM::FindPattern(CLIENT_DLL, CS_XOR("4C 8B 3D ? ? ? ? 24 C9 0C 49 66 0F 7F 45 ?")), 0x3, 0x0));
+ bSuccess &= (GameTraceManager != nullptr);
+
+ return bSuccess;
+}
+
+void I::CreateRenderTarget()
+{
+ if (FAILED(SwapChain->pDXGISwapChain->GetDevice(__uuidof(ID3D11Device), (void**)&Device)))
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to get device from swapchain");
+ CS_ASSERT(false);
+ }
+ else
+ // we successfully got device, so we can get immediate context
+ Device->GetImmediateContext(&DeviceContext);
+
+ // @note: i dont use this anywhere else so lambda is fine
+ static const auto GetCorrectDXGIFormat = [](DXGI_FORMAT eCurrentFormat)
+ {
+ switch (eCurrentFormat)
+ {
+ case DXGI_FORMAT_R8G8B8A8_UNORM_SRGB:
+ return DXGI_FORMAT_R8G8B8A8_UNORM;
+ }
+
+ return eCurrentFormat;
+ };
+
+ DXGI_SWAP_CHAIN_DESC sd;
+ SwapChain->pDXGISwapChain->GetDesc(&sd);
+
+ ID3D11Texture2D* pBackBuffer = nullptr;
+ if (SUCCEEDED(SwapChain->pDXGISwapChain->GetBuffer(0, IID_PPV_ARGS(&pBackBuffer))))
+ {
+ if (pBackBuffer)
+ {
+ D3D11_RENDER_TARGET_VIEW_DESC desc{};
+ desc.Format = static_cast(GetCorrectDXGIFormat(sd.BufferDesc.Format));
+ desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2D;
+ if (FAILED(Device->CreateRenderTargetView(pBackBuffer, &desc, &RenderTargetView)))
+ {
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to create render target view with D3D11_RTV_DIMENSION_TEXTURE2D...");
+ L_PRINT(LOG_INFO) << CS_XOR("retrying to create render target view with D3D11_RTV_DIMENSION_TEXTURE2DMS...");
+ desc.ViewDimension = D3D11_RTV_DIMENSION_TEXTURE2DMS;
+ if (FAILED(Device->CreateRenderTargetView(pBackBuffer, &desc, &RenderTargetView)))
+ {
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to create render target view with D3D11_RTV_DIMENSION_TEXTURE2D...");
+ L_PRINT(LOG_INFO) << CS_XOR("retrying...");
+ if (FAILED(Device->CreateRenderTargetView(pBackBuffer, NULL, &RenderTargetView)))
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to create render target view");
+ CS_ASSERT(false);
+ }
+ }
+ }
+ pBackBuffer->Release();
+ pBackBuffer = nullptr;
+ }
+ }
+}
+
+void I::DestroyRenderTarget()
+{
+ if (RenderTargetView != nullptr)
+ {
+ RenderTargetView->Release();
+ RenderTargetView = nullptr;
+ }
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/interfaces.h b/examples/cs2-silent-aim-master/cstrike/core/interfaces.h
new file mode 100644
index 0000000..d8a88dd
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/interfaces.h
@@ -0,0 +1,79 @@
+#pragma once
+
+#include "../common.h"
+
+// used: globalvariables
+#include "../sdk/interfaces/iglobalvars.h"
+
+#pragma region sdk_definitons
+#define GAME_RESOURCE_SERVICE_CLIENT CS_XOR("GameResourceServiceClientV00")
+#define SOURCE2_CLIENT CS_XOR("Source2Client00")
+#define SCHEMA_SYSTEM CS_XOR("SchemaSystem_00")
+#define INPUT_SYSTEM_VERSION CS_XOR("InputSystemVersion00")
+#define SOURCE2_ENGINE_TO_CLIENT CS_XOR("Source2EngineToClient00")
+#define ENGINE_CVAR CS_XOR("VEngineCvar00")
+#define LOCALIZE CS_XOR("Localize_00")
+#define NETWORK_CLIENT_SERVICE CS_XOR("NetworkClientService_00")
+#define MATERIAL_SYSTEM2 CS_XOR("VMaterialSystem2_00")
+#define RESOURCE_SYSTEM CS_XOR("ResourceSystem013")
+#define RESOURCE_HANDLE_UTILS CS_XOR("ResourceHandleUtils001")
+
+// @source: master/game/shared/shareddefs.h
+#define TICK_INTERVAL 0.015625f
+#define TIME_TO_TICKS(TIME) (static_cast(0.5f + static_cast(TIME) / TICK_INTERVAL))
+#define TICKS_TO_TIME(TICKS) (TICK_INTERVAL * static_cast(TICKS))
+#define ROUND_TO_TICKS(TIME) (TICK_INTERVAL * TIME_TO_TICKS(TIME))
+#define TICK_NEVER_THINK (-1)
+#pragma endregion
+
+// game interfaces
+class ISwapChainDx11;
+class IMemAlloc;
+class CCSGOInput;
+class ISchemaSystem;
+class IInputSystem;
+class IGameResourceService;
+class ISource2Client;
+class IEngineClient;
+class IEngineCVar;
+class INetworkClientService;
+class IMaterialSystem2;
+class IResourceSystem;
+class CResourceHandleUtils;
+class CPVS;
+class CGameTraceManager;
+
+// [d3d] struct
+struct ID3D11Device;
+struct ID3D11DeviceContext;
+struct ID3D11RenderTargetView;
+
+namespace I
+{
+ bool Setup();
+
+ /* @section: helpers */
+ // create and destroy render target view for handling resize
+ void CreateRenderTarget();
+ void DestroyRenderTarget();
+
+ inline IMemAlloc* MemAlloc = nullptr;
+ inline ISwapChainDx11* SwapChain = nullptr;
+ inline ID3D11Device* Device = nullptr;
+ inline ID3D11DeviceContext* DeviceContext = nullptr;
+ inline ID3D11RenderTargetView* RenderTargetView = nullptr;
+ inline CCSGOInput* Input = nullptr;
+ inline ISchemaSystem* SchemaSystem = nullptr;
+ inline IGlobalVars* GlobalVars = nullptr;
+ inline IInputSystem* InputSystem = nullptr;
+ inline IGameResourceService* GameResourceService = nullptr;
+ inline ISource2Client* Client = nullptr;
+ inline IEngineClient* Engine = nullptr;
+ inline IEngineCVar* Cvar = nullptr;
+ inline INetworkClientService* NetworkClientService = nullptr;
+ inline IMaterialSystem2* MaterialSystem2 = nullptr;
+ inline IResourceSystem* ResourceSystem = nullptr;
+ inline CResourceHandleUtils* ResourceHandleUtils = nullptr;
+ inline CPVS* PVS = nullptr;
+ inline CGameTraceManager* GameTraceManager = nullptr;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/menu.cpp b/examples/cs2-silent-aim-master/cstrike/core/menu.cpp
new file mode 100644
index 0000000..1751b2c
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/menu.cpp
@@ -0,0 +1,744 @@
+#include "menu.h"
+
+// used: config variables
+#include "variables.h"
+
+// used: iinputsystem
+#include "interfaces.h"
+#include "../sdk/interfaces/iengineclient.h"
+#include "../sdk/interfaces/inetworkclientservice.h"
+#include "../sdk/interfaces/iglobalvars.h"
+#include "../sdk/interfaces/ienginecvar.h"
+
+// used: overlay's context
+#include "../features/visuals/overlay.h"
+
+// used: notifications
+#include "../utilities/notify.h"
+
+#pragma region menu_array_entries
+static constexpr const char* arrMiscDpiScale[] = {
+ "100%",
+ "125%",
+ "150%",
+ "175%",
+ "200%"
+};
+
+static const std::pair arrColors[] = {
+ { "[accent] - main", Vars.colAccent0 },
+ { "[accent] - dark (hover)", Vars.colAccent1 },
+ { "[accent] - darker (active)", Vars.colAccent2 },
+ { "[primitive] - text", Vars.colPrimtv0 },
+ { "[primitive] - background", Vars.colPrimtv1 },
+ { "[primitive] - disabled", Vars.colPrimtv2 },
+ { "[primitive] - frame background", Vars.colPrimtv3 },
+ { "[primitive] - border", Vars.colPrimtv4 },
+};
+
+static constexpr const char* arrMenuAddition[] = {
+ "dim",
+ "particle",
+ "glow"
+};
+#pragma endregion
+
+void MENU::RenderMainWindow()
+{
+ ImGuiIO& io = ImGui::GetIO();
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ // @test: we should always update the animation?
+ animMenuDimBackground.Update(io.DeltaTime, style.AnimationSpeed);
+ if (!bMainWindowOpened)
+ return;
+
+ const ImVec2 vecScreenSize = io.DisplaySize;
+ const float flBackgroundAlpha = animMenuDimBackground.GetValue(1.f);
+ flDpiScale = D::CalculateDPI(C_GET(int, Vars.nDpiScale));
+
+ // @note: we call this every frame because we utilizing rainbow color as well! however it's not really performance friendly?
+ UpdateStyle(&style);
+
+ if (flBackgroundAlpha > 0.f)
+ {
+ if (C_GET(unsigned int, Vars.bMenuAdditional) & MENU_ADDITION_DIM_BACKGROUND)
+ D::AddDrawListRect(ImGui::GetBackgroundDrawList(), ImVec2(0, 0), vecScreenSize, C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.Set(125 * flBackgroundAlpha), DRAW_RECT_FILLED);
+
+ if (C_GET(unsigned int, Vars.bMenuAdditional) & MENU_ADDITION_BACKGROUND_PARTICLE)
+ menuParticle.Render(ImGui::GetBackgroundDrawList(), vecScreenSize, flBackgroundAlpha);
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_Alpha, flBackgroundAlpha);
+
+ ImGui::SetNextWindowPos(ImVec2(vecScreenSize.x * 0.5f, vecScreenSize.y * 0.5f), ImGuiCond_Once, ImVec2(0.5f, 0.5f));
+ ImGui::SetNextWindowSize(ImVec2(550 * flDpiScale, 350 * flDpiScale), ImGuiCond_Always);
+
+ // handle main window get out of screen bound
+ // @note: we call this here so it will override the previous SetNextWindowPos
+ if (ImGuiWindow* pMainWindow = ImGui::FindWindowByName(CS_XOR("asphyxia")); pMainWindow != nullptr)
+ {
+ bool bRequireClamp = false;
+ ImVec2 vecWindowPos = pMainWindow->Pos;
+ if (pMainWindow->Pos.x < 0.0f)
+ {
+ bRequireClamp = true;
+ vecWindowPos.x = 0.0f;
+ }
+ else if (pMainWindow->Size.x + pMainWindow->Pos.x > vecScreenSize.x)
+ {
+ bRequireClamp = true;
+ vecWindowPos.x = vecScreenSize.x - pMainWindow->Size.x;
+ }
+ if (pMainWindow->Pos.y < 0.0f)
+ {
+ bRequireClamp = true;
+ vecWindowPos.y = 0.0f;
+ }
+ else if (pMainWindow->Size.y + pMainWindow->Pos.y > vecScreenSize.y)
+ {
+ bRequireClamp = true;
+ vecWindowPos.y = vecScreenSize.y - pMainWindow->Size.y;
+ }
+
+ if (bRequireClamp) // Necessary to prevent window from constantly undocking itself if docked.
+ ImGui::SetNextWindowPos(vecWindowPos, ImGuiCond_Always);
+ }
+
+ // render main window
+ ImGui::Begin(CS_XOR("asphyxia"), &bMainWindowOpened, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse);
+ {
+ const ImVec2 vecMenuPos = ImGui::GetWindowPos();
+ const ImVec2 vecMenuSize = ImGui::GetWindowSize();
+ ImDrawList* pDrawList = ImGui::GetWindowDrawList();
+
+ if (C_GET(unsigned int, Vars.bMenuAdditional) & MENU_ADDITION_GLOW)
+ D::AddDrawListShadowRect(ImGui::GetBackgroundDrawList(), vecMenuPos, vecMenuPos + vecMenuSize, C_GET(ColorPickerVar_t, Vars.colAccent0).colValue, 64.f * flDpiScale, style.WindowRounding, ImDrawFlags_ShadowCutOutShapeBackground);
+
+ const ImVec2 vecTitleSize = FONT::pMenu[C_GET(int, Vars.nDpiScale)]->CalcTextSizeA(12.f * flDpiScale, FLT_MAX, -1.f, CS_XOR("asphyxia"));
+ pDrawList->AddText(ImVec2(vecMenuPos.x + vecMenuSize.x - style.WindowPadding.x - vecTitleSize.x, vecMenuPos.y + style.WindowPadding.y), ImGui::GetColorU32(ImGuiCol_Text), CS_XOR("asphyxia"));
+
+ static const CTab arrTabs[] = {
+ //{ "ragebot", &T::RageBot },
+ { "legitbot", &T::LegitBot },
+ { "visuals", &T::Visuals }
+ //{ "miscellaneous", &T::Miscellaneous },
+ //{ "skins changer", &T::SkinsChanger }
+ };
+
+ T::Render(CS_XOR("##main_tabs"), arrTabs, CS_ARRAYSIZE(arrTabs), &nCurrentMainTab);
+ }
+ ImGui::End();
+
+ ImGui::PopStyleVar();
+}
+
+void MENU::RenderOverlayPreviewWindow()
+{
+ using namespace F::VISUALS::OVERLAY;
+
+ ImGuiStyle& style = ImGui::GetStyle();
+ // @note: call this function inside rendermainwindow, else expect a crash...
+ const ImVec2 vecMenuPos = ImGui::GetWindowPos();
+ const ImVec2 vecMenuSize = ImGui::GetWindowSize();
+
+ const ImVec2 vecOverlayPadding = ImVec2(30.f * flDpiScale, 50.f * flDpiScale);
+
+ ImGui::SetNextWindowPos(ImVec2(vecMenuPos.x + vecMenuSize.x + style.WindowPadding.x, vecMenuPos.y), ImGuiCond_Always);
+ ImGui::SetNextWindowSize(ImVec2(175 * flDpiScale, vecMenuSize.y), ImGuiCond_Always);
+ ImGui::Begin(CS_XOR("preview"), &bMainWindowOpened, ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize);
+ {
+ const ImVec2 vecWindowPos = ImGui::GetWindowPos();
+ const ImVec2 vecWindowSize = ImGui::GetWindowSize();
+
+ ImDrawList* pDrawList = ImGui::GetWindowDrawList();
+ Context_t context;
+
+ ImVec4 vecBox = {
+ vecWindowPos.x + vecOverlayPadding.x,
+ vecWindowPos.y + vecOverlayPadding.y,
+ vecWindowPos.x + vecWindowSize.x - vecOverlayPadding.x,
+ vecWindowPos.y + vecWindowSize.y - vecOverlayPadding.y
+ };
+
+ if (const auto& boxOverlayConfig = C_GET(FrameOverlayVar_t, Vars.overlayBox); boxOverlayConfig.bEnable)
+ {
+ const bool bHovered = context.AddBoxComponent(pDrawList, vecBox, 1, boxOverlayConfig.flThickness, boxOverlayConfig.flRounding, boxOverlayConfig.colPrimary, boxOverlayConfig.colOutline);
+ if (bHovered && ImGui::IsMouseClicked(ImGuiMouseButton_Right))
+ ImGui::OpenPopup(CS_XOR("context##box.component"));
+ }
+
+ if (const auto& nameOverlayConfig = C_GET(TextOverlayVar_t, Vars.overlayName); nameOverlayConfig.bEnable)
+ context.AddComponent(new CTextComponent(true, SIDE_TOP, DIR_TOP, FONT::pVisual, CS_XOR("asphyxia"), Vars.overlayName));
+
+ if (const auto& healthOverlayConfig = C_GET(BarOverlayVar_t, Vars.overlayHealthBar); healthOverlayConfig.bEnable)
+ {
+ const float flFactor = M_SIN(ImGui::GetTime() * 5.f) * 0.55f + 0.45f;
+ context.AddComponent(new CBarComponent(true, SIDE_LEFT, vecBox, flFactor, Vars.overlayHealthBar));
+ }
+
+ if (const auto& armorOverlayConfig = C_GET(BarOverlayVar_t, Vars.overlayArmorBar); armorOverlayConfig.bEnable)
+ {
+ const float flArmorFactor = M_SIN(ImGui::GetTime() * 5.f) * 0.55f + 0.45f;
+ context.AddComponent(new CBarComponent(false, SIDE_BOTTOM, vecBox, flArmorFactor, Vars.overlayArmorBar));
+ }
+
+ // only render context preview if overlay is enabled
+ context.Render(pDrawList, vecBox);
+
+ if (ImGui::BeginPopup(CS_XOR("context##box.component"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove))
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, 0));
+
+ ImGui::ColorEdit4(CS_XOR("primary color##box.component"), &C_GET(FrameOverlayVar_t, Vars.overlayBox).colPrimary);
+ ImGui::ColorEdit4(CS_XOR("outline color##box.component"), &C_GET(FrameOverlayVar_t, Vars.overlayBox).colOutline);
+ ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.75f);
+ ImGui::SliderFloat(CS_XOR("thickness##box.component"), &C_GET(FrameOverlayVar_t, Vars.overlayBox).flThickness, 1.f, 5.f, CS_XOR("%.1f"), ImGuiSliderFlags_AlwaysClamp);
+ ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.75f);
+ ImGui::SliderFloat(CS_XOR("rounding##box.component"), &C_GET(FrameOverlayVar_t, Vars.overlayBox).flRounding, 1.f, 5.f, CS_XOR("%.1f"), ImGuiSliderFlags_AlwaysClamp);
+
+ ImGui::PopStyleVar();
+
+ ImGui::EndPopup();
+ }
+ }
+ ImGui::End();
+}
+
+void MENU::RenderWatermark()
+{
+ if (!C_GET(bool, Vars.bWatermark) || !bMainWindowOpened)
+ return;
+
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ ImGui::PushStyleColor(ImGuiCol_MenuBarBg, ImVec4(0.f, 0.f, 0.f, 0.03f));
+ ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.f, 0.f, 0.f, 0.03f));
+ ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(0.f, 0.f, 0.f, 0.03f));
+ ImGui::PushFont(FONT::pExtra);
+ ImGui::BeginMainMenuBar();
+ {
+ ImGui::Dummy(ImVec2(1, 1));
+
+#ifdef _DEBUG
+ ImGui::TextColored(ImVec4(1.0f, 0.5f, 0.0f, 1.0f), CS_XOR("debug"));
+#endif
+ if (CRT::StringString(GetCommandLineW(), CS_XOR(L"-insecure")) != nullptr)
+ ImGui::TextColored(ImVec4(1.0f, 1.0f, 0.0f, 1.0f), CS_XOR("insecure"));
+
+ if (I::Engine->IsInGame())
+ ImGui::TextColored(ImVec4(1.0f, 0.0f, 0.0f, 1.0f), CS_XOR("in-game"));
+
+ static ImVec2 vecNameSize = ImGui::CalcTextSize(CS_XOR("asphyxia | " __DATE__ " " __TIME__));
+ ImGui::SameLine(ImGui::GetContentRegionMax().x - vecNameSize.x - style.FramePadding.x);
+ ImGui::TextColored(ImVec4(1.0f, 1.0f, 1.0f, 1.0f), CS_XOR("asphyxia | " __DATE__ " " __TIME__));
+ }
+ ImGui::EndMainMenuBar();
+ ImGui::PopFont();
+ ImGui::PopStyleColor(3);
+}
+
+void MENU::UpdateStyle(ImGuiStyle* pStyle)
+{
+ ImGuiStyle& style = pStyle != nullptr ? *pStyle : ImGui::GetStyle();
+
+ style.Colors[ImGuiCol_Text] = C_GET(ColorPickerVar_t, Vars.colPrimtv0).colValue.GetVec4(1.f); // primtv 0
+ style.Colors[ImGuiCol_TextDisabled] = C_GET(ColorPickerVar_t, Vars.colPrimtv2).colValue.GetVec4(0.85f); // primtv 2
+ style.Colors[ImGuiCol_TextSelectedBg] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.85f); // accent 1
+
+ style.Colors[ImGuiCol_WindowBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv3).colValue.GetVec4(0.95f); // primtv 3
+ style.Colors[ImGuiCol_ChildBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.GetVec4(1.0f); // primtv 1
+ style.Colors[ImGuiCol_PopupBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.GetVec4(1.0f); // primtv 1
+ style.Colors[ImGuiCol_WindowShadow] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.80f); // accent 3
+
+ style.Colors[ImGuiCol_Border] = C_GET(ColorPickerVar_t, Vars.colPrimtv4).colValue.GetVec4(0.50f); // primtv 4
+ style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); // clear
+
+ style.Colors[ImGuiCol_FrameBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv3).colValue.GetVec4(1.0f); // primtv 3
+ style.Colors[ImGuiCol_FrameBgHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.8f); // accent 1
+ style.Colors[ImGuiCol_FrameBgActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.6f); // accent 0
+
+ style.Colors[ImGuiCol_TitleBg] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(0.20f); // accent 0
+ style.Colors[ImGuiCol_TitleBgActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.50f); // accent 1
+ style.Colors[ImGuiCol_TitleBgCollapsed] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.20f); // accent 1
+
+ style.Colors[ImGuiCol_MenuBarBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.GetVec4(0.70f); // primtv 1
+
+ style.Colors[ImGuiCol_ScrollbarBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv3).colValue.GetVec4(0.30f); // primtv 3
+ style.Colors[ImGuiCol_ScrollbarGrab] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(1.00f); // accent 3
+ style.Colors[ImGuiCol_ScrollbarGrabHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.90f); // primtv 5
+ style.Colors[ImGuiCol_ScrollbarGrabActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.50f); // primtv 2
+
+ style.Colors[ImGuiCol_CheckMark] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.00f); // primtv 0
+
+ style.Colors[ImGuiCol_SliderGrab] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.0f); // accent 0
+ style.Colors[ImGuiCol_SliderGrabActive] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.8f); // accent 1
+
+ style.Colors[ImGuiCol_Button] = C_GET(ColorPickerVar_t, Vars.colPrimtv3).colValue.GetVec4(1.0f); // primtv 3
+ style.Colors[ImGuiCol_ButtonHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(1.00f); // primtv 5
+ style.Colors[ImGuiCol_ButtonActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(1.00f); // accent 0
+
+ style.Colors[ImGuiCol_Header] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.00f); // accent 0
+ style.Colors[ImGuiCol_HeaderHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(1.00f); // primtv 5
+ style.Colors[ImGuiCol_HeaderActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(1.0f); // primtv 3
+
+ style.Colors[ImGuiCol_Separator] = C_GET(ColorPickerVar_t, Vars.colPrimtv3).colValue.GetVec4(1.0f); // primtv 3
+ style.Colors[ImGuiCol_SeparatorHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(1.00f); // primtv 5
+ style.Colors[ImGuiCol_SeparatorActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(1.00f); // accent 0
+
+ style.Colors[ImGuiCol_ResizeGrip] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.00f); // accent 0
+ style.Colors[ImGuiCol_ResizeGripHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.70f); // primtv 5
+ style.Colors[ImGuiCol_ResizeGripActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(1.0f); // accent 1
+
+ style.Colors[ImGuiCol_Tab] = C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.GetVec4(0.80f); // primtv 1
+ style.Colors[ImGuiCol_TabHovered] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.80f); // primtv 5
+ style.Colors[ImGuiCol_TabActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.70f); // accent 0
+ style.Colors[ImGuiCol_TabUnfocused] = C_GET(ColorPickerVar_t, Vars.colAccent1).colValue.GetVec4(0.70f); // primtv 5
+ style.Colors[ImGuiCol_TabUnfocusedActive] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.60f); // accent 0
+
+ style.Colors[ImGuiCol_PlotLines] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.00f); // accent 0
+ style.Colors[ImGuiCol_PlotLinesHovered] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(0.50f); // accent 0
+ style.Colors[ImGuiCol_PlotHistogram] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(1.00f); // accent 0
+ style.Colors[ImGuiCol_PlotHistogramHovered] = C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.GetVec4(0.50f); // accent 0
+
+ style.Colors[ImGuiCol_DragDropTarget] = C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.GetVec4(0.80f); // accent 3
+
+ style.Colors[ImGuiCol_ModalWindowDimBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv4).colValue.GetVec4(0.25f); // primtv 4
+
+ style.Colors[ImGuiCol_ControlBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv2).colValue.GetVec4(1.0f); // primtv 3
+ style.Colors[ImGuiCol_ControlBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv4).colValue.GetVec4(1.0f); // primtv 5
+ style.Colors[ImGuiCol_ControlBg] = C_GET(ColorPickerVar_t, Vars.colPrimtv1).colValue.GetVec4(0.10f); // primtv 2
+
+ style.Colors[ImGuiCol_Triangle] = C_GET(ColorPickerVar_t, Vars.colPrimtv0).colValue.GetVec4(1.f); // accent 0
+
+ C_GET(ColorPickerVar_t, Vars.colPrimtv0).UpdateRainbow(); // (text)
+ C_GET(ColorPickerVar_t, Vars.colPrimtv1).UpdateRainbow(); // (background)
+ C_GET(ColorPickerVar_t, Vars.colPrimtv2).UpdateRainbow(); // (disabled)
+ C_GET(ColorPickerVar_t, Vars.colPrimtv3).UpdateRainbow(); // (control bg)
+ C_GET(ColorPickerVar_t, Vars.colPrimtv4).UpdateRainbow(); // (border)
+
+ C_GET(ColorPickerVar_t, Vars.colAccent0).UpdateRainbow(); // (main)
+ C_GET(ColorPickerVar_t, Vars.colAccent1).UpdateRainbow(); // (dark)
+ C_GET(ColorPickerVar_t, Vars.colAccent2).UpdateRainbow(); // (darker)
+
+ // update animation speed
+ style.AnimationSpeed = C_GET(float, Vars.flAnimationSpeed) / 10.f;
+}
+
+#pragma region menu_tabs
+
+void T::Render(const char* szTabBar, const CTab* arrTabs, const unsigned long long nTabsCount, int* nCurrentTab, ImGuiTabBarFlags flags)
+{
+ if (ImGui::BeginTabBar(szTabBar, flags))
+ {
+ for (std::size_t i = 0U; i < nTabsCount; i++)
+ {
+ // add tab
+ if (ImGui::BeginTabItem(arrTabs[i].szName))
+ {
+ // set current tab index
+ *nCurrentTab = (int)i;
+ ImGui::EndTabItem();
+ }
+ }
+
+ // render inner tab
+ if (arrTabs[*nCurrentTab].pRenderFunction != nullptr)
+ arrTabs[*nCurrentTab].pRenderFunction();
+
+ ImGui::EndTabBar();
+ }
+}
+
+void T::RageBot()
+{ }
+
+void T::LegitBot()
+{
+ ImGui::BeginChild(CS_XOR("legitbot.aimbot"), ImVec2{}, true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted(CS_XOR("aimbot"));
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::Checkbox(CS_XOR("enable##aimbot"), &C_GET(bool, Vars.bLegitbot));
+ ImGui::SliderFloat(CS_XOR("aim range"), &C_GET(float, Vars.aim_range), 5.f, 500.f);
+
+ //ImGui::NewLine();
+ // Key
+ //ImGui::Checkbox(CS_XOR("always on##aimbot"), &C_GET(bool, Vars.bLegitbotAlwaysOn));
+ //ImGui::BeginDisabled(C_GET(bool, Vars.bLegitbotAlwaysOn));
+ {
+ ImGui::HotKey(CS_XOR("toggle key"), &C_GET(unsigned int, Vars.nLegitbotActivationKey));
+ }
+ //ImGui::EndDisabled();
+ }
+ ImGui::EndChild();
+}
+
+void T::Visuals()
+{
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ MENU::RenderOverlayPreviewWindow();
+
+ ImGui::Columns(2, CS_XOR("##visuals_collumns"), false);
+ {
+ static float flOverlayChildSize = 0.f;
+ ImGui::BeginChild(CS_XOR("visuals.overlay"), ImVec2(0.f, flOverlayChildSize), true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted("overlay");
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, 0));
+
+ ImGui::Checkbox(CS_XOR("enable##overlay"), &C_GET(bool, Vars.bVisualOverlay));
+
+ ImGui::BeginDisabled(!C_GET(bool, Vars.bVisualOverlay));
+ {
+ ImGui::Checkbox(CS_XOR("bounding box"), &C_GET(FrameOverlayVar_t, Vars.overlayBox).bEnable);
+ ImGui::Checkbox(CS_XOR("name"), &C_GET(TextOverlayVar_t, Vars.overlayName).bEnable);
+ ImGui::Checkbox(CS_XOR("health bar"), &C_GET(BarOverlayVar_t, Vars.overlayHealthBar).bEnable);
+ ImGui::Checkbox(CS_XOR("armor bar"), &C_GET(BarOverlayVar_t, Vars.overlayArmorBar).bEnable);
+ }
+ ImGui::EndDisabled();
+
+ ImGui::PopStyleVar();
+
+ flOverlayChildSize = ImGui::GetCursorPosY() + style.ItemSpacing.y;
+ }
+ ImGui::EndChild();
+
+ ImGui::BeginChild(CS_XOR("visuals.chams"), ImVec2{}, true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted("chams");
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, 0));
+
+ ImGui::Checkbox(CS_XOR("enable##chams"), &C_GET(bool, Vars.bVisualChams));
+ ImGui::Combo(CS_XOR("materials"), &C_GET(int, Vars.nVisualChamMaterial), CS_XOR("white\0illuminate\0"));
+ ImGui::Checkbox(CS_XOR("enable invisible chams##chams"), &C_GET(bool, Vars.bVisualChamsIgnoreZ));
+
+ ImGui::ColorEdit4(CS_XOR("visible color"), &C_GET(Color_t, Vars.colVisualChams));
+ if (C_GET(bool, Vars.bVisualChamsIgnoreZ))
+ ImGui::ColorEdit4(CS_XOR("invisible color"), &C_GET(Color_t, Vars.colVisualChamsIgnoreZ));
+
+ ImGui::PopStyleVar();
+ }
+ ImGui::EndChild();
+ }
+ ImGui::NextColumn();
+ {
+ }
+ ImGui::Columns(1);
+}
+
+void T::Miscellaneous()
+{
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ ImGui::Columns(2, CS_XOR("##misc_collumns"), false);
+ {
+ ImGui::BeginChild(CS_XOR("misc.general"), ImVec2(0, ImGui::GetContentRegionAvail().y / 2.f), true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted(CS_XOR("general"));
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, 0));
+
+ ImGui::Checkbox(CS_XOR("watermark"), &C_GET(bool, Vars.bWatermark));
+
+ ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(1.f, 1.f, 0.f, 1.f));
+ if (ImGui::Button(CS_XOR("unlock hidden cvars"), ImVec2(-1, 15 * MENU::flDpiScale)))
+ {
+ I::Cvar->UnlockHiddenCVars();
+ NOTIFY::Push({ N_TYPE_INFO, CS_XOR("unlocked all hidden cvars") });
+ }
+
+ ImGui::PopStyleColor();
+
+ ImGui::PopStyleVar();
+ }
+ ImGui::EndChild();
+
+ ImGui::BeginChild(CS_XOR("misc.movement"), ImVec2{}, true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted(CS_XOR("movement"));
+ ImGui::EndMenuBar();
+ }
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(style.FramePadding.x, 0));
+
+ ImGui::Checkbox(CS_XOR("auto bunny-hopping"), &C_GET(bool, Vars.bAutoBHop));
+ if (C_GET(bool, Vars.bAutoBHop))
+ ImGui::SliderInt(CS_XOR("chance"), &C_GET(int, Vars.nAutoBHopChance), 0, 100, CS_XOR("%d%%"));
+
+ ImGui::Checkbox(CS_XOR("auto strafe"), &C_GET(bool, Vars.bAutoStrafe));
+
+ ImGui::PopStyleVar();
+ }
+ ImGui::EndChild();
+ }
+ ImGui::NextColumn();
+ {
+ static int nCurrentSettingSubTab = 0;
+ ImGui::BeginChild(CS_XOR("misc.settings"), ImVec2(0, ImGui::GetContentRegionAvail().y / 2.f), true, ImGuiWindowFlags_MenuBar);
+ {
+ if (ImGui::BeginMenuBar())
+ {
+ ImGui::TextUnformatted(CS_XOR("settings"));
+
+ ImGui::EndMenuBar();
+ }
+
+ static const CTab arrSettingTabs[] = {
+ CTab{ "configuration", []()
+ {
+ ImGui::Columns(2, CS_XOR("#CONFIG"), false);
+ {
+ ImGui::PushItemWidth(-1);
+
+ // check selected configuration for magic value
+ if (nSelectedConfig == ~1U)
+ {
+ // set default configuration as selected on first use
+ for (std::size_t i = 0U; i < C::vecFileNames.size(); i++)
+ {
+ if (CRT::StringCompare(C::vecFileNames[i], CS_XOR(CS_CONFIGURATION_DEFAULT_FILE_NAME CS_CONFIGURATION_FILE_EXTENSION)) == 0)
+ nSelectedConfig = i;
+ }
+ }
+
+ if (ImGui::BeginListBox(CS_XOR("##config.list"), C::vecFileNames.size(), 5))
+ {
+ for (std::size_t i = 0U; i < C::vecFileNames.size(); i++)
+ {
+ // @todo: imgui cant work with wstring
+ const wchar_t* wszFileName = C::vecFileNames[i];
+
+ char szFileName[MAX_PATH] = {};
+ CRT::StringUnicodeToMultiByte(szFileName, CS_ARRAYSIZE(szFileName), wszFileName);
+
+ if (ImGui::Selectable(szFileName, (nSelectedConfig == i)))
+ nSelectedConfig = i;
+ }
+
+ ImGui::EndListBox();
+ }
+
+ ImGui::PopItemWidth();
+ }
+ ImGui::NextColumn();
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
+ ImGui::PushItemWidth(-1);
+ if (ImGui::InputTextWithHint(CS_XOR("##config.file"), CS_XOR("create new..."), szConfigFile, sizeof(szConfigFile), ImGuiInputTextFlags_EnterReturnsTrue))
+ {
+ // check if the filename isn't empty
+ if (const std::size_t nConfigFileLength = CRT::StringLength(szConfigFile); nConfigFileLength > 0U)
+ {
+ CRT::WString_t wszConfigFile(szConfigFile);
+
+ if (C::CreateFile(wszConfigFile.Data()))
+ // set created config as selected @todo: dependent on current 'C::CreateFile' behaviour, generally it must be replaced by search
+ nSelectedConfig = C::vecFileNames.size() - 1U;
+
+ // clear string
+ CRT::MemorySet(szConfigFile, 0U, sizeof(szConfigFile));
+ }
+ }
+ if (ImGui::IsItemHovered())
+ ImGui::SetTooltip(CS_XOR("press enter to create new configuration"));
+
+ if (ImGui::Button(CS_XOR("save"), ImVec2(-1, 15 * MENU::flDpiScale)))
+ C::SaveFile(nSelectedConfig);
+
+ if (ImGui::Button(CS_XOR("load"), ImVec2(-1, 15 * MENU::flDpiScale)))
+ C::LoadFile(nSelectedConfig);
+
+ if (ImGui::Button(CS_XOR("remove"), ImVec2(-1, 15 * MENU::flDpiScale)))
+ ImGui::OpenPopup(CS_XOR("confirmation##config.remove"));
+
+ if (ImGui::Button(CS_XOR("refresh"), ImVec2(-1, 15 * MENU::flDpiScale)))
+ C::Refresh();
+
+ ImGui::PopItemWidth();
+ ImGui::PopStyleVar();
+ }
+ ImGui::Columns(1);
+
+ if (ImGui::BeginPopupModal(CS_XOR("confirmation##config.remove"), nullptr, ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove))
+ {
+ CRT::String_t szCurrentConfig(C::vecFileNames[nSelectedConfig]);
+
+ ImGui::Text(CS_XOR("are you sure you want to remove \"%s\" configuration?"), szCurrentConfig);
+ ImGui::Spacing();
+
+ if (ImGui::Button(CS_XOR("no"), ImVec2(ImGui::GetContentRegionAvail().x / 2.f, 0)))
+ ImGui::CloseCurrentPopup();
+
+ ImGui::SameLine();
+
+ if (ImGui::Button(CS_XOR("yes"), ImVec2(ImGui::GetContentRegionAvail().x, 0)))
+ {
+ C::RemoveFile(nSelectedConfig);
+
+ // reset selected configuration index
+ nSelectedConfig = ~0U;
+
+ ImGui::CloseCurrentPopup();
+ }
+
+ ImGui::EndPopup();
+ }
+ } },
+ CTab{ "menu", []()
+ {
+ static int nSelectedColor = 0;
+
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, 0));
+
+ ImGui::HotKey(CS_XOR("menu key"), &C_GET(unsigned int, Vars.nMenuKey));
+
+ if (ImGui::BeginCombo(CS_XOR("dpi scale"), arrMiscDpiScale[C_GET(int, Vars.nDpiScale)]))
+ {
+ for (int i = 0; i < IM_ARRAYSIZE(arrMiscDpiScale); i++)
+ {
+ if (ImGui::Selectable(arrMiscDpiScale[i], (C_GET(int, Vars.nDpiScale) == i)))
+ C_GET(int, Vars.nDpiScale) = i;
+ }
+
+ ImGui::EndCombo();
+ }
+
+ ImGui::MultiCombo(CS_XOR("additional settings"), &C_GET(unsigned int, Vars.bMenuAdditional), arrMenuAddition, CS_ARRAYSIZE(arrMenuAddition));
+
+ ImGui::SliderFloat(CS_XOR("animation speed"), &C_GET(float, Vars.flAnimationSpeed), 1.f, 10.f);
+
+ ImGui::SeparatorText(CS_XOR("colors pallete"));
+
+ ImGui::PushItemWidth(-1);
+
+ if (ImGui::BeginListBox(CS_XOR("##themes.select"), CS_ARRAYSIZE(arrColors), 5))
+ {
+ for (std::size_t i = 0U; i < CS_ARRAYSIZE(arrColors); i++)
+ {
+ const char* szColorName = arrColors[i].first;
+
+ if (ImGui::Selectable(szColorName, (i == nSelectedColor)))
+ nSelectedColor = (int)i;
+ }
+
+ ImGui::EndListBox();
+ }
+
+ ImGui::ColorEdit4(CS_XOR("##themes.picker"), &C_GET(ColorPickerVar_t, arrColors[nSelectedColor].second), ImGuiColorEditFlags_NoDragDrop | ImGuiColorEditFlags_NoTooltip | ImGuiColorEditFlags_NoOptions | ImGuiColorEditFlags_DisplayRGB);
+ ImGui::PopItemWidth();
+ ImGui::PopStyleVar();
+ } }
+ };
+
+ Render(CS_XOR("##misc.setttings.tab"), arrSettingTabs, CS_ARRAYSIZE(arrSettingTabs), &nCurrentSettingSubTab);
+ }
+ ImGui::EndChild();
+ }
+ ImGui::Columns(1);
+}
+
+void T::SkinsChanger()
+{
+}
+
+#pragma endregion
+
+#pragma region menu_particle
+
+void MENU::ParticleContext_t::Render(ImDrawList* pDrawList, const ImVec2& vecScreenSize, const float flAlpha)
+{
+ if (this->vecParticles.empty())
+ {
+ for (int i = 0; i < 100; i++)
+ this->AddParticle(ImGui::GetIO().DisplaySize);
+ }
+
+ for (auto& particle : this->vecParticles)
+ {
+ this->DrawParticle(pDrawList, particle, C_GET(ColorPickerVar_t, Vars.colAccent0).colValue.Set(flAlpha * 255));
+ this->UpdatePosition(particle, vecScreenSize);
+ this->FindConnections(pDrawList, particle, C_GET(ColorPickerVar_t, Vars.colAccent2).colValue.Set(flAlpha * 255), 200.f);
+ }
+}
+
+void MENU::ParticleContext_t::AddParticle(const ImVec2& vecScreenSize)
+{
+ // exceeded limit
+ if (this->vecParticles.size() >= 200UL)
+ return;
+
+ // @note: random speed value
+ static constexpr float flSpeed = 100.f;
+ this->vecParticles.emplace_back(
+ ImVec2(MATH::fnRandomFloat(0.f, vecScreenSize.x), MATH::fnRandomFloat(0.f, vecScreenSize.y)),
+ ImVec2(MATH::fnRandomFloat(-flSpeed, flSpeed), MATH::fnRandomFloat(-flSpeed, flSpeed)));
+}
+
+void MENU::ParticleContext_t::DrawParticle(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary)
+{
+ D::AddDrawListCircle(pDrawList, particle.vecPosition, 2.f, colPrimary, 12, DRAW_CIRCLE_OUTLINE | DRAW_CIRCLE_FILLED);
+}
+
+void MENU::ParticleContext_t::FindConnections(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary, float flMaxDistance)
+{
+ for (auto& currentParticle : this->vecParticles)
+ {
+ // skip current particle
+ if (¤tParticle == &particle)
+ continue;
+
+ /// @note: calcuate length distance 2d, return FLT_MAX if failed
+ const float flDistance = ImLength(particle.vecPosition - currentParticle.vecPosition, FLT_MAX);
+ if (flDistance <= flMaxDistance)
+ this->DrawConnection(pDrawList, particle, currentParticle, (flMaxDistance - flDistance) / flMaxDistance, colPrimary);
+ }
+}
+
+void MENU::ParticleContext_t::DrawConnection(ImDrawList* pDrawList, ParticleData_t& particle, ParticleData_t& otherParticle, float flAlpha, const Color_t& colPrimary) const
+{
+ D::AddDrawListLine(pDrawList, particle.vecPosition, otherParticle.vecPosition, colPrimary.Set(flAlpha * 255), 1.f);
+}
+
+void MENU::ParticleContext_t::UpdatePosition(ParticleData_t& particle, const ImVec2& vecScreenSize) const
+{
+ this->ResolveScreenCollision(particle, vecScreenSize);
+
+ ImGuiStyle& style = ImGui::GetStyle();
+
+ // move particle
+ particle.vecPosition.x += (particle.vecVelocity.x * style.AnimationSpeed * 10.f) * ImGui::GetIO().DeltaTime;
+ particle.vecPosition.y += (particle.vecVelocity.y * style.AnimationSpeed * 10.f) * ImGui::GetIO().DeltaTime;
+}
+
+void MENU::ParticleContext_t::ResolveScreenCollision(ParticleData_t& particle, const ImVec2& vecScreenSize) const
+{
+ if (particle.vecPosition.x + particle.vecVelocity.x > vecScreenSize.x || particle.vecPosition.x + particle.vecVelocity.x < 0)
+ particle.vecVelocity.x = -particle.vecVelocity.x;
+
+ if (particle.vecPosition.y + particle.vecVelocity.y > vecScreenSize.y || particle.vecPosition.y + particle.vecVelocity.y < 0)
+ particle.vecVelocity.y = -particle.vecVelocity.y;
+}
+
+#pragma endregion
diff --git a/examples/cs2-silent-aim-master/cstrike/core/menu.h b/examples/cs2-silent-aim-master/cstrike/core/menu.h
new file mode 100644
index 0000000..6532e50
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/menu.h
@@ -0,0 +1,105 @@
+#pragma once
+
+// used: [stl] vector
+#include
+
+#include "../common.h"
+
+// used: [ext] imgui, draw, animation
+#include "../utilities/draw.h"
+
+#define MENU_MAX_BACKGROUND_PARTICLES 100
+
+class CTab
+{
+public:
+ const char* szName;
+ void (*pRenderFunction)();
+};
+
+namespace MENU
+{
+ void RenderMainWindow();
+ void RenderOverlayPreviewWindow();
+ void RenderWatermark();
+
+ void UpdateStyle(ImGuiStyle* pStyle = nullptr);
+
+ /* @section: particles */
+ struct ParticleData_t
+ {
+ ParticleData_t(const ImVec2& vecPosition, const ImVec2& vecVelocity) :
+ vecPosition(vecPosition), vecVelocity(vecVelocity) { }
+
+ // current particle position
+ ImVec2 vecPosition = {};
+ // current particle velocity
+ ImVec2 vecVelocity = {};
+ };
+
+ struct ParticleContext_t
+ {
+ ParticleContext_t(const int nMaxParticles = 100)
+ {
+ // allocate memory for particles
+ this->vecParticles.reserve(nMaxParticles);
+ // create particles if needed
+ }
+
+ ~ParticleContext_t()
+ {
+ // since no memory allocated, just clear vector
+ this->vecParticles.clear();
+ }
+
+ void Render(ImDrawList* pDrawList, const ImVec2& vecScreenSize, const float flAlpha);
+
+ // create particle with random velocity/position
+ void AddParticle(const ImVec2& vecScreenSize);
+ // current size of particles
+ const size_t Count() const { return this->vecParticles.size(); }
+ private:
+ // draw particle (circle)
+ void DrawParticle(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary);
+
+ // find & draw connection as a line between particles
+ void FindConnections(ImDrawList* pDrawList, ParticleData_t& particle, const Color_t& colPrimary, float flMaxDistance);
+ void DrawConnection(ImDrawList* pDrawList, ParticleData_t& particle, ParticleData_t& otherParticle, float flAlpha, const Color_t& colPrimary) const;
+
+ // update particle position/velocity
+ // reversed direction when particle is out of screen
+ void UpdatePosition(ParticleData_t& particle, const ImVec2& vecScreenSize) const;
+ void ResolveScreenCollision(ParticleData_t& particle, const ImVec2& vecScreenSize) const;
+
+ // all our particles data
+ std::vector vecParticles;
+ };
+
+ inline bool bMainWindowOpened = false;
+ inline bool bMainActive = false;
+ inline int nCurrentMainTab = 0;
+ inline ParticleContext_t menuParticle = ParticleContext_t(MENU_MAX_BACKGROUND_PARTICLES);
+ inline AnimationHandler_t animMenuDimBackground;
+ inline float flDpiScale = 1.f;
+}
+
+namespace T
+{
+ /* @section: main */
+ void Render(const char* szTabBar, const CTab* arrTabs, const unsigned long long nTabsCount, int* nCurrentTab, ImGuiTabBarFlags flags = ImGuiTabBarFlags_NoCloseWithMiddleMouseButton | ImGuiTabBarFlags_NoTooltip);
+
+ /* @section: tabs */
+ void RageBot();
+ void LegitBot();
+ void Visuals();
+ void Miscellaneous();
+ void SkinsChanger();
+
+ /* @section: values */
+ // user-defined configuration filename in miscellaneous tab
+ inline char szConfigFile[256U] = {};
+ // current selected configuration in miscellaneous tab
+ inline unsigned long long nSelectedConfig = ~1U;
+ // current sub tab overlay in visuals tab
+ inline int nCurrentOverlaySubtab = 0;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/schema.cpp b/examples/cs2-silent-aim-master/cstrike/core/schema.cpp
new file mode 100644
index 0000000..73bae28
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/schema.cpp
@@ -0,0 +1,168 @@
+#include "schema.h"
+
+// used: [stl] vector
+#include
+// used: [stl] find_if
+#include
+
+// used: getworkingpath
+#include "../core.h"
+
+// used: ischemasystem
+#include "interfaces.h"
+#include "../sdk/interfaces/ischemasystem.h"
+
+// used: l_print
+#include "../utilities/log.h"
+
+struct SchemaData_t
+{
+ FNV1A_t uHashedFieldName = 0x0ULL;
+ std::uint32_t uOffset = 0x0U;
+};
+
+static std::vector vecSchemaData;
+
+bool SCHEMA::Setup(const wchar_t* wszFileName, const char* szModuleName)
+{
+ wchar_t wszDumpFilePath[MAX_PATH];
+ if (!CORE::GetWorkingPath(wszDumpFilePath))
+ return false;
+
+ CRT::StringCat(wszDumpFilePath, wszFileName);
+
+ HANDLE hOutFile = ::CreateFileW(wszDumpFilePath, GENERIC_WRITE, FILE_SHARE_READ, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
+ if (hOutFile == INVALID_HANDLE_VALUE)
+ return false;
+
+ // @todo: maybe remove this redundant? and put it inside CRT::String_t c'tor
+ const std::time_t time = std::time(nullptr);
+ std::tm timePoint;
+ localtime_s(&timePoint, &time);
+
+ CRT::String_t<64> szTimeBuffer(CS_XOR("[%d-%m-%Y %T] asphyxia | schema dump\n\n"), &timePoint);
+
+ // write current date, time and info
+ ::WriteFile(hOutFile, szTimeBuffer.Data(), szTimeBuffer.Length(), nullptr, nullptr);
+
+ CSchemaSystemTypeScope* pTypeScope = I::SchemaSystem->FindTypeScopeForModule(szModuleName);
+ if (pTypeScope == nullptr)
+ return false;
+
+ const int nTableSize = pTypeScope->hashClasses.Count();
+ L_PRINT(LOG_INFO) << CS_XOR("found \"") << nTableSize << CS_XOR("\" schema classes in module");
+
+ // allocate memory for elements
+ UtlTSHashHandle_t* pElements = new UtlTSHashHandle_t[nTableSize + 1U];
+ const auto nElements = pTypeScope->hashClasses.GetElements(0, nTableSize, pElements);
+
+ for (int i = 0; i < nElements; i++)
+ {
+ const UtlTSHashHandle_t hElement = pElements[i];
+
+ if (hElement == 0)
+ continue;
+
+ CSchemaClassBinding* pClassBinding = pTypeScope->hashClasses[hElement];
+ if (pClassBinding == nullptr)
+ continue;
+
+ SchemaClassInfoData_t* pDeclaredClassInfo;
+ pTypeScope->FindDeclaredClass(&pDeclaredClassInfo, pClassBinding->szBinaryName);
+
+ if (pDeclaredClassInfo == nullptr)
+ continue;
+
+ if (pDeclaredClassInfo->nFieldSize == 0)
+ continue;
+
+ CRT::String_t szClassBuffer(CS_XOR("class %s\n"), pDeclaredClassInfo->szName);
+ ::WriteFile(hOutFile, szClassBuffer.Data(), szClassBuffer.Length(), nullptr, nullptr);
+
+ for (auto j = 0; j < pDeclaredClassInfo->nFieldSize; j++)
+ {
+ SchemaClassFieldData_t* pFields = pDeclaredClassInfo->pFields;
+ CRT::String_t szFieldClassBuffer(CS_XOR("%s->%s"), pClassBinding->szBinaryName, pFields[j].szName);
+ // store field info
+ vecSchemaData.emplace_back(FNV1A::Hash(szFieldClassBuffer.Data()), pFields[j].nSingleInheritanceOffset);
+
+ CRT::String_t szFieldBuffer(CS_XOR(" %s %s = 0x%X\n"), pFields[j].pSchemaType->szName, pFields[j].szName, pFields[j].nSingleInheritanceOffset);
+ // write field info
+ ::WriteFile(hOutFile, szFieldBuffer.Data(), szFieldBuffer.Length(), nullptr, nullptr);
+ }
+ #ifdef _DEBUG
+ L_PRINT(LOG_INFO) << CS_XOR("dumped \"") << pDeclaredClassInfo->szName << CS_XOR("\" (total: ") << pDeclaredClassInfo->nFieldSize << CS_XOR(" fields)");
+ #endif
+ }
+
+ // free allocated memory
+ delete[] pElements;
+
+ // close file
+ ::CloseHandle(hOutFile);
+
+ return true;
+}
+
+std::uint32_t SCHEMA::GetOffset(const FNV1A_t uHashedFieldName)
+{
+ if (const auto it = std::ranges::find_if(vecSchemaData, [uHashedFieldName](const SchemaData_t& data)
+ { return data.uHashedFieldName == uHashedFieldName; });
+ it != vecSchemaData.end())
+ return it->uOffset;
+
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to find offset for field with hash: ") << L::AddFlags(LOG_MODE_INT_FORMAT_HEX | LOG_MODE_INT_SHOWBASE) << uHashedFieldName;
+ CS_ASSERT(false); // schema field not found
+ return 0U;
+}
+
+// @todo: optimize this, this is really poorly do and can be done much better?
+std::uint32_t SCHEMA::GetForeignOffset(const char* szModulenName, const FNV1A_t uHashedClassName, const FNV1A_t uHashedFieldName)
+{
+ CSchemaSystemTypeScope* pTypeScope = I::SchemaSystem->FindTypeScopeForModule(szModulenName);
+ if (pTypeScope == nullptr)
+ return false;
+
+ const int nTableSize = pTypeScope->hashClasses.Count();
+ // allocate memory for elements
+ UtlTSHashHandle_t* pElements = new UtlTSHashHandle_t[nTableSize + 1U];
+ const auto nElements = pTypeScope->hashClasses.GetElements(0, nTableSize, pElements);
+ std::uint32_t uOffset = 0x0;
+
+ for (int i = 0; i < nElements; i++)
+ {
+ const UtlTSHashHandle_t hElement = pElements[i];
+
+ if (hElement == 0)
+ continue;
+
+ CSchemaClassBinding* pClassBinding = pTypeScope->hashClasses[hElement];
+ if (pClassBinding == nullptr)
+ continue;
+
+ SchemaClassInfoData_t* pDeclaredClassInfo;
+ pTypeScope->FindDeclaredClass(&pDeclaredClassInfo, pClassBinding->szBinaryName);
+
+ if (pDeclaredClassInfo == nullptr)
+ continue;
+
+ if (pDeclaredClassInfo->nFieldSize == 0)
+ continue;
+
+ for (auto j = 0; j < pDeclaredClassInfo->nFieldSize; j++)
+ {
+ SchemaClassFieldData_t* pFields = pDeclaredClassInfo->pFields;
+ if (pFields == nullptr)
+ continue;
+
+ SchemaClassFieldData_t field = pFields[j];
+ if (FNV1A::Hash(pClassBinding->szBinaryName) == uHashedClassName && FNV1A::Hash(field.szName) == uHashedFieldName)
+ uOffset = field.nSingleInheritanceOffset;
+ }
+ }
+
+ if (uOffset == 0x0)
+ L_PRINT(LOG_WARNING) << CS_XOR("failed to find offset for field with hash: ") << L::AddFlags(LOG_MODE_INT_FORMAT_HEX | LOG_MODE_INT_SHOWBASE) << uHashedFieldName;
+
+ return uOffset;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/schema.h b/examples/cs2-silent-aim-master/cstrike/core/schema.h
new file mode 100644
index 0000000..e0ba79b
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/schema.h
@@ -0,0 +1,45 @@
+#pragma once
+
+
+#include "../common.h"
+
+// used: fnv-1a hash
+#include "../utilities/fnv1a.h"
+
+#define SCHEMA_ADD_OFFSET(TYPE, NAME, OFFSET) \
+ [[nodiscard]] CS_INLINE std::add_lvalue_reference_t NAME() \
+ { \
+ static const std::uint32_t uOffset = OFFSET; \
+ return *reinterpret_cast>(reinterpret_cast(this) + (uOffset)); \
+ }
+
+#define SCHEMA_ADD_POFFSET(TYPE, NAME, OFFSET) \
+ [[nodiscard]] CS_INLINE std::add_pointer_t NAME() \
+ { \
+ const static std::uint32_t uOffset = OFFSET; \
+ return reinterpret_cast>(reinterpret_cast(this) + (uOffset)); \
+ }
+
+#define SCHEMA_ADD_FIELD_OFFSET(TYPE, NAME, FIELD, ADDITIONAL) SCHEMA_ADD_OFFSET(TYPE, NAME, SCHEMA::GetOffset(FNV1A::HashConst(FIELD)) + ADDITIONAL)
+
+#define SCHEMA_ADD_FIELD(TYPE, NAME, FIELD) SCHEMA_ADD_FIELD_OFFSET(TYPE, NAME, FIELD, 0U)
+
+#define SCHEMA_ADD_PFIELD_OFFSET(TYPE, NAME, FIELD, ADDITIONAL) SCHEMA_ADD_POFFSET(TYPE, NAME, SCHEMA::GetOffset(FNV1A::HashConst(FIELD)) + ADDITIONAL)
+
+#define SCHEMA_ADD_PFIELD(TYPE, NAME, FIELD) SCHEMA_ADD_PFIELD_OFFSET(TYPE, NAME, FIELD, 0U)
+
+// @todo: dump enums?
+namespace SCHEMA
+{
+ // store the offset of the field in the class
+ // dump stored data to file
+ bool Setup(const wchar_t* wszFileName, const char* szModuleName);
+
+ /* @section: get */
+ // get offset of the field in the class
+ // @note: only client.dll class & fields
+ [[nodiscard]] std::uint32_t GetOffset(const FNV1A_t uHashedFieldName);
+
+ // get foregin offset from other .dll
+ [[nodiscard]] std::uint32_t GetForeignOffset(const char* szModulenName, const FNV1A_t uHashedClassName, const FNV1A_t uHashedFieldName);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/sdk.cpp b/examples/cs2-silent-aim-master/cstrike/core/sdk.cpp
new file mode 100644
index 0000000..9381307
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/sdk.cpp
@@ -0,0 +1,18 @@
+#include "sdk.h"
+
+// used: getmodulebasehandle
+#include "../utilities/memory.h"
+
+bool SDK::Setup()
+{
+ bool bSuccess = true;
+
+ const void* hTier0Lib = MEM::GetModuleBaseHandle(TIER0_DLL);
+ if (hTier0Lib == nullptr)
+ return false;
+
+ fnConColorMsg = reinterpret_cast(MEM::GetExportAddress(hTier0Lib, CS_XOR("?ConColorMsg@@YAXAEBVColor@@PEBDZZ")));
+ bSuccess &= fnConColorMsg != nullptr;
+
+ return bSuccess;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/sdk.h b/examples/cs2-silent-aim-master/cstrike/core/sdk.h
new file mode 100644
index 0000000..64dce26
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/sdk.h
@@ -0,0 +1,36 @@
+#pragma once
+
+// used: viewmatrix_t
+#include "../sdk/datatypes/matrix.h"
+// used: color_t
+#include "../sdk/datatypes/color.h"
+// used: cmd
+#include "../sdk/datatypes/usercmd.h"
+
+#pragma region sdk_definitions
+// @source: master/public/worldsize.h
+// world coordinate bounds
+#define MAX_COORD_FLOAT 16'384.f
+#define MIN_COORD_FLOAT (-MAX_COORD_FLOAT)
+
+// @source: master/public/vphysics_interface.h
+// coordinates are in HL units. 1 unit == 1 inch
+#define METERS_PER_INCH 0.0254f
+#pragma endregion
+
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+namespace SDK
+{
+ // capture game's exported functions
+ bool Setup();
+
+ inline ViewMatrix_t ViewMatrix = ViewMatrix_t();
+ inline Vector_t CameraPosition = Vector_t();
+ inline CCSPlayerController* LocalController = nullptr;
+ inline C_CSPlayerPawn* LocalPawn = nullptr;
+ inline CUserCmd* Cmd = nullptr;
+
+ inline void(CS_CDECL* fnConColorMsg)(const Color_t&, const char*, ...) = nullptr;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/core/variables.h b/examples/cs2-silent-aim-master/cstrike/core/variables.h
new file mode 100644
index 0000000..a1517e9
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/core/variables.h
@@ -0,0 +1,121 @@
+#pragma once
+
+#include "config.h"
+
+#pragma region variables_combo_entries
+using VisualOverlayBox_t = int;
+
+enum EVisualOverlayBox : VisualOverlayBox_t
+{
+ VISUAL_OVERLAY_BOX_NONE = 0,
+ VISUAL_OVERLAY_BOX_FULL,
+ VISUAL_OVERLAY_BOX_CORNERS,
+ VISUAL_OVERLAY_BOX_MAX
+};
+
+using VisualChamMaterial_t = int;
+enum EVisualsChamMaterials : VisualChamMaterial_t
+{
+ VISUAL_MATERIAL_PRIMARY_WHITE = 0,
+ VISUAL_MATERIAL_ILLUMINATE,
+ VISUAL_MATERIAL_MAX
+};
+
+using MiscDpiScale_t = int;
+
+enum EMiscDpiScale : MiscDpiScale_t
+{
+ MISC_DPISCALE_DEFAULT = 0,
+ MISC_DPISCALE_125,
+ MISC_DPISCALE_150,
+ MISC_DPISCALE_175,
+ MISC_DPISCALE_200,
+ MISC_DPISCALE_MAX
+};
+
+#pragma endregion
+
+#pragma region variables_multicombo_entries
+using MenuAddition_t = unsigned int;
+enum EMenuAddition : MenuAddition_t
+{
+ MENU_ADDITION_NONE = 0U,
+ MENU_ADDITION_DIM_BACKGROUND = 1 << 0,
+ MENU_ADDITION_BACKGROUND_PARTICLE = 1 << 1,
+ MENU_ADDITION_GLOW = 1 << 2,
+ MENU_ADDITION_ALL = MENU_ADDITION_DIM_BACKGROUND | MENU_ADDITION_BACKGROUND_PARTICLE | MENU_ADDITION_GLOW
+};
+#pragma endregion
+
+struct Variables_t
+{
+#pragma region variables_visuals
+ C_ADD_VARIABLE(bool, bVisualOverlay, false);
+
+ C_ADD_VARIABLE(FrameOverlayVar_t, overlayBox, FrameOverlayVar_t(false));
+ C_ADD_VARIABLE(TextOverlayVar_t, overlayName, TextOverlayVar_t(false));
+ C_ADD_VARIABLE(BarOverlayVar_t, overlayHealthBar, BarOverlayVar_t(false, false, false, 1.f, Color_t(0, 255, 0), Color_t(255, 0, 0)));
+ C_ADD_VARIABLE(BarOverlayVar_t, overlayArmorBar, BarOverlayVar_t(false, false, false, 1.f, Color_t(0, 255, 255), Color_t(255, 0, 0)));
+
+ C_ADD_VARIABLE(bool, bVisualChams, false);
+ C_ADD_VARIABLE(int, nVisualChamMaterial, VISUAL_MATERIAL_PRIMARY_WHITE);
+ C_ADD_VARIABLE(bool, bVisualChamsIgnoreZ, false); // invisible chams
+ C_ADD_VARIABLE(Color_t, colVisualChams, Color_t(0, 255, 0));
+ C_ADD_VARIABLE(Color_t, colVisualChamsIgnoreZ, Color_t(255, 0, 0));
+#pragma endregion
+
+#pragma region variables_misc
+ C_ADD_VARIABLE(bool, bAntiUntrusted, true);
+ C_ADD_VARIABLE(bool, bWatermark, true);
+
+ C_ADD_VARIABLE(bool, bAutoBHop, false);
+ C_ADD_VARIABLE(int, nAutoBHopChance, 100);
+
+ C_ADD_VARIABLE(bool, bAutoStrafe, false);
+#pragma endregion
+
+#pragma region variables_menu
+ C_ADD_VARIABLE(unsigned int, nMenuKey, VK_INSERT);
+ C_ADD_VARIABLE(unsigned int, nPanicKey, VK_END);
+ C_ADD_VARIABLE(int, nDpiScale, 0);
+
+ /*
+ * color navigation:
+ * [definition N][purpose]
+ * 1. primitive:
+ * - primtv 0 (text)
+ * - primtv 1 (background)
+ * - primtv 2 (disabled)
+ * - primtv 3 (control bg)
+ * - primtv 4 (border)
+ * - primtv 5 (hover)
+ *
+ * 2. accents:
+ * - accent 0 (main)
+ * - accent 1 (dark)
+ * - accent 2 (darker)
+ */
+ C_ADD_VARIABLE(unsigned int, bMenuAdditional, MENU_ADDITION_ALL);
+ C_ADD_VARIABLE(float, flAnimationSpeed, 1.f);
+
+
+ C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv0, ColorPickerVar_t(255, 255, 255)); // (text)
+ C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv1, ColorPickerVar_t(50, 55, 70)); // (background)
+ C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv2, ColorPickerVar_t(190, 190, 190)); // (disabled)
+ C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv3, ColorPickerVar_t(20, 20, 30)); // (control bg)
+ C_ADD_VARIABLE(ColorPickerVar_t, colPrimtv4, ColorPickerVar_t(0, 0, 0)); // (border)
+
+ C_ADD_VARIABLE(ColorPickerVar_t, colAccent0, ColorPickerVar_t(85, 90, 160)); // (main)
+ C_ADD_VARIABLE(ColorPickerVar_t, colAccent1, ColorPickerVar_t(100, 105, 175)); // (dark)
+ C_ADD_VARIABLE(ColorPickerVar_t, colAccent2, ColorPickerVar_t(115, 120, 190)); // (darker)
+#pragma endregion
+#pragma region variables_legitbot
+ C_ADD_VARIABLE(bool, bLegitbot, false);
+ C_ADD_VARIABLE(float, flSmoothing, 10.0f);
+ C_ADD_VARIABLE(float, aim_range, 5.f);
+ C_ADD_VARIABLE(bool, bLegitbotAlwaysOn, false);
+ C_ADD_VARIABLE(unsigned int, nLegitbotActivationKey, VK_HOME);
+#pragma endregion
+};
+
+inline Variables_t Vars = {};
diff --git a/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj b/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj
new file mode 100644
index 0000000..029867d
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj
@@ -0,0 +1,267 @@
+
+
+
+
+ Debug
+ x64
+
+
+ Release
+ x64
+
+
+
+ {DAC639DD-46A6-B878-4FBE-434FBB1C1FDA}
+ true
+ Win32Proj
+ cstrike
+ 10.0
+
+
+
+ DynamicLibrary
+ true
+ Unicode
+ v143
+
+
+ DynamicLibrary
+ false
+ Unicode
+ v143
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+ false
+ true
+ $(SolutionDir)build\$(Configuration)\
+ $(SolutionDir)intermediate\$(ProjectName)\$(Configuration)\
+ cstrike
+ .dll
+ false
+
+
+ false
+ true
+ $(SolutionDir)build\$(Configuration)\
+ $(SolutionDir)intermediate\$(ProjectName)\$(Configuration)\
+ cstrike
+ .dll
+ false
+
+
+
+ NotUsing
+ Level3
+ NOMINMAX;_DEBUG;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
+ $(SolutionDir)dependencies;$(SolutionDir)dependencies\freetype\include;%(AdditionalIncludeDirectories)
+ ProgramDatabase
+ Disabled
+ false
+ false
+ MultiThreadedDebug
+ false
+ true
+ true
+ stdcpp20
+ true
+ Level3
+
+
+ Windows
+ DebugFull
+ d3d11.lib;freetype_debug.lib;%(AdditionalDependencies)
+ $(SolutionDir)dependencies\freetype\binary;%(AdditionalLibraryDirectories)
+ $(OutDir)$(TargetName).lib
+ CoreEntryPoint
+
+
+
+
+ NotUsing
+ Level3
+ NOMINMAX;NDEBUG;_HAS_EXCEPTIONS=0;%(PreprocessorDefinitions)
+ $(SolutionDir)dependencies;$(SolutionDir)dependencies\freetype\include;%(AdditionalIncludeDirectories)
+ ProgramDatabase
+ MaxSpeed
+ true
+ true
+ false
+ true
+ MultiThreaded
+ false
+ false
+ true
+ stdcpp20
+ true
+ Level3
+
+
+ Windows
+ DebugFull
+ true
+ true
+ d3d11.lib;freetype.lib;%(AdditionalDependencies)
+ $(SolutionDir)dependencies\freetype\binary;%(AdditionalLibraryDirectories)
+ $(OutDir)$(TargetName).lib
+ CoreEntryPoint
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj.filters b/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj.filters
new file mode 100644
index 0000000..d621199
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/cstrike.vcxproj.filters
@@ -0,0 +1,449 @@
+
+
+
+
+ {4E40957C-3A77-960D-E363-7C10CF79120F}
+
+
+ {8CAD9F58-7810-2FFD-2196-67B30DD8FA7F}
+
+
+ {F6B312BD-E297-D312-4BF8-CD6537FBBD94}
+
+
+ {D08C9B77-BC1B-2541-653A-393C51A835E7}
+
+
+ {500251C1-3C27-A041-6572-85D151F69E5F}
+
+
+ {04AE61E7-F07A-BCF2-1994-AA9A05C0F180}
+
+
+ {5F23839A-CBE3-FED0-941E-484E009E43AD}
+
+
+ {9A07E0F7-8600-FF49-AF32-E4CE9B8ADE55}
+
+
+ {202B5BA7-8C95-0F1E-D5D3-C0C3417DED72}
+
+
+ {67A9880B-D3B2-887C-5C2E-9F7CC836947C}
+
+
+ {85931A81-F153-96B7-BA8E-DF34260EDB93}
+
+
+ {7A23D2D0-66F1-C5D6-4F85-36FD3BF2A13B}
+
+
+ {212A0ED3-8D94-C249-D6D2-73EF427CA09E}
+
+
+ {a0df371b-f244-4c53-b08d-762a0f9b6b0c}
+
+
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies
+
+
+ dependencies
+
+
+ dependencies\minhook
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook
+
+
+ dependencies\minhook
+
+
+ dependencies
+
+
+ dependencies
+
+
+ dependencies
+
+
+ resources
+
+
+ resources
+
+
+ resources
+
+
+ resources
+
+
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+
+ features
+
+
+ features\misc
+
+
+ features
+
+
+ features\visuals
+
+
+ features\visuals
+
+
+ sdk
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk
+
+
+ sdk
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ sdk
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+
+
+ sdk\interfaces
+
+
+ sdk\interfaces
+
+
+ features
+
+
+ features\legitbot
+
+
+
+
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\imgui
+
+
+ dependencies\minhook
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook\hde
+
+
+ dependencies\minhook
+
+
+ dependencies\minhook
+
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+ core
+
+
+
+ features
+
+
+ features\misc
+
+
+ features
+
+
+ features\visuals
+
+
+ features\visuals
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk\datatypes
+
+
+ sdk
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+ utilities
+
+
+
+ sdk\interfaces
+
+
+ features\legitbot
+
+
+ features
+
+
+
+
\ No newline at end of file
diff --git a/examples/cs2-silent-aim-master/cstrike/features.cpp b/examples/cs2-silent-aim-master/cstrike/features.cpp
new file mode 100644
index 0000000..9bfba83
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features.cpp
@@ -0,0 +1,81 @@
+#include "features.h"
+
+// used: draw callbacks
+#include "utilities/draw.h"
+// used: notify
+#include "utilities/notify.h"
+
+// used: cheat variables
+#include "core/variables.h"
+// used: menu
+#include "core/menu.h"
+
+// used: features callbacks
+#include "features/visuals.h"
+#include "features/misc.h"
+#include "features/legitbot.h"
+
+// used: interfaces
+#include "core/interfaces.h"
+#include "sdk/interfaces/iengineclient.h"
+#include "sdk/interfaces/cgameentitysystem.h"
+#include "sdk/datatypes/usercmd.h"
+#include "sdk/entity.h"
+#include "aimRangePainter.hpp"
+
+bool F::Setup()
+{
+ if (!VISUALS::Setup())
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to setup visuals");
+ return false;
+ }
+
+ return true;
+}
+
+void F::Destroy()
+{
+ VISUALS::OnDestroy();
+}
+
+void F::OnPresent()
+{
+ if (!D::bInitialized)
+ return;
+
+ D::NewFrame();
+ {
+ // render watermark
+ MENU::RenderWatermark();
+
+ // main window
+ ImGui::PushFont(FONT::pMenu[C_GET(int, Vars.nDpiScale)]);
+ // @note: here you can draw your stuff
+ MENU::RenderMainWindow();
+ // render notifications
+ NOTIFY::Render();
+ ImGui::PopFont();
+ }
+ D::Render();
+}
+
+void F::OnFrameStageNotify(int nStage)
+{
+ F::VISUALS::OnFrame(nStage);
+}
+
+void F::OnCreateMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController)
+{
+ C_CSPlayerPawn* pLocalPawn = I::GameResourceService->pGameEntitySystem->Get(pLocalController->GetPawnHandle());
+ if (pLocalPawn == nullptr)
+ return;
+
+ F::MISC::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn);
+ F::LEGITBOT::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn);
+}
+
+bool F::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
+{
+ return VISUALS::OnDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features.h b/examples/cs2-silent-aim-master/cstrike/features.h
new file mode 100644
index 0000000..73581a6
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features.h
@@ -0,0 +1,19 @@
+#pragma once
+
+#include "common.h"
+
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSPlayerController;
+class CMeshData;
+
+namespace F
+{
+ bool Setup();
+ void Destroy();
+
+ void OnPresent();
+ void OnFrameStageNotify(int nStage);
+ void OnCreateMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController);
+ bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/CRC.h b/examples/cs2-silent-aim-master/cstrike/features/CRC.h
new file mode 100644
index 0000000..7879293
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/CRC.h
@@ -0,0 +1,97 @@
+#pragma once
+
+#include
+// used: MEM_PAD and virtual funcs
+#include "../utilities/memory.h"
+// used: CUtlBuffer
+#include "../sdk/datatypes/utlbuffer.h"
+// used: CBaseUserCmdPB
+#include "../sdk/datatypes/usercmd.h";
+
+namespace CRC
+{
+ struct CInButtonStateNoVTable
+ {
+ public:
+ std::uint64_t nValue;
+ std::uint64_t nValueChanged;
+ std::uint64_t nValueScroll;
+ };
+
+ struct SavedData_t
+ {
+ CInButtonStateNoVTable nButtons;
+ QAngle_t angView;
+ };
+
+ inline SavedData_t savedData;
+
+ inline void Save(CBaseUserCmdPB* pBaseCmd)
+ {
+ if (pBaseCmd->pViewAngles != nullptr)
+ savedData.angView = pBaseCmd->pViewAngles->angValue;
+
+ savedData.nButtons.nValue = pBaseCmd->pInButtonState->nValue;
+ savedData.nButtons.nValueChanged = pBaseCmd->pInButtonState->nValueChanged;
+ savedData.nButtons.nValueScroll = pBaseCmd->pInButtonState->nValueScroll;
+ }
+
+ inline void Apply(CUserCmd* pCmd)
+ {
+ CBaseUserCmdPB* pBaseCmd = pCmd->csgoUserCmd.pBaseCmd;
+ if (pBaseCmd == nullptr)
+ return;
+
+ pCmd->nButtons.nValue = savedData.nButtons.nValue;
+ pCmd->nButtons.nValueChanged = savedData.nButtons.nValueChanged;
+ pCmd->nButtons.nValueScroll = savedData.nButtons.nValueScroll;
+
+ if (pBaseCmd->pViewAngles != nullptr)
+ pBaseCmd->pViewAngles->angValue = savedData.angView;
+ }
+
+ inline bool CalculateCRC(CBaseUserCmdPB* pBaseCmd)
+ {
+ int nCalcualtedCRCSize = pBaseCmd->CalculateCmdCRCSize();
+ CUtlBuffer protobufBuffer(0, 0, 0);
+ protobufBuffer.EnsureCapacity(nCalcualtedCRCSize + 1);
+
+ using fnSerializePartialToArray = bool(__fastcall*)(CBaseUserCmdPB*, CUtlBuffer, int);
+ static const fnSerializePartialToArray oSerializePartialToArray = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 18 55 56 57 48 81 EC 90")));
+
+ #ifdef CS_PARANOID
+ CS_ASSERT(oSerializePartialToArray != nullptr);
+ #endif
+
+ if (oSerializePartialToArray(pBaseCmd, protobufBuffer, nCalcualtedCRCSize))
+ {
+ std::uintptr_t* pMessage = reinterpret_cast(I::MemAlloc->Alloc(0x18));
+ pBaseCmd->nCachedBits |= 1;
+ auto nHasBits = static_cast(pBaseCmd->nHasBits & 0xFFFFFFFFFFFFFFFC);
+ if ((pBaseCmd->nHasBits & 1) != 0)
+ nHasBits = static_cast(nHasBits);
+
+ using fnWriteMessage = void(__fastcall*)(std::uintptr_t*, CUtlBuffer, int);
+ static const fnWriteMessage oWriteMessage = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 10 48 89 6C 24 18 48 89 7C 24 20 41 56 48 83 EC 20 48 BF")));
+
+ #ifdef CS_PARANOID
+ CS_ASSERT(oWriteMessage != nullptr);
+ #endif
+
+ using fnSetMessageData = std::string*(__fastcall*)(void*, std::uintptr_t*, void*);
+ static const fnSetMessageData oSetMessageData = reinterpret_cast(MEM::FindPattern(CLIENT_DLL, CS_XOR("48 89 5C 24 20 55 56 57 48 83 EC 30 49")));
+
+ #ifdef CS_PARANOID
+ CS_ASSERT(oSetMessageData != nullptr);
+ #endif
+
+ oWriteMessage(pMessage, protobufBuffer, nCalcualtedCRCSize);
+ pBaseCmd->strMoveCrc = oSetMessageData(&pBaseCmd->strMoveCrc, pMessage, &nHasBits);
+ I::MemAlloc->Free(pMessage);
+
+ return true;
+ }
+
+ return false;
+ }
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/legitbot.cpp b/examples/cs2-silent-aim-master/cstrike/features/legitbot.cpp
new file mode 100644
index 0000000..df07223
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/legitbot.cpp
@@ -0,0 +1,9 @@
+#include "legitbot.h"
+
+// used: movement callback
+#include "legitbot/aim.h"
+
+void F::LEGITBOT::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn)
+{
+ AIM::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/legitbot.h b/examples/cs2-silent-aim-master/cstrike/features/legitbot.h
new file mode 100644
index 0000000..91eace0
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/legitbot.h
@@ -0,0 +1,10 @@
+#pragma once
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+namespace F::LEGITBOT
+{
+ void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.cpp b/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.cpp
new file mode 100644
index 0000000..ee810f5
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.cpp
@@ -0,0 +1,206 @@
+#include "aim.h"
+
+// used: sdk entity
+#include "../../sdk/entity.h"
+#include "../../sdk/interfaces/cgameentitysystem.h"
+#include "../../sdk/interfaces/iengineclient.h"
+// used: cusercmd
+#include "../../sdk/datatypes/usercmd.h"
+
+// used: activation button
+#include "../../utilities/inputsystem.h"
+
+// used: cheat variables
+#include "../../core/variables.h"
+#include "../../sdk/interfaces/ccsgoinput.h"
+#include "../../sdk/interfaces/cgametracemanager.h"
+#include "../../utilities/draw.h"
+#include "../../core/sdk.h"
+#include "../../sdk/interfaces/iswapchaindx11.h"
+void F::LEGITBOT::AIM::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn)
+{
+ // Check if the legitbot is enabled
+ if (!C_GET(bool, Vars.bLegitbot))
+ return;
+
+ if (!pLocalController->IsPawnAlive())
+ return;
+
+ AimAssist(pBaseCmd, pLocalPawn, pLocalController);
+}
+
+QAngle_t GetAngularDifference(CBaseUserCmdPB* pCmd, Vector_t vecTarget, C_CSPlayerPawn* pLocal)
+{
+ // The current position
+ Vector_t vecCurrent = pLocal->GetEyePosition();
+
+ // The new angle
+ QAngle_t vNewAngle = (vecTarget - vecCurrent).ToAngles();
+ vNewAngle.Normalize(); // Normalise it so we don't jitter about
+
+ // Store our current angles
+ QAngle_t vCurAngle = pCmd->pViewAngles->angValue;
+
+ // Find the difference between the two angles (later useful when adding smoothing)
+ vNewAngle -= vCurAngle;
+
+ return vNewAngle;
+}
+
+float GetAngularDistance(CBaseUserCmdPB* pCmd, Vector_t vecTarget, C_CSPlayerPawn* pLocal)
+{
+ return GetAngularDifference(pCmd, vecTarget, pLocal).Length2D();
+}
+
+void F::LEGITBOT::AIM::AimAssist(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn, CCSPlayerController* pLocalController)
+{
+ // Check if the activation key is down
+ if (!IPT::IsKeyDown(C_GET(unsigned int, Vars.nLegitbotActivationKey)) && !C_GET(bool, Vars.bLegitbotAlwaysOn))
+ return;
+
+ // The current best distance
+ float flDistance = INFINITY;
+ // The target we have chosen
+ CCSPlayerController* pTarget = nullptr;
+ // Cache'd position
+ Vector_t vecBestPosition = Vector_t();
+
+ // Entity loop
+ const int iHighestIndex = I::GameResourceService->pGameEntitySystem->GetHighestEntityIndex();
+
+ for (int nIndex = 1; nIndex <= iHighestIndex; nIndex++)
+ {
+ // Get the entity
+ C_BaseEntity* pEntity = I::GameResourceService->pGameEntitySystem->Get(nIndex);
+ if (pEntity == nullptr)
+ continue;
+
+ // Get the class info
+ SchemaClassInfoData_t* pClassInfo = nullptr;
+ pEntity->GetSchemaClassInfo(&pClassInfo);
+ if (pClassInfo == nullptr)
+ continue;
+
+ // Get the hashed name
+ const FNV1A_t uHashedName = FNV1A::Hash(pClassInfo->szName);
+
+ // Make sure they're a player controller
+ if (uHashedName != FNV1A::HashConst("CCSPlayerController"))
+ continue;
+
+ // Cast to player controller
+ CCSPlayerController* pPlayer = reinterpret_cast(pEntity);
+ if (pPlayer == nullptr)
+ continue;
+
+ // Check the entity is not us
+ if (pPlayer == pLocalController)
+ continue;
+
+ // Get the player pawn
+ C_CSPlayerPawn* pPawn = I::GameResourceService->pGameEntitySystem->Get(pPlayer->GetPawnHandle());
+ if (pPawn == nullptr)
+ continue;
+
+ // Make sure they're alive
+ if (!pPlayer->IsPawnAlive())
+ continue;
+
+ // Check if they're an enemy
+ if (!pLocalPawn->IsOtherEnemy(pPawn))
+ continue;
+
+ // Check if they're dormant
+ CGameSceneNode* pCGameSceneNode = pPawn->GetGameSceneNode();
+ if (pCGameSceneNode == nullptr || pCGameSceneNode->IsDormant())
+ continue;
+
+ // Get the position
+
+ // Firstly, get the skeleton
+ CSkeletonInstance* pSkeleton = pCGameSceneNode->GetSkeletonInstance();
+ if (pSkeleton == nullptr)
+ continue;
+ // Now the bones
+ Matrix2x4_t* pBoneCache = pSkeleton->pBoneCache;
+ if (pBoneCache == nullptr)
+ continue;
+
+ const int iBone = 6; // You may wish to change this dynamically but for now let's target the head.
+
+ // Get the bone's position
+ Vector_t vecPos = pBoneCache->GetOrigin(iBone);
+
+ // @note: this is a simple example of how to check if the player is visible
+
+ // initialize trace, construct filterr and initialize ray
+ GameTrace_t trace = GameTrace_t();
+ TraceFilter_t filter = TraceFilter_t(0x1C3003, pLocalPawn, nullptr, 4);
+ Ray_t ray = Ray_t();
+
+ // cast a ray from local player eye positon -> player head bone
+ // @note: would recommend checking for nullptrs
+ I::GameTraceManager->TraceShape(&ray, pLocalPawn->GetEyePosition(), pPawn->GetGameSceneNode()->GetSkeletonInstance()->pBoneCache->GetOrigin(6), &filter, &trace);
+ // check if the hit entity is the one we wanted to check and if the trace end point is visible
+ if (trace.m_pHitEntity != pPawn || !trace.IsVisible())
+ continue;
+
+
+ // Get the distance/weight of the move
+ //float flCurrentDistance = GetAngularDistance(pUserCmd, vecPos, pLocalPawn);
+ //if (flCurrentDistance > C_GET(float , Vars.aim_range) || flCurrentDistance > flDistance)
+ //{
+ // continue;
+ //}
+
+
+ auto calculateDistance = [](double x1, double y1, double x2, double y2)
+ {
+ return std::sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
+ };
+ ImVec2 vec{};
+ if (!D::WorldToScreen(vecPos, &vec))
+ {
+ continue;
+ }
+ DXGI_SWAP_CHAIN_DESC sd{};
+ I::SwapChain->pDXGISwapChain->GetDesc(&sd);
+
+ float flCurrentDistance = calculateDistance(sd.BufferDesc.Width / 2, sd.BufferDesc.Height / 2, vec.x, vec.y);
+
+ if (flCurrentDistance > C_GET(float, Vars.aim_range) || flCurrentDistance > flDistance)
+ {
+ continue;
+ }
+
+ // Better move found, override.
+ pTarget = pPlayer;
+ flDistance = flCurrentDistance;
+ vecBestPosition = vecPos;
+ }
+
+ // Check if a target was found
+ if (pTarget == nullptr)
+ return;
+
+ // Point at them
+ QAngle_t* pViewAngles = &(pUserCmd->pViewAngles->angValue); // Just for readability sake!
+
+ // Find the change in angles
+ QAngle_t vNewAngles = GetAngularDifference(pUserCmd, vecBestPosition, pLocalPawn);
+
+ // Get the smoothing
+ //const float flSmoothing = C_GET(float, Vars.flSmoothing);
+
+ // Apply smoothing and set angles
+ //pViewAngles->x += vNewAngles.x / flSmoothing;
+ //pViewAngles->y += vNewAngles.y / flSmoothing;
+
+ //pViewAngles->x += vNewAngles.x;
+ //pViewAngles->y += vNewAngles.y;
+ //pViewAngles->Normalize();
+
+ auto aim_punch = pLocalPawn->GetAimPuchAngle();
+
+ I::Input->GetUserCmd()->SetSubTickAngle({ pViewAngles->x + vNewAngles.x - aim_punch.x * 2.f , pViewAngles->y + vNewAngles.y - aim_punch.y * 2.f});
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.h b/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.h
new file mode 100644
index 0000000..da95276
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/legitbot/aim.h
@@ -0,0 +1,17 @@
+#pragma once
+
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSGOInputHistoryEntryPB;
+
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+struct QAngle_t;
+
+namespace F::LEGITBOT::AIM
+{
+ void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn);
+
+ void AimAssist(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn, CCSPlayerController* pLocalController);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/legitbot/legitbot.h b/examples/cs2-silent-aim-master/cstrike/features/legitbot/legitbot.h
new file mode 100644
index 0000000..7ec84ea
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/legitbot/legitbot.h
@@ -0,0 +1,10 @@
+#pragma once
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+namespace F::LEGITBOT
+{
+ void OnMove(CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/misc.cpp b/examples/cs2-silent-aim-master/cstrike/features/misc.cpp
new file mode 100644
index 0000000..9b2ce84
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/misc.cpp
@@ -0,0 +1,10 @@
+#include "misc.h"
+
+// used: movement callback
+#include "misc/movement.h"
+
+void F::MISC::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn)
+{
+ // process movement
+ MOVEMENT::OnMove(pCmd, pBaseCmd, pLocalController, pLocalPawn);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/misc.h b/examples/cs2-silent-aim-master/cstrike/features/misc.h
new file mode 100644
index 0000000..cebd046
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/misc.h
@@ -0,0 +1,10 @@
+#pragma once
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+namespace F::MISC
+{
+ void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/misc/movement.cpp b/examples/cs2-silent-aim-master/cstrike/features/misc/movement.cpp
new file mode 100644
index 0000000..ff6d506
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/misc/movement.cpp
@@ -0,0 +1,187 @@
+#include "movement.h"
+
+// used: sdk entity
+#include "../../sdk/entity.h"
+// used: cusercmd
+#include "../../sdk/datatypes/usercmd.h"
+
+// used: convars
+#include "../../core/convars.h"
+#include "../../sdk/interfaces/ienginecvar.h"
+
+// used: cheat variables
+#include "../../core/variables.h"
+
+// movement correction angles
+static QAngle_t angCorrectionView = {};
+
+void F::MISC::MOVEMENT::OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn)
+{
+ if (!pLocalController->IsPawnAlive())
+ return;
+
+ // check if player is in noclip or on ladder or in water
+ if (const int32_t nMoveType = pLocalPawn->GetMoveType(); nMoveType == MOVETYPE_NOCLIP || nMoveType == MOVETYPE_LADDER || pLocalPawn->GetWaterLevel() >= WL_WAIST)
+ return;
+
+ BunnyHop(pCmd, pBaseCmd, pLocalPawn);
+ AutoStrafe(pBaseCmd, pLocalPawn);
+
+ // loop through all tick commands
+ for (int nSubTick = 0; nSubTick < pCmd->csgoUserCmd.inputHistoryField.pRep->nAllocatedSize; nSubTick++)
+ {
+ CCSGOInputHistoryEntryPB* pInputEntry = pCmd->GetInputHistoryEntry(nSubTick);
+ if (pInputEntry == nullptr)
+ continue;
+
+ // save view angles for movement correction
+ angCorrectionView = pInputEntry->pViewAngles->angValue;
+
+ // movement correction & anti-untrusted
+ ValidateUserCommand(pCmd, pBaseCmd, pInputEntry);
+ }
+}
+
+void F::MISC::MOVEMENT::BunnyHop(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn)
+{
+ if (!C_GET(bool, Vars.bAutoBHop) || CONVAR::sv_autobunnyhopping->value.i1)
+ return;
+
+ // update random seed
+ //MATH::fnRandomSeed(pUserCmd->nRandomSeed);
+
+ //// bypass of possible SMAC/VAC server anticheat detection
+ //if (static bool bShouldFakeJump = false; bShouldFakeJump)
+ //{
+ // pCmd->nButtons.nValue |= IN_JUMP;
+ // bShouldFakeJump = false;
+ //}
+ //// check is player want to jump
+ //else if (pCmd->nButtons.nValue & IN_JUMP)
+ //{
+ // // check is player on the ground
+ // if (pLocalPawn->GetFlags() & FL_ONGROUND)
+ // // note to fake jump at the next tick
+ // bShouldFakeJump = true;
+ // // check did random jump chance passed
+ // else if (MATH::fnRandomInt(0, 100) <= C_GET(int, Vars.nAutoBHopChance))
+ // pCmd->nButtons.nValue &= ~IN_JUMP;
+ //}
+
+ // im lazy so yea :D
+ if (pLocalPawn->GetFlags() & FL_ONGROUND)
+ {
+ pUserCmd->pInButtonState->SetBits(EButtonStatePBBits::BUTTON_STATE_PB_BITS_BUTTONSTATE1);
+ pUserCmd->pInButtonState->nValue &= ~IN_JUMP;
+ }
+}
+
+void F::MISC::MOVEMENT::AutoStrafe(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn)
+{
+ if (!C_GET(bool, Vars.bAutoStrafe) || pLocalPawn->GetFlags() & FL_ONGROUND)
+ return;
+
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_LEFTMOVE);
+ pUserCmd->flSideMove = pUserCmd->nMousedX > 0 ? -1.0f : 1.0f; // a bit yanky, but works
+}
+
+void F::MISC::MOVEMENT::ValidateUserCommand(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputEntry)
+{
+ if (pUserCmd == nullptr)
+ return;
+
+ // clamp angle to avoid untrusted angle
+ if (C_GET(bool, Vars.bAntiUntrusted))
+ {
+ pInputEntry->SetBits(EInputHistoryBits::INPUT_HISTORY_BITS_VIEWANGLES);
+ if (pInputEntry->pViewAngles->angValue.IsValid())
+ {
+ pInputEntry->pViewAngles->angValue.Clamp();
+ pInputEntry->pViewAngles->angValue.z = 0.f;
+ }
+ else
+ {
+ pInputEntry->pViewAngles->angValue = {};
+ L_PRINT(LOG_WARNING) << CS_XOR("view angles have a NaN component, the value is reset");
+ }
+ }
+
+ MovementCorrection(pUserCmd, pInputEntry, angCorrectionView);
+
+ // correct movement buttons while player move have different to buttons values
+ // clear all of the move buttons states
+ pUserCmd->pInButtonState->SetBits(EButtonStatePBBits::BUTTON_STATE_PB_BITS_BUTTONSTATE1);
+ pUserCmd->pInButtonState->nValue &= (~IN_FORWARD | ~IN_BACK | ~IN_LEFT | ~IN_RIGHT);
+
+ // re-store buttons by active forward/side moves
+ if (pUserCmd->flForwardMove > 0.0f)
+ pUserCmd->pInButtonState->nValue |= IN_FORWARD;
+ else if (pUserCmd->flForwardMove < 0.0f)
+ pUserCmd->pInButtonState->nValue |= IN_BACK;
+
+ if (pUserCmd->flSideMove > 0.0f)
+ pUserCmd->pInButtonState->nValue |= IN_RIGHT;
+ else if (pUserCmd->flSideMove < 0.0f)
+ pUserCmd->pInButtonState->nValue |= IN_LEFT;
+
+ if (!pInputEntry->pViewAngles->angValue.IsZero())
+ {
+ const float flDeltaX = std::remainderf(pInputEntry->pViewAngles->angValue.x - angCorrectionView.x, 360.f);
+ const float flDeltaY = std::remainderf(pInputEntry->pViewAngles->angValue.y - angCorrectionView.y, 360.f);
+
+ float flPitch = CONVAR::m_pitch->value.fl;
+ float flYaw = CONVAR::m_yaw->value.fl;
+
+ float flSensitivity = CONVAR::sensitivity->value.fl;
+ if (flSensitivity == 0.0f)
+ flSensitivity = 1.0f;
+
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_MOUSEDX);
+ pUserCmd->nMousedX = static_cast(flDeltaX / (flSensitivity * flPitch));
+
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_MOUSEDY);
+ pUserCmd->nMousedY = static_cast(-flDeltaY / (flSensitivity * flYaw));
+ }
+}
+
+void F::MISC::MOVEMENT::MovementCorrection(CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputEntry, const QAngle_t& angDesiredViewPoint)
+{
+ if (pUserCmd == nullptr)
+ return;
+
+ Vector_t vecForward = {}, vecRight = {}, vecUp = {};
+ angDesiredViewPoint.ToDirections(&vecForward, &vecRight, &vecUp);
+
+ // we don't attempt on forward/right roll, and on up pitch/yaw
+ vecForward.z = vecRight.z = vecUp.x = vecUp.y = 0.0f;
+
+ vecForward.NormalizeInPlace();
+ vecRight.NormalizeInPlace();
+ vecUp.NormalizeInPlace();
+
+ Vector_t vecOldForward = {}, vecOldRight = {}, vecOldUp = {};
+ pInputEntry->pViewAngles->angValue.ToDirections(&vecOldForward, &vecOldRight, &vecOldUp);
+
+ // we don't attempt on forward/right roll, and on up pitch/yaw
+ vecOldForward.z = vecOldRight.z = vecOldUp.x = vecOldUp.y = 0.0f;
+
+ vecOldForward.NormalizeInPlace();
+ vecOldRight.NormalizeInPlace();
+ vecOldUp.NormalizeInPlace();
+
+ const float flPitchForward = vecForward.x * pUserCmd->flForwardMove;
+ const float flYawForward = vecForward.y * pUserCmd->flForwardMove;
+ const float flPitchSide = vecRight.x * pUserCmd->flSideMove;
+ const float flYawSide = vecRight.y * pUserCmd->flSideMove;
+ const float flRollUp = vecUp.z * pUserCmd->flUpMove;
+
+ // solve corrected movement speed
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_FORWARDMOVE);
+ pUserCmd->flForwardMove = vecOldForward.x * flPitchSide + vecOldForward.y * flYawSide + vecOldForward.x * flPitchForward + vecOldForward.y * flYawForward + vecOldForward.z * flRollUp;
+
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_LEFTMOVE);
+ pUserCmd->flSideMove = vecOldRight.x * flPitchSide + vecOldRight.y * flYawSide + vecOldRight.x * flPitchForward + vecOldRight.y * flYawForward + vecOldRight.z * flRollUp;
+
+ pUserCmd->SetBits(EBaseCmdBits::BASE_BITS_UPMOVE);
+ pUserCmd->flUpMove = vecOldUp.x * flYawSide + vecOldUp.y * flPitchSide + vecOldUp.x * flYawForward + vecOldUp.y * flPitchForward + vecOldUp.z * flRollUp;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/misc/movement.h b/examples/cs2-silent-aim-master/cstrike/features/misc/movement.h
new file mode 100644
index 0000000..fa0646f
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/misc/movement.h
@@ -0,0 +1,22 @@
+#pragma once
+
+class CUserCmd;
+class CBaseUserCmdPB;
+class CCSGOInputHistoryEntryPB;
+
+class CCSPlayerController;
+class C_CSPlayerPawn;
+
+struct QAngle_t;
+
+namespace F::MISC::MOVEMENT
+{
+ void OnMove(CUserCmd* pCmd, CBaseUserCmdPB* pBaseCmd, CCSPlayerController* pLocalController, C_CSPlayerPawn* pLocalPawn);
+
+ void BunnyHop(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn);
+ void AutoStrafe(CBaseUserCmdPB* pUserCmd, C_CSPlayerPawn* pLocalPawn);
+ void MovementCorrection(CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputHistory, const QAngle_t& angDesiredViewPoint);
+
+ // will call MovementCorrection && validate user's angView to avoid untrusted ban
+ void ValidateUserCommand(CUserCmd* pCmd, CBaseUserCmdPB* pUserCmd, CCSGOInputHistoryEntryPB* pInputHistory);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals.cpp b/examples/cs2-silent-aim-master/cstrike/features/visuals.cpp
new file mode 100644
index 0000000..887eb05
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals.cpp
@@ -0,0 +1,58 @@
+#include "visuals.h"
+
+// used: source sdk
+#include "../sdk/interfaces/iengineclient.h"
+#include "../sdk/entity.h"
+
+// used: overlay
+#include "visuals/overlay.h"
+#include "visuals/chams.h"
+
+#include "../core/sdk.h"
+#include "../aimRangePainter.hpp"
+using namespace F;
+
+bool F::VISUALS::Setup()
+{
+ if (!CHAMS::Initialize())
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("failed to initialize chams");
+ return false;
+ }
+
+ return true;
+}
+
+void F::VISUALS::OnDestroy()
+{
+ CHAMS::Destroy();
+}
+
+void VISUALS::OnFrame(const int nStage)
+{
+ if (nStage == FRAME_RENDER_END)
+ {
+ // check is render initialized
+ if (!D::bInitialized)
+ return;
+
+ /*
+ * game and our gui are based on immediate render mode principe
+ * this means that we should always reset draw data from previous frame and re-store it again
+ */
+ D::ResetDrawData();
+ AimRangePainter aimRangePainter;
+ aimRangePainter.Draw(D::pDrawListActive);
+ if (CCSPlayerController* pLocal = CCSPlayerController::GetLocalPlayerController(); pLocal != nullptr)
+ {
+ OVERLAY::OnFrameStageNotify(pLocal);
+ }
+
+ D::SwapDrawData();
+ }
+}
+
+bool F::VISUALS::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
+{
+ return CHAMS::OnDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals.h b/examples/cs2-silent-aim-master/cstrike/features/visuals.h
new file mode 100644
index 0000000..2193213
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals.h
@@ -0,0 +1,12 @@
+#pragma once
+
+class CMeshData;
+
+namespace F::VISUALS
+{
+ bool Setup();
+ void OnDestroy();
+
+ void OnFrame(const int nStage);
+ bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.cpp b/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.cpp
new file mode 100644
index 0000000..f45a7d5
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.cpp
@@ -0,0 +1,134 @@
+#include "chams.h"
+
+// used: game's interfaces
+#include "../../core/interfaces.h"
+#include "../../sdk/interfaces/imaterialsystem.h"
+#include "../../sdk/interfaces/igameresourceservice.h"
+#include "../../sdk/interfaces/cgameentitysystem.h"
+#include "../../sdk/interfaces/iresourcesystem.h"
+#include "../../core/sdk.h"
+#include "../../sdk/entity.h"
+
+// used: original call in hooked function
+#include "../../core/hooks.h"
+
+// used: cheat variables
+#include "../../core/variables.h"
+
+CStrongHandle F::VISUALS::CHAMS::CreateMaterial(const char* szMaterialName, const char szVmatBuffer[])
+{
+ CKeyValues3* pKeyValues3 = CKeyValues3::CreateMaterialResource();
+ pKeyValues3->LoadFromBuffer(szVmatBuffer);
+
+ CStrongHandle pCustomMaterial = {};
+ MEM::fnCreateMaterial(nullptr, &pCustomMaterial, szMaterialName, pKeyValues3, 0, 1);
+
+ return pCustomMaterial;
+}
+
+struct CustomMaterial_t
+{
+ CStrongHandle pMaterial;
+ CStrongHandle pMaterialInvisible;
+};
+
+static CustomMaterial_t arrMaterials[VISUAL_MATERIAL_MAX];
+
+bool F::VISUALS::CHAMS::Initialize()
+{
+ // check if we already initialized materials
+ if (bInitialized)
+ return bInitialized;
+
+ arrMaterials[VISUAL_MATERIAL_PRIMARY_WHITE] = CustomMaterial_t{
+ .pMaterial = CreateMaterial(CS_XOR("materials/dev/primary_white.vmat"), szVMatBufferWhiteVisible),
+ .pMaterialInvisible = CreateMaterial(CS_XOR("materials/dev/primary_white.vmat"), szVMatBufferWhiteInvisible)
+ };
+
+ arrMaterials[VISUAL_MATERIAL_ILLUMINATE] = CustomMaterial_t{
+ .pMaterial = CreateMaterial(CS_XOR("materials/dev/primary_white.vmat"), szVMatBufferIlluminateVisible),
+ .pMaterialInvisible = CreateMaterial(CS_XOR("materials/dev/primary_white.vmat"), szVMatBufferIlluminateInvisible)
+ };
+
+ bInitialized = true;
+ for (auto& [pMaterial, pMaterialInvisible] : arrMaterials)
+ {
+ if (pMaterial == nullptr || pMaterialInvisible == nullptr)
+ bInitialized = false;
+ }
+
+ return bInitialized;
+}
+
+void F::VISUALS::CHAMS::Destroy()
+{
+ for (auto& [pVisible, pInvisible] : arrMaterials)
+ {
+ if (pVisible)
+ I::ResourceHandleUtils->DeleteResource(pVisible.pBinding);
+
+ if (pInvisible)
+ I::ResourceHandleUtils->DeleteResource(pInvisible.pBinding);
+ }
+}
+
+bool F::VISUALS::CHAMS::OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
+{
+ if (!bInitialized)
+ return false;
+
+ if (!C_GET(bool, Vars.bVisualChams))
+ return false;
+
+ if (arrMeshDraw == nullptr)
+ return false;
+
+ if (arrMeshDraw->pSceneAnimatableObject == nullptr)
+ return false;
+
+ CBaseHandle hOwner = arrMeshDraw->pSceneAnimatableObject->hOwner;
+
+ auto pEntity = I::GameResourceService->pGameEntitySystem->Get(hOwner);
+ if (pEntity == nullptr)
+ return false;
+
+ SchemaClassInfoData_t* pClassInfo;
+ pEntity->GetSchemaClassInfo(&pClassInfo);
+ if (pClassInfo == nullptr)
+ return false;
+
+ if (CRT::StringCompare(pClassInfo->szName, CS_XOR("C_CSPlayerPawn")) != 0)
+ return false;
+
+ auto pPlayerPawn = I::GameResourceService->pGameEntitySystem->Get(hOwner);
+ if (pPlayerPawn == nullptr)
+ return false;
+
+ if (!pPlayerPawn->IsOtherEnemy(SDK::LocalPawn))
+ return false;
+
+ // alive state
+ if (pPlayerPawn->GetHealth() <= 0)
+ return false;
+
+ return OverrideMaterial(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+}
+
+bool F::VISUALS::CHAMS::OverrideMaterial(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2)
+{
+ const auto oDrawObject = H::hkDrawObject.GetOriginal();
+ const CustomMaterial_t customMaterial = arrMaterials[C_GET(int, Vars.nVisualChamMaterial)];
+
+ if (C_GET(bool, Vars.bVisualChamsIgnoreZ))
+ {
+ arrMeshDraw->pMaterial = customMaterial.pMaterialInvisible;
+ arrMeshDraw->colValue = C_GET(Color_t, Vars.colVisualChamsIgnoreZ);
+ oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+ }
+
+ arrMeshDraw->pMaterial = customMaterial.pMaterial;
+ arrMeshDraw->colValue = C_GET(Color_t, Vars.colVisualChams);
+ oDrawObject(pAnimatableSceneObjectDesc, pDx11, arrMeshDraw, nDataCount, pSceneView, pSceneLayer, pUnk, pUnk2);
+
+ return true;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.h b/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.h
new file mode 100644
index 0000000..df67c54
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals/chams.h
@@ -0,0 +1,101 @@
+#pragma once
+// used: stronghandle
+#include "../../sdk/datatypes/stronghandle.h"
+
+static constexpr char szVMatBufferWhiteVisible[] =
+R"(
+{
+ shader = "csgo_unlitgeneric.vfx"
+
+ F_PAINT_VERTEX_COLORS = 1
+ F_TRANSLUCENT = 1
+ F_BLEND_MODE = 1
+
+ g_vColorTint = [1, 1, 1, 1]
+
+ TextureAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tTintMask = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+})";
+
+static constexpr char szVMatBufferWhiteInvisible[] =
+R"(
+{
+ shader = "csgo_unlitgeneric.vfx"
+
+ F_PAINT_VERTEX_COLORS = 1
+ F_TRANSLUCENT = 1
+ F_BLEND_MODE = 1
+ F_DISABLE_Z_BUFFERING = 1
+
+ g_vColorTint = [1, 1, 1, 1]
+
+ TextureAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tAmbientOcclusion = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tTintMask = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+})";
+
+static constexpr char szVMatBufferIlluminateVisible[] =
+R"(
+{
+ shader = "csgo_complex.vfx"
+
+ F_SELF_ILLUM = 1
+ F_PAINT_VERTEX_COLORS = 1
+ F_TRANSLUCENT = 1
+
+ g_vColorTint = [ 1.000000, 1.000000, 1.000000, 1.000000 ]
+ g_flSelfIllumScale = [ 3.000000, 3.000000, 3.000000, 3.000000 ]
+ g_flSelfIllumBrightness = [ 3.000000, 3.000000, 3.000000, 3.000000 ]
+ g_vSelfIllumTint = [ 10.000000, 10.000000, 10.000000, 10.000000 ]
+
+ g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tSelfIllumMask = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ TextureAmbientOcclusion = resource:"materials/debug/particleerror.vtex"
+ g_tAmbientOcclusion = resource:"materials/debug/particleerror.vtex"
+})";
+
+static constexpr char szVMatBufferIlluminateInvisible[] =
+R"(
+{
+ shader = "csgo_complex.vfx"
+
+ F_SELF_ILLUM = 1
+ F_PAINT_VERTEX_COLORS = 1
+ F_TRANSLUCENT = 1
+ F_DISABLE_Z_BUFFERING = 1
+
+ g_vColorTint = [ 1.000000, 1.000000, 1.000000, 1.000000 ]
+ g_flSelfIllumScale = [ 3.000000, 3.000000, 3.000000, 3.000000 ]
+ g_flSelfIllumBrightness = [ 3.000000, 3.000000, 3.000000, 3.000000 ]
+ g_vSelfIllumTint = [ 10.000000, 10.000000, 10.000000, 10.000000 ]
+
+ g_tColor = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tNormal = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ g_tSelfIllumMask = resource:"materials/default/default_mask_tga_fde710a5.vtex"
+ TextureAmbientOcclusion = resource:"materials/debug/particleerror.vtex"
+ g_tAmbientOcclusion = resource:"materials/debug/particleerror.vtex"
+})";
+
+class CMaterial2;
+class CMeshData;
+
+namespace F::VISUALS::CHAMS
+{
+ bool Initialize();
+ void Destroy();
+
+ bool OnDrawObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
+
+ // @note: bDisableZBuffering == true to create invisible material
+ CStrongHandle CreateMaterial(const char* szMaterialName, const char szVmatBuffer[]);
+
+ bool OverrideMaterial(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
+
+ inline bool bInitialized = false;
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.cpp b/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.cpp
new file mode 100644
index 0000000..2d939ec
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.cpp
@@ -0,0 +1,627 @@
+// used: [stl] vector
+#include
+// used: [stl] sort
+#include
+
+#include "overlay.h"
+
+// used: cheat variables
+#include "../../core/variables.h"
+
+// used: entity
+#include "../../sdk/entity.h"
+#include "../../sdk/interfaces/cgameentitysystem.h"
+#include "../../sdk/interfaces/iengineclient.h"
+#include "../../sdk/interfaces/cgametracemanager.h"
+
+// used: sdk variables
+#include "../../core/sdk.h"
+
+// used: l_print
+#include "../../utilities/log.h"
+// used: inputsystem
+#include "../../utilities/inputsystem.h"
+// used: draw system
+#include "../../utilities/draw.h"
+
+// used: mainwindowopened
+#include "../../core/menu.h"
+
+using namespace F::VISUALS;
+
+#pragma region visual_overlay_components
+
+ImVec2 OVERLAY::CBaseComponent::GetBasePosition(const ImVec4& box) const
+{
+ return { box[this->nSide == SIDE_RIGHT ? SIDE_RIGHT : SIDE_LEFT], box[this->nSide == SIDE_BOTTOM ? SIDE_BOTTOM : SIDE_TOP] };
+}
+
+ImVec2 OVERLAY::CBaseDirectionalComponent::GetBasePosition(const ImVec4& box) const
+{
+ ImVec2 vecBasePosition = {};
+
+ if (this->nSide == SIDE_TOP || this->nSide == SIDE_BOTTOM)
+ {
+ CS_ASSERT(this->nDirection != (this->nSide ^ SIDE_BOTTOM) + 1); // this direction isn't supported for this side
+ vecBasePosition = { (box[SIDE_LEFT] + box[SIDE_RIGHT]) * 0.5f, box[this->nSide] };
+ }
+ else if (this->nSide == SIDE_LEFT || this->nSide == SIDE_RIGHT)
+ {
+ CS_ASSERT(this->nDirection != (this->nSide ^ SIDE_RIGHT)); // this direction isn't supported for this side
+ vecBasePosition = { box[this->nSide], box[this->nDirection == DIR_TOP ? SIDE_BOTTOM : SIDE_TOP] };
+ }
+ else
+ {
+ L_PRINT(LOG_ERROR) << CS_XOR("CBaseDirectionalComponent::GetBasePosition: invalid side: ") << this->nSide;
+ CS_ASSERT(false); // this side isn't supported for this component
+ return vecBasePosition;
+ }
+
+ if (this->nSide != SIDE_RIGHT && this->nDirection != DIR_RIGHT)
+ vecBasePosition.x -= this->vecSize.x * ((static_cast(this->nDirection) == static_cast(this->nSide) && (this->nSide & 1U) == 1U) ? 0.5f : 1.0f);
+
+ if (this->nSide == SIDE_TOP || this->nDirection == DIR_TOP)
+ vecBasePosition.y -= this->vecSize.y;
+
+ return vecBasePosition;
+}
+
+OVERLAY::CBarComponent::CBarComponent(const bool bIsMenuItem, const EAlignSide nAlignSide, const ImVec4& vecBox, const float flProgressFactor, const std::size_t uOverlayVarIndex) :
+ bIsMenuItem(bIsMenuItem), uOverlayVarIndex(uOverlayVarIndex), flProgressFactor(MATH::Clamp(flProgressFactor, 0.f, 1.f))
+{
+ this->nSide = nAlignSide;
+
+ const bool bIsHorizontal = ((nAlignSide & 1U) == 1U);
+
+ const BarOverlayVar_t& overlayConfig = C_GET(BarOverlayVar_t, uOverlayVarIndex);
+ this->vecSize = { (bIsHorizontal ? vecBox[SIDE_RIGHT] - vecBox[SIDE_LEFT] : overlayConfig.flThickness), (bIsHorizontal ? overlayConfig.flThickness : vecBox[SIDE_BOTTOM] - vecBox[SIDE_TOP]) };
+}
+
+void OVERLAY::CBarComponent::Render(ImDrawList* pDrawList, const ImVec2& vecPosition)
+{
+ BarOverlayVar_t& overlayConfig = C_GET(BarOverlayVar_t, uOverlayVarIndex);
+ const ImVec2 vecThicknessOffset = { overlayConfig.flThickness, overlayConfig.flThickness };
+ ImVec2 vecMin = vecPosition, vecMax = vecPosition + this->vecSize;
+
+ // background glow
+ pDrawList->AddShadowRect(vecMin, vecMax, overlayConfig.colBackground.GetU32(), 1.f, ImVec2(0, 0));
+ // outline
+ pDrawList->AddRect(vecMin, vecMax, overlayConfig.colOutline.GetU32(), 0.f, ImDrawFlags_None, overlayConfig.flThickness);
+
+ // account outline offset
+ vecMin += vecThicknessOffset;
+ vecMax -= vecThicknessOffset;
+
+ const ImVec2 vecLineSize = vecMax - vecMin;
+
+ // modify active side axis by factor
+ if ((this->nSide & 1U) == 0U)
+ vecMin.y += vecLineSize.y * (1.0f - this->flProgressFactor);
+ else
+ vecMax.x -= vecLineSize.x * (1.0f - this->flProgressFactor);
+
+ // bar
+ if (overlayConfig.bGradient && !overlayConfig.bUseFactorColor)
+ {
+ if (this->nSide == SIDE_LEFT || this->nSide == SIDE_RIGHT)
+ pDrawList->AddRectFilledMultiColor(vecMin, vecMax, overlayConfig.colPrimary.GetU32(), overlayConfig.colPrimary.GetU32(), overlayConfig.colSecondary.GetU32(), overlayConfig.colSecondary.GetU32());
+ else
+ pDrawList->AddRectFilledMultiColor(vecMin, vecMax, overlayConfig.colSecondary.GetU32(), overlayConfig.colPrimary.GetU32(), overlayConfig.colPrimary.GetU32(), overlayConfig.colSecondary.GetU32());
+ }
+ else
+ {
+ const ImU32 u32Color = overlayConfig.bUseFactorColor ? Color_t::FromHSB((flProgressFactor * 120.f) / 360.f, 1.0f, 1.0f).GetU32() : overlayConfig.colPrimary.GetU32();
+ pDrawList->AddRectFilled(vecMin, vecMax, u32Color, 0.f, ImDrawFlags_None);
+ }
+
+ // only open menu item if menu is opened and overlay is enabled
+ bIsMenuItem &= (MENU::bMainWindowOpened && overlayConfig.bEnable);
+ if (bIsMenuItem)
+ {
+ // @note: padding 2.f incase the thickness is too small
+ this->bIsHovered = ImRect(vecPosition - ImVec2(2.f, 2.f), vecPosition + this->vecSize + ImVec2(2.f, 2.f)).Contains(ImGui::GetIO().MousePos);
+ // if component is hovered + right clicked
+ if (this->bIsHovered && ImGui::IsMouseClicked(ImGuiMouseButton_Right))
+ ImGui::OpenPopup(CS_XOR("context##component.bar"));
+
+ if (ImGui::BeginPopup(CS_XOR("context##component.bar"), ImGuiWindowFlags_NoResize | ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoMove))
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, -1));
+
+ ImGui::Checkbox(CS_XOR("use factor color##component.bar"), &overlayConfig.bUseFactorColor);
+ if (!overlayConfig.bUseFactorColor)
+ ImGui::Checkbox(CS_XOR("use gradient##component.bar"), &overlayConfig.bGradient);
+
+ ImGui::ColorEdit3(CS_XOR("primary color##component.bar"), &overlayConfig.colPrimary);
+ if (overlayConfig.bGradient && !overlayConfig.bUseFactorColor)
+ ImGui::ColorEdit3(CS_XOR("secondary color##component.bar"), &overlayConfig.colSecondary);
+
+ ImGui::ColorEdit4(CS_XOR("outline color##component.bar"), &overlayConfig.colOutline);
+ ImGui::ColorEdit4(CS_XOR("background color##component.bar"), &overlayConfig.colBackground);
+
+ ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.75f);
+ ImGui::SliderFloat(CS_XOR("thickness##component.bar"), &overlayConfig.flThickness, 1.0f, 10.0f, CS_XOR("%.1f"), ImGuiSliderFlags_NoInput);
+ ImGui::PopStyleVar();
+
+ ImGui::EndPopup();
+ }
+ }
+ else
+ // dont process hovered on menu close...
+ this->bIsHovered = false;
+}
+
+OVERLAY::CTextComponent::CTextComponent(const bool bIsMenuItem, const EAlignSide nAlignSide, const EAlignDirection nAlignDirection, const ImFont* pFont, const char* szText, const std::size_t uOverlayVarIndex) :
+ bIsMenuItem(bIsMenuItem), pFont(pFont), uOverlayVarIndex(uOverlayVarIndex)
+{
+ // allocate own buffer to safely store a copy of the string
+ this->szText = new char[CRT::StringLength(szText) + 1U];
+ CRT::StringCopy(this->szText, szText);
+
+ this->nSide = nAlignSide;
+ this->nDirection = nAlignDirection;
+ this->vecSize = pFont->CalcTextSizeA(pFont->FontSize, FLT_MAX, 0.0f, szText) + C_GET(TextOverlayVar_t, uOverlayVarIndex).flThickness;
+}
+
+OVERLAY::CTextComponent::~CTextComponent()
+{
+ // deallocate buffer of the copied string
+ delete[] this->szText;
+}
+
+void OVERLAY::CTextComponent::Render(ImDrawList* pDrawList, const ImVec2& vecPosition)
+{
+ TextOverlayVar_t& overlayConfig = C_GET(TextOverlayVar_t, this->uOverlayVarIndex);
+
+ const ImVec2 vecOutlineOffset = { overlayConfig.flThickness, overlayConfig.flThickness };
+
+ // @test: used for spacing debugging
+ //pDrawList->AddRect(vecPosition, vecPosition + this->vecSize, IM_COL32(255, 255, 255, 255));
+
+ // @todo: fix this cringe shit after gui merge
+ if (overlayConfig.flThickness >= 1.0f)
+ {
+ pDrawList->AddText(this->pFont, this->pFont->FontSize, vecPosition, overlayConfig.colOutline.GetU32(), this->szText);
+ pDrawList->AddText(this->pFont, this->pFont->FontSize, vecPosition + vecOutlineOffset * 2.0f, overlayConfig.colOutline.GetU32(), this->szText);
+ }
+
+ pDrawList->AddText(this->pFont, this->pFont->FontSize, vecPosition + vecOutlineOffset, overlayConfig.colPrimary.GetU32(), this->szText);
+
+ // only open menu item if menu is opened and overlay is enabled
+ bIsMenuItem &= MENU::bMainWindowOpened && overlayConfig.bEnable;
+ if (bIsMenuItem)
+ {
+ this->bIsHovered = ImRect(vecPosition, vecPosition + this->vecSize).Contains(ImGui::GetIO().MousePos);
+ //pDrawList->AddRect(vecPosition, vecPosition + this->vecSize, IM_COL32(this->bIsHovered ? 0 : 255, this->bIsHovered ? 255 : 0, 0, 255));
+
+ // if component is hovered + right clicked
+ if (this->bIsHovered && ImGui::IsMouseClicked(ImGuiMouseButton_Right))
+ ImGui::OpenPopup(CS_XOR("context##component.text"));
+
+ if (ImGui::BeginPopup(CS_XOR("context##component.text")))
+ {
+ ImGui::PushStyleVar(ImGuiStyleVar_FramePadding, ImVec2(ImGui::GetStyle().FramePadding.x, -1));
+
+ ImGui::ColorEdit3(CS_XOR("primary color##component.bar"), &overlayConfig.colPrimary);
+ ImGui::ColorEdit4(CS_XOR("outline color##component.bar"), &overlayConfig.colOutline);
+
+ ImGui::SetNextItemWidth(ImGui::GetWindowWidth() * 0.75f);
+ ImGui::SliderFloat(CS_XOR("outline thickness##component.bar"), &overlayConfig.flThickness, 1.0f, 10.0f, CS_XOR("%.1f"), ImGuiSliderFlags_NoInput);
+
+ ImGui::PopStyleVar();
+
+ ImGui::EndPopup();
+ }
+ }
+}
+
+#pragma endregion
+
+#pragma region visual_overlay_context
+
+bool OVERLAY::Context_t::AddBoxComponent(ImDrawList* pDrawList, const ImVec4& vecBox, const int nType, float flThickness, float flRounding, const Color_t& colPrimary, const Color_t& colOutline)
+{
+ flThickness = std::floorf(flThickness);
+ const ImVec2 vecThicknessOffset = { flThickness, flThickness };
+
+ switch (nType)
+ {
+ case VISUAL_OVERLAY_BOX_FULL:
+ {
+ const ImVec2 vecBoxMin = { vecBox[SIDE_LEFT], vecBox[SIDE_TOP] };
+ const ImVec2 vecBoxMax = { vecBox[SIDE_RIGHT], vecBox[SIDE_BOTTOM] };
+
+ // inner outline
+ pDrawList->AddRect(vecBoxMin + vecThicknessOffset * 2.0f, vecBoxMax - vecThicknessOffset * 2.0f, colOutline.GetU32(), flRounding, ImDrawFlags_RoundCornersAll, flThickness);
+ // primary box
+ pDrawList->AddRect(vecBoxMin + vecThicknessOffset, vecBoxMax - vecThicknessOffset, colPrimary.GetU32(), flRounding, ImDrawFlags_RoundCornersAll, flThickness);
+ // outer outline
+ pDrawList->AddRect(vecBoxMin, vecBoxMax, colOutline.GetU32(), flRounding, ImDrawFlags_RoundCornersAll, flThickness);
+
+ break;
+ }
+ case VISUAL_OVERLAY_BOX_CORNERS:
+ {
+ // corner part of the whole line
+ constexpr float flPartRatio = 0.25f;
+
+ const float flCornerWidth = ((vecBox[SIDE_RIGHT] - vecBox[SIDE_LEFT]) * flPartRatio);
+ const float flCornerHeight = ((vecBox[SIDE_BOTTOM] - vecBox[SIDE_TOP]) * flPartRatio);
+
+ const ImVec2 arrCornerPoints[4][3] = {
+ // top-left
+ { ImVec2(vecBox[SIDE_LEFT], vecBox[SIDE_TOP] + flCornerHeight) + vecThicknessOffset, ImVec2(vecBox[SIDE_LEFT], vecBox[SIDE_TOP]) + vecThicknessOffset, ImVec2(vecBox[SIDE_LEFT] + flCornerWidth, vecBox[SIDE_TOP]) + vecThicknessOffset },
+
+ // top-right
+ { ImVec2(vecBox[SIDE_RIGHT] - flCornerWidth - vecThicknessOffset.x, vecBox[SIDE_TOP] + vecThicknessOffset.y * 2.0f), ImVec2(vecBox[SIDE_RIGHT] - vecThicknessOffset.x, vecBox[SIDE_TOP] + vecThicknessOffset.y * 2.0f), ImVec2(vecBox[SIDE_RIGHT] - vecThicknessOffset.x, vecBox[SIDE_TOP] + flCornerHeight + vecThicknessOffset.y * 2.0f) },
+
+ // bottom-left
+ { ImVec2(vecBox[SIDE_LEFT] + flCornerWidth + vecThicknessOffset.x, vecBox[SIDE_BOTTOM] - vecThicknessOffset.y * 2.0f), ImVec2(vecBox[SIDE_LEFT] + vecThicknessOffset.x, vecBox[SIDE_BOTTOM] - vecThicknessOffset.y * 2.0f), ImVec2(vecBox[SIDE_LEFT] + vecThicknessOffset.x, vecBox[SIDE_BOTTOM] - flCornerHeight - vecThicknessOffset.y * 2.0f) },
+
+ // bottom-right
+ { ImVec2(vecBox[SIDE_RIGHT], vecBox[SIDE_BOTTOM] - flCornerHeight) - vecThicknessOffset, ImVec2(vecBox[SIDE_RIGHT], vecBox[SIDE_BOTTOM]) - vecThicknessOffset, ImVec2(vecBox[SIDE_RIGHT] - flCornerWidth, vecBox[SIDE_BOTTOM]) - vecThicknessOffset }
+ };
+
+ for (std::size_t i = 0U; i < CS_ARRAYSIZE(arrCornerPoints); i++)
+ {
+ const auto& arrLinePoints = arrCornerPoints[i];
+ const ImVec2 vecHalfPixelOffset = ((i & 1U) == 1U ? ImVec2(-0.5f, -0.5f) : ImVec2(0.5f, 0.5f));
+
+ // @todo: we can even do not clear path and reuse it
+ pDrawList->PathLineTo(arrLinePoints[0] + vecHalfPixelOffset);
+ pDrawList->PathLineTo(arrLinePoints[1] + vecHalfPixelOffset);
+ pDrawList->PathLineTo(arrLinePoints[2] + vecHalfPixelOffset);
+ pDrawList->PathStroke(colOutline.GetU32(), false, flThickness + 1.0f);
+
+ pDrawList->PathLineTo(arrLinePoints[0] + vecHalfPixelOffset);
+ pDrawList->PathLineTo(arrLinePoints[1] + vecHalfPixelOffset);
+ pDrawList->PathLineTo(arrLinePoints[2] + vecHalfPixelOffset);
+ pDrawList->PathStroke(colPrimary.GetU32(), false, flThickness);
+ }
+
+ break;
+ }
+ default:
+ break;
+ }
+
+ // accumulate spacing for next side/directional components
+ for (float& flSidePadding : this->arrSidePaddings)
+ flSidePadding += this->flComponentSpacing;
+
+ return ImRect(vecBox).Contains(ImGui::GetIO().MousePos);
+}
+
+ImVec4 OVERLAY::Context_t::AddFrameComponent(ImDrawList* pDrawList, const ImVec2& vecScreen, const EAlignSide nSide, const Color_t& colBackground, const float flRounding, const ImDrawFlags nRoundingCorners)
+{
+ // calculate frame size by previously added components on active side
+ const ImVec2 vecFrameSize = this->GetTotalDirectionalSize(nSide);
+
+ ImVec2 vecFrameMin = { vecScreen.x - vecFrameSize.x * 0.5f, vecScreen.y - vecFrameSize.y };
+ ImVec2 vecFrameMax = { vecScreen.x + vecFrameSize.x * 0.5f, vecScreen.y };
+
+ pDrawList->AddRectFilled(vecFrameMin - this->flComponentSpacing, vecFrameMax + this->flComponentSpacing, colBackground.GetU32(), flRounding, nRoundingCorners);
+
+ // accumulate spacing for next side/directional components
+ for (float& flSidePadding : this->arrSidePaddings)
+ flSidePadding += this->flComponentSpacing;
+
+ return { vecFrameMin.x, vecFrameMin.y, vecFrameMax.x, vecFrameMax.y };
+}
+
+/*
+ * @todo: currently not well designed, make it more flexible for use cases where we need e.g. previous frame bar factor etc
+ * also to optimize this, allocate components at stack instead of heap + make all context units static and do not realloc components storage every frame, but reset (like memset idk) it at the end of frame
+ */
+void OVERLAY::Context_t::AddComponent(CBaseComponent* pComponent)
+{
+ // guarantee that first directional component on each side is in the primary direction
+ if (pComponent->IsDirectional())
+ {
+ CBaseDirectionalComponent* pDirectionalComponent = static_cast(pComponent);
+
+ // check if it's not an exception direction and there are no components in the primary direction
+ if (((pDirectionalComponent->nSide & 1U) == 1U || pDirectionalComponent->nDirection != DIR_TOP) && this->arrSideDirectionPaddings[pDirectionalComponent->nSide][pDirectionalComponent->nSide] == 0.0f)
+ pDirectionalComponent->nDirection = static_cast(pDirectionalComponent->nSide);
+ }
+
+ float& flSidePadding = this->arrSidePaddings[pComponent->nSide];
+
+ if (pComponent->IsDirectional())
+ {
+ CBaseDirectionalComponent* pDirectionalComponent = static_cast(pComponent);
+ float(&arrDirectionPaddings)[DIR_MAX] = this->arrSideDirectionPaddings[pDirectionalComponent->nSide];
+
+ // directional components don't change side paddings, but take them into account
+ pComponent->vecOffset[pDirectionalComponent->nSide & 1U] += ((pDirectionalComponent->nSide < 2U) ? -flSidePadding : flSidePadding);
+
+ // check if the component is in the same direction as the side and it's the first component in this direction
+ if (static_cast(pDirectionalComponent->nDirection) == static_cast(pDirectionalComponent->nSide) && arrDirectionPaddings[pDirectionalComponent->nDirection] == 0.0f)
+ {
+ // accumulate paddings for sub-directions
+ for (std::uint8_t nSubDirection = DIR_LEFT; nSubDirection < DIR_MAX; nSubDirection++)
+ {
+ /*
+ * exclude conflicting sub-directions
+ *
+ * SIDE_LEFT[0]: DIR_LEFT[0], DIR_BOTTOM[3] | ~2 & ~1
+ * SIDE_TOP[1]: DIR_LEFT[0], DIR_TOP[1], DIR_RIGHT[2] | ~3
+ * SIDE_RIGHT[2]: DIR_RIGHT[2], DIR_BOTTOM[3] | ~0 & ~1
+ * SIDE_BOTTOM[3]: DIR_LEFT[0], DIR_RIGHT[2], DIR_BOTTOM[3] | ~1
+ */
+ if (nSubDirection == pDirectionalComponent->nSide || nSubDirection == ((pDirectionalComponent->nSide + 2U) & 3U) || (nSubDirection == DIR_TOP && (pDirectionalComponent->nSide & 1U) == 0U))
+ continue;
+
+ arrDirectionPaddings[nSubDirection] += (pDirectionalComponent->vecSize[nSubDirection == DIR_BOTTOM ? SIDE_TOP : SIDE_LEFT] * (((pDirectionalComponent->nSide & 1U) == 1U) ? 0.5f : 1.0f) + this->flComponentSpacing);
+ }
+ }
+
+ float& flSideDirectionPadding = arrDirectionPaddings[pDirectionalComponent->nDirection];
+
+ // append direction padding to offset
+ pComponent->vecOffset[pDirectionalComponent->nDirection & 1U] += ((pDirectionalComponent->nDirection < 2U) ? -flSideDirectionPadding : flSideDirectionPadding);
+
+ // accumulate direction padding for next component
+ flSideDirectionPadding += pDirectionalComponent->vecSize[pDirectionalComponent->nDirection & 1U];
+
+ // accumulate spacing for next directional components
+ flSideDirectionPadding += this->flComponentSpacing;
+ }
+ else
+ {
+ // append side padding to offset
+ pComponent->vecOffset[pComponent->nSide & 1U] += ((pComponent->nSide < 2U) ? -(flSidePadding + pComponent->vecSize[pComponent->nSide]) : flSidePadding);
+
+ // accumulate side padding for next component
+ flSidePadding += pComponent->vecSize[pComponent->nSide & 1U];
+
+ // accumulate spacing for next components
+ flSidePadding += this->flComponentSpacing;
+ }
+
+ this->vecComponents.push_back(pComponent);
+}
+
+ImVec2 OVERLAY::Context_t::GetTotalDirectionalSize(const EAlignSide nSide) const
+{
+ ImVec2 vecSideSize = {};
+
+ // @todo: we should peek max of bottom + side or top directions at horizontal sides
+ const float(&arrDirectionPaddings)[DIR_MAX] = this->arrSideDirectionPaddings[nSide];
+ for (std::uint8_t nSubDirection = DIR_LEFT; nSubDirection < DIR_MAX; nSubDirection++)
+ vecSideSize[nSubDirection & 1U] += arrDirectionPaddings[nSubDirection];
+
+ return vecSideSize;
+}
+
+void OVERLAY::Context_t::Render(ImDrawList* pDrawList, const ImVec4& vecBox) const
+{
+ bool bCenteredFirstSideDirectional[SIDE_MAX] = {};
+
+ for (CBaseComponent* const pComponent : this->vecComponents)
+ {
+ ImVec2 vecPosition = pComponent->GetBasePosition(vecBox);
+
+ // check if the component is in the side that supports multi-component centering
+ if (pComponent->nSide == SIDE_TOP || pComponent->nSide == SIDE_BOTTOM)
+ {
+ // check if the component is directional
+ if (CBaseDirectionalComponent* const pDirectionalComponent = static_cast(pComponent); pDirectionalComponent->IsDirectional())
+ {
+ const float(&arrDirectionPaddings)[DIR_MAX] = this->arrSideDirectionPaddings[pComponent->nSide];
+
+ // check if the component has horizontal direction
+ if (static_cast(pDirectionalComponent->nDirection) != static_cast(pDirectionalComponent->nSide))
+ // add centering offset to the component's offset
+ pDirectionalComponent->vecOffset.x += (arrDirectionPaddings[DIR_LEFT] - arrDirectionPaddings[DIR_RIGHT]) * 0.5f;
+ // otherwise check if it's the first component in direction as side
+ else if (!bCenteredFirstSideDirectional[pDirectionalComponent->nSide])
+ {
+ // add centering offset to the component's offset
+ pDirectionalComponent->vecOffset.x += (arrDirectionPaddings[DIR_LEFT] - arrDirectionPaddings[DIR_RIGHT]) * 0.5f;
+
+ bCenteredFirstSideDirectional[pDirectionalComponent->nSide] = true;
+ }
+ }
+ }
+
+ // add final component offset to the base position
+ vecPosition += pComponent->vecOffset;
+
+ pComponent->Render(pDrawList, vecPosition);
+ }
+}
+
+#pragma endregion
+
+void OVERLAY::OnFrameStageNotify(CCSPlayerController* pLocalController)
+{
+ // only render when in-game
+ if (!I::Engine->IsConnected() || !I::Engine->IsInGame())
+ return;
+
+ if (!C_GET(bool, Vars.bVisualOverlay))
+ return;
+
+ enum ESortEntityType : int
+ {
+ SORT_ENTITY_NONE = -1,
+ SORT_ENTITY_PLAYER = 0,
+ };
+
+ struct SortEntityObject_t
+ {
+ SortEntityObject_t(C_BaseEntity* pEntity, CBaseHandle hEntity, float flDistance, ESortEntityType nSortType) :
+ pEntity(pEntity), hEntity(hEntity), flDistance(flDistance), nSortType(nSortType) { }
+
+ C_BaseEntity* pEntity;
+ CBaseHandle hEntity;
+ float flDistance;
+ ESortEntityType nSortType;
+ };
+
+ const int nHighestIndex = I::GameResourceService->pGameEntitySystem->GetHighestEntityIndex();
+
+ std::vector vecSortedEntities = {};
+ vecSortedEntities.reserve(nHighestIndex);
+
+ // @note: 0 is resved for world entity 'CWorld'
+ for (int nIndex = 1; nIndex <= nHighestIndex; nIndex++)
+ {
+ C_BaseEntity* pEntity = I::GameResourceService->pGameEntitySystem->Get(nIndex);
+ if (pEntity == nullptr)
+ continue;
+
+ SchemaClassInfoData_t* pClassInfo = nullptr;
+ pEntity->GetSchemaClassInfo(&pClassInfo);
+ if (pClassInfo == nullptr)
+ continue;
+
+ const FNV1A_t uHashedName = FNV1A::Hash(pClassInfo->szName);
+
+ ESortEntityType nEntityType = SORT_ENTITY_NONE;
+ Vector_t vecOrigin = Vector_t();
+
+ if (uHashedName == FNV1A::HashConst("CCSPlayerController"))
+ {
+ nEntityType = SORT_ENTITY_PLAYER;
+ CCSPlayerController* pPlayer = reinterpret_cast(pEntity);
+ if (pPlayer == nullptr)
+ continue;
+
+ vecOrigin = pPlayer->GetPawnOrigin();
+ }
+
+ // only add sortable entities
+ if (nEntityType != SORT_ENTITY_NONE)
+ vecSortedEntities.emplace_back(pEntity, pEntity->GetRefEHandle(), SDK::CameraPosition.DistTo(vecOrigin), nEntityType);
+ }
+
+ // sort entities by distance to draw them from the farthest to the nearest
+ std::ranges::sort(vecSortedEntities.begin(), vecSortedEntities.end(), std::ranges::greater{}, &SortEntityObject_t::flDistance);
+
+ for (auto& [pEntity, hEntity, flDistance, nSortType] : vecSortedEntities)
+ {
+ // if the handle is invalid, skip this entity
+ if (!hEntity.IsValid())
+ continue;
+
+ switch (nSortType)
+ {
+ case SORT_ENTITY_PLAYER:
+ {
+ CCSPlayerController* pPlayer = I::GameResourceService->pGameEntitySystem->Get(hEntity);
+ if (pPlayer == nullptr)
+ break;
+
+ if (!pPlayer->IsPawnAlive())
+ break;
+
+ Player(pLocalController, pPlayer, flDistance);
+
+ break;
+ }
+ default:
+ break;
+ }
+ }
+}
+
+bool OVERLAY::GetEntityBoundingBox(C_CSPlayerPawn* pEntity, ImVec4* pVecOut)
+{
+ CCollisionProperty* pCollision = pEntity->GetCollision();
+ if (pCollision == nullptr)
+ return false;
+
+ CGameSceneNode* pGameSceneNode = pEntity->GetGameSceneNode();
+ if (pGameSceneNode == nullptr)
+ return false;
+
+ CTransform nodeToWorldTransform = pGameSceneNode->GetNodeToWorld();
+ const Matrix3x4_t matTransform = nodeToWorldTransform.quatOrientation.ToMatrix(nodeToWorldTransform.vecPosition);
+
+ const Vector_t vecMins = pCollision->GetMins();
+ const Vector_t vecMaxs = pCollision->GetMaxs();
+
+ pVecOut->x = pVecOut->y = std::numeric_limits::max();
+ pVecOut->z = pVecOut->w = -std::numeric_limits::max();
+
+ for (int i = 0; i < 8; ++i)
+ {
+ const Vector_t vecPoint{
+ i & 1 ? vecMaxs.x : vecMins.x,
+ i & 2 ? vecMaxs.y : vecMins.y,
+ i & 4 ? vecMaxs.z : vecMins.z
+ };
+ ImVec2 vecScreen;
+ if (!D::WorldToScreen(vecPoint.Transform(matTransform), &vecScreen))
+ return false;
+
+ pVecOut->x = MATH::Min(pVecOut->x, vecScreen.x);
+ pVecOut->y = MATH::Min(pVecOut->y, vecScreen.y);
+ pVecOut->z = MATH::Max(pVecOut->z, vecScreen.x);
+ pVecOut->w = MATH::Max(pVecOut->w, vecScreen.y);
+ }
+
+ return true;
+}
+
+void OVERLAY::Player(CCSPlayerController* pLocal, CCSPlayerController* pPlayer, const float flDistance)
+{
+ C_CSPlayerPawn* pLocalPawn = I::GameResourceService->pGameEntitySystem->Get(pLocal->GetPawnHandle());
+ C_CSPlayerPawn* pPlayerPawn = I::GameResourceService->pGameEntitySystem->Get(pPlayer->GetPawnHandle());
+
+ if (pLocalPawn == nullptr || pPlayerPawn == nullptr)
+ return;
+
+ // @note: this is a simple example of how to check if the player is visible
+
+ // initialize trace, construct filterr and initialize ray
+ //GameTrace_t trace = GameTrace_t();
+ //TraceFilter_t filter = TraceFilter_t(0x1C3003, pLocalPawn, nullptr, 4);
+ //Ray_t ray = Ray_t();
+
+ // cast a ray from local player eye positon -> player head bone
+ // @note: would recommend checking for nullptrs
+ //I::GameTraceManager->TraceShape(&ray, pLocalPawn->GetEyePosition(), pPlayerPawn->GetGameSceneNode()->GetSkeletonInstance()->pBoneCache->GetOrigin(6), &filter, &trace);
+ // check if the hit entity is the one we wanted to check and if the trace end point is visible
+ //if (trace.m_pHitEntity != pPlayerPawn || !trace.IsVisible( ))
+ // return;
+
+ bool bIsEnemy = (pLocalPawn->IsOtherEnemy(pPlayerPawn));
+
+ // @note: only enemy overlay for now
+ if (!bIsEnemy)
+ return;
+
+ ImVec4 vecBox = {};
+ if (!GetEntityBoundingBox(pPlayerPawn, &vecBox))
+ return;
+
+ Context_t context;
+
+ if (const auto& frameOverlayConfig = C_GET(FrameOverlayVar_t, Vars.overlayBox); frameOverlayConfig.bEnable)
+ context.AddBoxComponent(D::pDrawListActive, vecBox, 1, frameOverlayConfig.flThickness, frameOverlayConfig.flRounding, frameOverlayConfig.colPrimary, frameOverlayConfig.colOutline);
+
+ if (const auto& nameOverlayConfig = C_GET(TextOverlayVar_t, Vars.overlayName); nameOverlayConfig.bEnable)
+ {
+ const char* szPlayerName = pPlayer->GetPlayerName();
+ context.AddComponent(new CTextComponent(false, SIDE_TOP, DIR_TOP, FONT::pVisual, szPlayerName, Vars.overlayName));
+ }
+
+ if (const auto& healthOverlayConfig = C_GET(BarOverlayVar_t, Vars.overlayHealthBar); healthOverlayConfig.bEnable)
+ {
+ // @note: pPlayerPawn->GetMaxHealth() sometime return 0.f
+ const float flHealthFactor = pPlayerPawn->GetHealth() / 100.f;
+ context.AddComponent(new CBarComponent(false, SIDE_LEFT, vecBox, flHealthFactor, Vars.overlayHealthBar));
+ }
+
+ if (const auto& armorOverlayConfig = C_GET(BarOverlayVar_t, Vars.overlayArmorBar); armorOverlayConfig.bEnable)
+ {
+ const float flArmorFactor = pPlayerPawn->GetArmorValue() / 100.f;
+ context.AddComponent(new CBarComponent(false, SIDE_BOTTOM, vecBox, flArmorFactor, Vars.overlayArmorBar));
+ }
+
+ // render all the context
+ context.Render(D::pDrawListActive, vecBox);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.h b/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.h
new file mode 100644
index 0000000..4533c49
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/features/visuals/overlay.h
@@ -0,0 +1,168 @@
+#pragma once
+
+#include "../../common.h"
+
+// used: draw system
+#include "../../utilities/draw.h"
+
+class CCSPlayerController;
+class C_BaseEntity;
+class C_CSPlayerPawn;
+
+namespace F::VISUALS::OVERLAY
+{
+ enum EAlignSide : std::uint8_t
+ {
+ SIDE_LEFT = 0U,
+ SIDE_TOP,
+ SIDE_RIGHT,
+ SIDE_BOTTOM,
+ SIDE_MAX
+ };
+
+ enum EAlignDirection : std::uint8_t
+ {
+ DIR_LEFT = 0U,
+ DIR_TOP,
+ DIR_RIGHT,
+ DIR_BOTTOM,
+ DIR_MAX = 4U // @todo: rework stuff based on this cuz one component can have only 3 possible directions at same time. vertical side: left & right + top | bottom, horizontal side: top & bottom + left | right
+ };
+
+ class CBaseComponent
+ {
+ public:
+ [[nodiscard]] virtual ImVec2 GetBasePosition(const ImVec4& box) const;
+
+ [[nodiscard]] virtual bool IsDirectional() const
+ {
+ return false;
+ }
+
+ virtual void Render(ImDrawList* pDrawList, const ImVec2& vecPosition) = 0;
+
+ EAlignSide nSide = SIDE_TOP;
+ ImVec2 vecOffset = {};
+ ImVec2 vecSize = {};
+ };
+
+ class CBaseDirectionalComponent : public CBaseComponent
+ {
+ public:
+ [[nodiscard]] ImVec2 GetBasePosition(const ImVec4& box) const final;
+
+ [[nodiscard]] bool IsDirectional() const final
+ {
+ return true;
+ }
+
+ EAlignDirection nDirection = DIR_TOP;
+ };
+
+ class CBarComponent : public CBaseComponent
+ {
+ public:
+ CBarComponent(const bool bIsMenuItem, const EAlignSide nAlignSide, const ImVec4& vecBox, const float flProgressFactor, const std::size_t uOverlayVarIndex);
+
+ void Render(ImDrawList* pDrawList, const ImVec2& vecPosition) final;
+
+ private:
+ bool bIsMenuItem = false;
+ // bar progress
+ float flProgressFactor = 0.0f;
+ // hovered state for context menu
+ bool bIsHovered = false;
+ // config variables
+ std::size_t uOverlayVarIndex = 0ULL;
+ };
+
+ class CTextComponent : public CBaseDirectionalComponent
+ {
+ public:
+ CTextComponent(const bool bIsMenuItem, const EAlignSide nAlignSide, const EAlignDirection nAlignDirection, const ImFont* pFont, const char* szText, const std::size_t uOverlayVarIndex);
+ ~CTextComponent();
+
+ void Render(ImDrawList* pDrawList, const ImVec2& vecPosition) final;
+
+ private:
+ bool bIsMenuItem = false;
+ // font & text for displaying
+ const ImFont* pFont = nullptr;
+ char* szText = nullptr;
+ // hovered state for context menu
+ bool bIsHovered = false;
+ // config variables
+ std::size_t uOverlayVarIndex = 0ULL;
+ };
+
+ /*
+ * overlay component auto-positioning system
+ * @note: was designed to support the reordering of components that can be implemented with minimal effort
+ *
+ * currently supported next sides and sub-directions:
+ *
+ * DIR_TOP
+ * ^
+ * |
+ * DIR_LEFT <-o-> DIR_RIGHT
+ * DIR_LEFT <-o *---------* o-> DIR_RIGHT
+ * | | | |
+ * v | | v
+ * DIR_BOTTOM | | DIR_BOTTOM
+ * | |
+ * DIR_TOP | | DIR_TOP
+ * ^ | | ^
+ * | | | |
+ * o *---------* o
+ * DIR_LEFT <-o-> DIR_RIGHT
+ * |
+ * v
+ * DIR_BOTTOM
+ */
+ struct Context_t
+ {
+ /* @section: special case components */
+ /// add the box component to overlay
+ /// @remarks: current implementation expects this to be first component, it's an immediate rendering component
+ /// @return: if the box component is hovered
+ bool AddBoxComponent(ImDrawList* pDrawList, const ImVec4& vecBox, const int nType, float flThickness, float flRounding, const Color_t& colPrimary, const Color_t& colOutline);
+ /// add the frame component to overlay
+ /// @remarks: current implementation expects this to be added after components that should be inside it, it's an immediate rendering component
+ /// @returns: size constraints of the added frame
+ ImVec4 AddFrameComponent(ImDrawList* pDrawList, const ImVec2& vecScreen, const EAlignSide nSide, const Color_t& colBackground, const float flRounding, const ImDrawFlags nRoundingCorners);
+
+ /* @section: common components */
+ /// add new component to overlay
+ /// @param[in] pComponent pointer to the one of supported component types
+ void AddComponent(CBaseComponent* pComponent);
+
+ /* @section: get */
+ /// @returns: size of the all directional components currently assigned to @a'nSide'
+ [[nodiscard]] ImVec2 GetTotalDirectionalSize(const EAlignSide nSide) const;
+
+ // calculate final position of components and render them
+ void Render(ImDrawList* pDrawList, const ImVec4& vecBox) const;
+
+ private:
+ // storage of all components
+ std::vector vecComponents = {};
+ // additional spacing between components
+ float flComponentSpacing = 1.0f;
+ // summary padding of all align sides
+ float arrSidePaddings[SIDE_MAX] = {};
+ // summary padding for all align directions of all align sides
+ float arrSideDirectionPaddings[SIDE_MAX][DIR_MAX] = {};
+ };
+
+ /* @section: callbacks */
+ void OnFrameStageNotify(CCSPlayerController* pLocalController);
+
+ /* @section: get */
+ /// get bounding box of entity
+ /// @returns: true if entity has collision and all points of box are visible on screen, false otherwise
+ bool GetEntityBoundingBox(C_CSPlayerPawn* pEntity, ImVec4* pVecOut);
+
+ /* @section: main */
+ // draw box, bars, text infos, etc at player position
+ void Player(CCSPlayerController* pLocal, CCSPlayerController* pPlayer, const float flDistance);
+}
diff --git a/examples/cs2-silent-aim-master/cstrike/painter.cpp b/examples/cs2-silent-aim-master/cstrike/painter.cpp
new file mode 100644
index 0000000..d3cd690
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/painter.cpp
@@ -0,0 +1,9 @@
+#include "painter.h"
+#include "core/sdk.h"
+#include "sdk/interfaces/iengineclient.h"
+Painter::Painter()
+{
+}
+
+
+
diff --git a/examples/cs2-silent-aim-master/cstrike/painter.h b/examples/cs2-silent-aim-master/cstrike/painter.h
new file mode 100644
index 0000000..152db80
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/painter.h
@@ -0,0 +1,10 @@
+#pragma once
+#include "utilities/draw.h"
+class Painter
+{
+
+public:
+ Painter();
+ virtual void Draw(ImDrawList* pDrawList) = 0;
+ virtual ~Painter() = default;
+};
diff --git a/examples/cs2-silent-aim-master/cstrike/sdk/const.h b/examples/cs2-silent-aim-master/cstrike/sdk/const.h
new file mode 100644
index 0000000..95f1d79
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/sdk/const.h
@@ -0,0 +1,285 @@
+#pragma once
+
+// @source: master/game/shared/cstrike15/gametypes.h
+#pragma region valve_gametypes
+
+enum EGameType : int
+{
+ GAMETYPE_UNKNOWN = -1,
+ GAMETYPE_CLASSIC,
+ GAMETYPE_GUNGAME,
+ GAMETYPE_TRAINING,
+ GAMETYPE_CUSTOM,
+ GAMETYPE_COOPERATIVE,
+ GAMETYPE_SKIRMISH,
+ GAMETYPE_FREEFORALL
+};
+
+enum EGameMode : int
+{
+ GAMEMODE_UNKNOWN = -1,
+
+ // GAMETYPE_CLASSIC
+ GAMEMODE_CLASSIC_CASUAL = 0,
+ GAMEMODE_CLASSIC_COMPETITIVE,
+ GAMEMODE_CLASSIC_SCRIM_COMPETITIVE2V2,
+ GAMEMODE_CLASSIC_SCRIM_COMPETITIVE5V5,
+
+ // GAMETYPE_GUNGAME
+ GAMEMODE_GUNGAME_PROGRESSIVE = 0,
+ GAMEMODE_GUNGAME_BOMB,
+ GAMEMODE_GUNGAME_DEATHMATCH,
+
+ // GAMETYPE_TRAINING
+ GAMEMODE_TRAINING_DEFAULT = 0,
+
+ // GAMETYPE_CUSTOM
+ GAMEMODE_CUSTOM_DEFAULT = 0,
+
+ // GAMETYPE_COOPERATIVE
+ GAMEMODE_COOPERATIVE_DEFAULT = 0,
+ GAMEMODE_COOPERATIVE_MISSION,
+
+ // GAMETYPE_SKIRMISH
+ GAMEMODE_SKIRMISH_DEFAULT = 0,
+
+ // GAMETYPE_FREEFORALL
+ GAMEMODE_FREEFORALL_SURVIVAL = 0
+};
+
+#pragma endregion
+
+enum ELifeState : int
+{
+ LIFE_ALIVE = 0,
+ LIFE_DYING,
+ LIFE_DEAD,
+ LIFE_RESPAWNABLE,
+ LIFE_DISCARDBODY
+};
+
+enum EFlags : int
+{
+ FL_ONGROUND = (1 << 0), // entity is at rest / on the ground
+ FL_DUCKING = (1 << 1), // player is fully crouched/uncrouched
+ FL_ANIMDUCKING = (1 << 2), // player is in the process of crouching or uncrouching but could be in transition
+ FL_WATERJUMP = (1 << 3), // player is jumping out of water
+ FL_ONTRAIN = (1 << 4), // player is controlling a train, so movement commands should be ignored on client during prediction
+ FL_INRAIN = (1 << 5), // entity is standing in rain
+ FL_FROZEN = (1 << 6), // player is frozen for 3rd-person camera
+ FL_ATCONTROLS = (1 << 7), // player can't move, but keeps key inputs for controlling another entity
+ FL_CLIENT = (1 << 8), // entity is a client (player)
+ FL_FAKECLIENT = (1 << 9), // entity is a fake client, simulated server side; don't send network messages to them
+ FL_INWATER = (1 << 10), // entity is in water
+ FL_FLY = (1 << 11),
+ FL_SWIM = (1 << 12),
+ FL_CONVEYOR = (1 << 13),
+ FL_NPC = (1 << 14),
+ FL_GODMODE = (1 << 15),
+ FL_NOTARGET = (1 << 16),
+ FL_AIMTARGET = (1 << 17),
+ FL_PARTIALGROUND = (1 << 18), // entity is standing on a place where not all corners are valid
+ FL_STATICPROP = (1 << 19), // entity is a static property
+ FL_GRAPHED = (1 << 20),
+ FL_GRENADE = (1 << 21),
+ FL_STEPMOVEMENT = (1 << 22),
+ FL_DONTTOUCH = (1 << 23),
+ FL_BASEVELOCITY = (1 << 24), // entity have applied base velocity this frame
+ FL_WORLDBRUSH = (1 << 25), // entity is not moveable/removeable brush (part of the world, but represented as an entity for transparency or something)
+ FL_OBJECT = (1 << 26),
+ FL_KILLME = (1 << 27), // entity is marked for death and will be freed by the game
+ FL_ONFIRE = (1 << 28),
+ FL_DISSOLVING = (1 << 29),
+ FL_TRANSRAGDOLL = (1 << 30), // entity is turning into client-side ragdoll
+ FL_UNBLOCKABLE_BY_PLAYER = (1 << 31)
+};
+
+enum EEFlags : int
+{
+ EFL_KILLME = (1 << 0),
+ EFL_DORMANT = (1 << 1),
+ EFL_NOCLIP_ACTIVE = (1 << 2),
+ EFL_SETTING_UP_BONES = (1 << 3),
+ EFL_KEEP_ON_RECREATE_ENTITIES = (1 << 4),
+ EFL_DIRTY_SHADOWUPDATE = (1 << 5),
+ EFL_NOTIFY = (1 << 6),
+ EFL_FORCE_CHECK_TRANSMIT = (1 << 7),
+ EFL_BOT_FROZEN = (1 << 8),
+ EFL_SERVER_ONLY = (1 << 9),
+ EFL_NO_AUTO_EDICT_ATTACH = (1 << 10),
+ EFL_DIRTY_ABSTRANSFORM = (1 << 11),
+ EFL_DIRTY_ABSVELOCITY = (1 << 12),
+ EFL_DIRTY_ABSANGVELOCITY = (1 << 13),
+ EFL_DIRTY_SURROUNDING_COLLISION_BOUNDS = (1 << 14),
+ EFL_DIRTY_SPATIAL_PARTITION = (1 << 15),
+ EFL_HAS_PLAYER_CHILD = (1 << 16),
+ EFL_IN_SKYBOX = (1 << 17),
+ EFL_USE_PARTITION_WHEN_NOT_SOLID = (1 << 18),
+ EFL_TOUCHING_FLUID = (1 << 19),
+ EFL_IS_BEING_LIFTED_BY_BARNACLE = (1 << 20),
+ EFL_NO_ROTORWASH_PUSH = (1 << 21),
+ EFL_NO_THINK_FUNCTION = (1 << 22),
+ EFL_NO_GAME_PHYSICS_SIMULATION = (1 << 23),
+ EFL_CHECK_UNTOUCH = (1 << 24),
+ EFL_DONTBLOCKLOS = (1 << 25),
+ EFL_DONTWALKON = (1 << 26),
+ EFL_NO_DISSOLVE = (1 << 27),
+ EFL_NO_MEGAPHYSCANNON_RAGDOLL = (1 << 28),
+ EFL_NO_WATER_VELOCITY_CHANGE = (1 << 29),
+ EFL_NO_PHYSCANNON_INTERACTION = (1 << 30),
+ EFL_NO_DAMAGE_FORCES = (1 << 31)
+};
+
+enum EMoveType : int
+{
+ MOVETYPE_NONE = 0,
+ MOVETYPE_ISOMETRIC,
+ MOVETYPE_WALK,
+ MOVETYPE_STEP,
+ MOVETYPE_FLY, // no gravity, but still collides with stuff
+ MOVETYPE_FLYGRAVITY, // flies through the air and is affected by gravity
+ MOVETYPE_VPHYSICS,
+ MOVETYPE_PUSH, // no clip to world, push and crush
+ MOVETYPE_NOCLIP, // no gravity, no collisions, still do velocity/absvelocity
+ MOVETYPE_LADDER,
+ MOVETYPE_OBSERVER, // observer movement, depends on player's observer mode
+ MOVETYPE_CUSTOM,
+ MOVETYPE_LAST = MOVETYPE_CUSTOM,
+ MOVETYPE_MAX_BITS = 4
+};
+
+// identifies how submerged in water a player is
+enum : int
+{
+ WL_NOTINWATER = 0,
+ WL_FEET,
+ WL_WAIST,
+ WL_EYES
+};
+
+enum ETeamID : int
+{
+ TEAM_UNK,
+ TEAM_SPECTATOR,
+ TEAM_TT,
+ TEAM_CT
+};
+
+using ItemDefinitionIndex_t = std::uint16_t;
+enum EItemDefinitionIndexes : ItemDefinitionIndex_t
+{
+ WEAPON_NONE,
+ WEAPON_DESERT_EAGLE,
+ WEAPON_DUAL_BERETTAS,
+ WEAPON_FIVE_SEVEN,
+ WEAPON_GLOCK_18,
+ WEAPON_AK_47 = 7,
+ WEAPON_AUG,
+ WEAPON_AWP,
+ WEAPON_FAMAS,
+ WEAPON_G3SG1,
+ WEAPON_GALIL_AR = 13,
+ WEAPON_M249,
+ WEAPON_M4A4 = 16,
+ WEAPON_MAC_10,
+ WEAPON_P90 = 19,
+ WEAPON_REPULSOR_DEVICE,
+ WEAPON_MP5_SD = 23,
+ WEAPON_UMP_45,
+ WEAPON_XM1014,
+ WEAPON_PP_BIZON,
+ WEAPON_MAG_7,
+ WEAPON_NEGEV,
+ WEAPON_SAWED_OFF,
+ WEAPON_TEC_9,
+ WEAPON_ZEUS_X27,
+ WEAPON_P2000,
+ WEAPON_MP7,
+ WEAPON_MP9,
+ WEAPON_NOVA,
+ WEAPON_P250,
+ WEAPON_RIOT_SHIELD,
+ WEAPON_SCAR_20,
+ WEAPON_SG_553,
+ WEAPON_SSG_08,
+ WEAPON_KNIFE0,
+ WEAPON_KNIFE1,
+ WEAPON_FLASHBANG,
+ WEAPON_HIGH_EXPLOSIVE_GRENADE,
+ WEAPON_SMOKE_GRENADE,
+ WEAPON_MOLOTOV,
+ WEAPON_DECOY_GRENADE,
+ WEAPON_INCENDIARY_GRENADE,
+ WEAPON_C4_EXPLOSIVE,
+ WEAPON_KEVLAR_VEST,
+ WEAPON_KEVLAR_and_HELMET,
+ WEAPON_HEAVY_ASSAULT_SUIT,
+ WEAPON_NO_LOCALIZED_NAME0 = 54,
+ WEAPON_DEFUSE_KIT,
+ WEAPON_RESCUE_KIT,
+ WEAPON_MEDI_SHOT,
+ WEAPON_MUSIC_KIT,
+ WEAPON_KNIFE2,
+ WEAPON_M4A1_S,
+ WEAPON_USP_S,
+ WEAPON_TRADE_UP_CONTRACT,
+ WEAPON_CZ75_AUTO,
+ WEAPON_R8_REVOLVER,
+ WEAPON_TACTICAL_AWARENESS_GRENADE = 68,
+ WEAPON_BARE_HANDS,
+ WEAPON_BREACH_CHARGE,
+ WEAPON_TABLET = 72,
+ WEAPON_KNIFE3 = 74,
+ WEAPON_AXE,
+ WEAPON_HAMMER,
+ WEAPON_WRENCH = 78,
+ WEAPON_SPECTRAL_SHIV = 80,
+ WEAPON_FIRE_BOMB,
+ WEAPON_DIVERSION_DEVICE,
+ WEAPON_FRAG_GRENADE,
+ WEAPON_SNOWBALL,
+ WEAPON_BUMP_MINE,
+ WEAPON_BAYONET = 500,
+ WEAPON_CLASSIC_KNIFE = 503,
+ WEAPON_FLIP_KNIFE = 505,
+ WEAPON_GUT_KNIFE,
+ WEAPON_KARAMBIT,
+ WEAPON_M9_BAYONET,
+ WEAPON_HUNTSMAN_KNIFE,
+ WEAPON_FALCHION_KNIFE = 512,
+ WEAPON_BOWIE_KNIFE = 514,
+ WEAPON_BUTTERFLY_KNIFE,
+ WEAPON_SHADOW_DAGGERS,
+ WEAPON_PARACORD_KNIFE,
+ WEAPON_SURVIVAL_KNIFE,
+ WEAPON_URSUS_KNIFE,
+ WEAPON_NAVAJA_KNIFE,
+ WEAPON_NOMAD_KNIFE,
+ WEAPON_STILETTO_KNIFE,
+ WEAPON_TALON_KNIFE,
+ WEAPON_SKELETON_KNIFE = 525,
+};
+
+enum EWeaponType : std::uint32_t
+{
+ WEAPONTYPE_KNIFE = 0,
+ WEAPONTYPE_PISTOL = 1,
+ WEAPONTYPE_SUBMACHINEGUN = 2,
+ WEAPONTYPE_RIFLE = 3,
+ WEAPONTYPE_SHOTGUN = 4,
+ WEAPONTYPE_SNIPER_RIFLE = 5,
+ WEAPONTYPE_MACHINEGUN = 6,
+ WEAPONTYPE_C4 = 7,
+ WEAPONTYPE_TASER = 8,
+ WEAPONTYPE_GRENADE = 9,
+ WEAPONTYPE_EQUIPMENT = 10,
+ WEAPONTYPE_STACKABLEITEM = 11,
+ WEAPONTYPE_FISTS = 12,
+ WEAPONTYPE_BREACHCHARGE = 13,
+ WEAPONTYPE_BUMPMINE = 14,
+ WEAPONTYPE_TABLET = 15,
+ WEAPONTYPE_MELEE = 16,
+ WEAPONTYPE_SHIELD = 17,
+ WEAPONTYPE_ZONE_REPULSOR = 18,
+ WEAPONTYPE_UNKNOWN = 19
+};
diff --git a/examples/cs2-silent-aim-master/cstrike/sdk/datatypes/color.h b/examples/cs2-silent-aim-master/cstrike/sdk/datatypes/color.h
new file mode 100644
index 0000000..4f6caa9
--- /dev/null
+++ b/examples/cs2-silent-aim-master/cstrike/sdk/datatypes/color.h
@@ -0,0 +1,232 @@
+#pragma once
+// used: [crt] fmodf
+#include
+// used: bit_cast
+#include
+
+#include "../../common.h"
+// used: swap
+#include "../../utilities/crt.h"
+// used: [ext] imu32
+#include "../../../dependencies/imgui/imgui.h"
+
+enum
+{
+ COLOR_R = 0,
+ COLOR_G = 1,
+ COLOR_B = 2,
+ COLOR_A = 3
+};
+
+struct ColorRGBExp32
+{
+ std::uint8_t r, g, b;
+ std::int8_t iExponent;
+};
+
+static_assert(sizeof(ColorRGBExp32) == 0x4);
+
+struct Color_t
+{
+ Color_t() = default;
+
+ // 8-bit color constructor (in: [0 .. 255])
+ constexpr Color_t(const std::uint8_t r, const std::uint8_t g, const std::uint8_t b, const std::uint8_t a = 255) :
+ r(r), g(g), b(b), a(a) { }
+
+ // 8-bit color constructor (in: [0 .. 255])
+ constexpr Color_t(const int r, const int g, const int b, const int a = 255) :
+ r(static_cast(r)), g(static_cast(g)), b(static_cast(b)), a(static_cast(a)) { }
+
+ // 8-bit array color constructor (in: [0.0 .. 1.0])
+ explicit constexpr Color_t(const std::uint8_t arrColor[4]) :
+ r(arrColor[COLOR_R]), g(arrColor[COLOR_G]), b(arrColor[COLOR_B]), a(arrColor[COLOR_A]) { }
+
+ // 32-bit packed color constructor (in: 0x00000000 - 0xFFFFFFFF)
+ explicit constexpr Color_t(const ImU32 uPackedColor) :
+ r(static_cast((uPackedColor >> IM_COL32_R_SHIFT) & 0xFF)), g(static_cast((uPackedColor >> IM_COL32_G_SHIFT) & 0xFF)), b(static_cast((uPackedColor >> IM_COL32_B_SHIFT) & 0xFF)), a(static_cast((uPackedColor >> IM_COL32_A_SHIFT) & 0xFF)) { }
+
+ // 32-bit color constructor (in: [0.0 .. 1.0])
+ constexpr Color_t(const float r, const float g, const float b, const float a = 1.0f) :
+ r(static_cast(r * 255.f)), g(static_cast(g * 255.f)), b(static_cast(b * 255.f)), a(static_cast(a * 255.f)) { }
+
+ /// @returns: 32-bit packed integer representation of color
+ [[nodiscard]] constexpr ImU32 GetU32(const float flAlphaMultiplier = 1.0f) const
+ {
+ return IM_COL32(r, g, b, a * flAlphaMultiplier);
+ }
+
+ /// @return: converted color to imgui vector
+ [[nodiscard]] ImVec4 GetVec4(const float flAlphaMultiplier = 1.0f) const
+ {
+ return ImVec4(this->Base(), this->Base(), this->Base(), this->Base() * flAlphaMultiplier);
+ }
+
+ std::uint8_t& operator[](const std::uint8_t nIndex)
+ {
+ CS_ASSERT(nIndex <= COLOR_A); // given index is out of range
+ return reinterpret_cast(this)[nIndex];
+ }
+
+ const std::uint8_t& operator[](const std::uint8_t nIndex) const
+ {
+ CS_ASSERT(nIndex <= COLOR_A); // given index is out of range
+ return reinterpret_cast(this)[nIndex];
+ }
+
+ bool operator==(const Color_t& colSecond) const
+ {
+ return (std::bit_cast(*this) == std::bit_cast(colSecond));
+ }
+
+ bool operator!=(const Color_t& colSecond) const
+ {
+ return (std::bit_cast(*this) != std::bit_cast(colSecond));
+ }
+
+ /// @returns: copy of color with certain R/G/B/A component changed to given value
+ template
+ [[nodiscard]] Color_t Set(const std::uint8_t nValue) const
+ {
+ static_assert(N >= COLOR_R && N <= COLOR_A, "color component index is out of range");
+
+ Color_t colCopy = *this;
+ colCopy[N] = nValue;
+ return colCopy;
+ }
+
+ /// @returns: copy of color with certain R/G/B/A component multiplied by given value
+ template
+ [[nodiscard]] Color_t Multiplier(const float flValue) const
+ {
+ static_assert(N >= COLOR_R && N <= COLOR_A, "color component index is out of range");
+
+ Color_t colCopy = *this;
+ colCopy[N] = static_cast(static_cast(colCopy[N]) * flValue);
+ return colCopy;
+ }
+
+ /// @returns: copy of color with certain R/G/B/A component divided by given value
+ template
+ [[nodiscard]] Color_t Divider(const int iValue) const
+ {
+ static_assert(N >= COLOR_R && N <= COLOR_A, "color component index is out of range");
+
+ Color_t colCopy = *this;
+ colCopy[N] /= iValue;
+ return colCopy;
+ }
+
+ /// @returns: certain R/G/B/A float value (in: [0 .. 255], out: [0.0 .. 1.0])
+ template
+ [[nodiscard]] float Base() const
+ {
+ static_assert(N >= COLOR_R && N <= COLOR_A, "color component index is out of range");
+ return reinterpret_cast