Skip to content

Commit 26b5724

Browse files
committed
antiflash
1 parent 82337fd commit 26b5724

File tree

8 files changed

+22
-1
lines changed

8 files changed

+22
-1
lines changed

TempleWare-CS2/TempleWare-CS2.vcxproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@
171171
<ClCompile Include="source\cs2\entity\C_CSWeaponBase\C_CSWeaponBase.cpp" />
172172
<ClCompile Include="source\templeware\features\aim\aim.cpp" />
173173
<ClCompile Include="source\templeware\features\chams\chams.cpp" />
174+
<ClCompile Include="source\templeware\features\visuals\antiflash\antiflash.cpp" />
174175
<ClCompile Include="source\templeware\features\visuals\fov\fov.cpp" />
175176
<ClCompile Include="source\templeware\interfaces\CGameEntitySystem\CGameEntitySystem.cpp" />
176177
<ClCompile Include="source\templeware\interfaces\interfaces.cpp" />

TempleWare-CS2/source/templeware/config/config.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ namespace Config {
3939
bool fovEnabled = false;
4040
float fov = 90.0f;
4141

42+
bool antiflash = false;
43+
4244
ImVec4 NightColor = ImVec4(0.1, 0.1, 0.1, 1);
4345

4446
bool aimbot = 0;

TempleWare-CS2/source/templeware/config/config.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ namespace Config {
3838
extern bool fovEnabled;
3939
extern float fov;
4040

41+
extern bool antiflash;
42+
4143
extern bool Night;
4244

4345
extern bool aimbot;

TempleWare-CS2/source/templeware/config/configmanager.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ namespace internal_config
116116

117117
j["aimbot"] = Config::aimbot;
118118
j["aimbot_fov"] = Config::aimbot_fov;
119+
j["antiflash"] = Config::antiflash;
119120
j["rcs"] = Config::rcs;
120121
j["fov_circle"] = Config::fov_circle;
121122

@@ -217,6 +218,8 @@ namespace internal_config
217218
Config::rcs = j.value("rcs", false);
218219
Config::aimbot_fov = j.value("aimbot_fov", 0.f);
219220

221+
Config::antiflash = j.value("antiflash", false);
222+
220223
Config::armChams = j.value("armChams", false);
221224
Config::viewmodelChams = j.value("viewmodelChams", false);
222225

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include "../../../hooks/hooks.h"
2+
#include "../../../config/config.h"
3+
4+
void __fastcall H::hkRenderFlashbangOverlay(void* a1, void* a2, void* a3, void* a4, void* a5) {
5+
if (Config::antiflash) return;
6+
return RenderFlashBangOverlay.GetOriginal()(a1, a2, a3, a4, a5);
7+
}

TempleWare-CS2/source/templeware/hooks/hooks.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ void H::Hooks::init() {
5050
DrawArray.Add((void*)M::patternScan("scenesystem", ("48 8B C4 48 89 50 10 53 41 55 41 56 48 81 EC ? ? ? ? 4D 63 F1")), &chams::hook);
5151
GetRenderFov.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? F3 0F 11 45 00 48 8B 5C 24 40"), 1), &hkGetRenderFov);
5252
LevelInit.Add((void*)M::getAbsoluteAddress(M::patternScan("client", "E8 ? ? ? ? C6 83 ? ? ? ? ? C6 83"), 1), &hkLevelInit);
53+
RenderFlashBangOverlay.Add((void*)M::patternScan("client", ("85 D2 0F 88 ? ? ? ? 55 56 41 55")), &hkRenderFlashbangOverlay);
5354

5455
MH_EnableHook(MH_ALL_HOOKS);
5556
}

TempleWare-CS2/source/templeware/hooks/hooks.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,17 @@ namespace H {
1515
void __fastcall hkFrameStageNotify(void* a1, int stage);
1616
void* __fastcall hkLevelInit(void* pClientModeShared, const char* szNewMap);
1717
void __fastcall hkChamsObject(void* pAnimatableSceneObjectDesc, void* pDx11, CMeshData* arrMeshDraw, int nDataCount, void* pSceneView, void* pSceneLayer, void* pUnk, void* pUnk2);
18+
void __fastcall hkRenderFlashbangOverlay(void* a1, void* a2, void* a3, void* a4, void* a5);
1819
inline float g_flActiveFov;
1920
float hkGetRenderFov(void* rcx);
2021

21-
inline CInlineHookObj<decltype(&hkChamsObject)> DrawArray = {};
22+
inline CInlineHookObj<decltype(&hkChamsObject)> DrawArray = { };
2223
inline CInlineHookObj<decltype(&hkFrameStageNotify)> FrameStageNotify = { };
2324
inline CInlineHookObj<decltype(&hkUpdateSceneObject)> UpdateWallsObject = { };
2425
inline CInlineHookObj<decltype(&hkGetRenderFov)> GetRenderFov = { };
2526
inline CInlineHookObj<decltype(&hkLevelInit)> LevelInit = { };
27+
inline CInlineHookObj<decltype(&hkRenderFlashbangOverlay)> RenderFlashBangOverlay = { };
28+
2629
// inline hooks
2730
inline int oGetWeaponData;
2831
inline void* (__fastcall* ogGetBaseEntity)(void*, int);

TempleWare-CS2/source/templeware/menu/menu.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,8 @@ void Menu::render() {
167167
ImGui::Separator();
168168

169169
if (ImGui::CollapsingHeader("Player")) {
170+
ImGui::Checkbox("Antiflash##antiflashcheckbox", &Config::antiflash);
171+
170172
ImGui::Checkbox("Fov##FovCheckbox", &Config::fovEnabled);
171173
if (Config::fovEnabled) {
172174
ImGui::SliderFloat("##FovSlider", &Config::fov, 20.0f, 160.0f, "%1.0f");

0 commit comments

Comments
 (0)