Skip to content

Commit a6449bc

Browse files
committed
Revert "Merge pull request #13 from ByteCorum/main"
This reverts commit ebbe4c3, reversing changes made to b868efd.
1 parent ebbe4c3 commit a6449bc

File tree

19 files changed

+191
-195
lines changed

19 files changed

+191
-195
lines changed

.github/workflows/build-check.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ jobs:
1818

1919
- name: Building project
2020
run: |
21-
msbuild TempleWare-External.sln -t:Rebuild -p:Configuration=Release -p:Platform=x64
21+
msbuild CS2-External-Base.sln -t:Rebuild -p:Configuration=Release -p:Platform=x64
2222
2323
- name: Archive artifacts
2424
uses: actions/upload-artifact@v4
2525
with:
2626
name: Compiled-Binaries
2727
path: |
28-
D:\a\TempleWare-External\x64\Release\TempleWare-External.exe
28+
D:\a\CS2-External-Base\x64\Release\CS2-External-Base.exe

TempleWare-External/source/features/bhop.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ namespace features
1414
return;
1515

1616
HWND hwnd_cs2 = FindWindowA(NULL, "Counter-Strike 2");
17-
if (hwnd_cs2 == NULL)
17+
if (hwnd_cs2 == NULL) {
1818
hwnd_cs2 = FindWindowA(NULL, "Counter-Strike 2");
19+
}
1920

2021
bool spacePressed = GetAsyncKeyState(VK_SPACE);
2122
int flags = memory.Read<std::uintptr_t>(localPlayer + offsets::m_fFlags);
@@ -26,9 +27,14 @@ namespace features
2627
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
2728
SendMessage(hwnd_cs2, WM_KEYDOWN, VK_SPACE, 0);
2829
}
30+
2931
else if (spacePressed && !isInAir)
32+
{
3033
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
34+
}
3135
else if (!spacePressed)
36+
{
3237
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
38+
}
3339
}
3440
}

TempleWare-External/source/features/bhop.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,5 @@ namespace features
1010
{
1111
public:
1212
static void Run(const Memory& memory) noexcept;
13-
1413
};
1514
}

TempleWare-External/source/features/fov.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,21 @@
22
#include "../globals/globals.h"
33
#include "../offsets/offsets.h"
44

5-
namespace features
6-
{
7-
void FOVManager::AdjustFOV(const Memory& memory) noexcept
8-
{
5+
namespace features {
6+
void FOVManager::AdjustFOV(const Memory& memory) noexcept {
97
std::uintptr_t localPlayer = memory.Read<std::uintptr_t>(globals::client + offsets::dwLocalPlayerPawn);
10-
if (!localPlayer)
11-
return;
8+
if (!localPlayer) return;
129

1310
std::uintptr_t cameraServices = memory.Read<std::uintptr_t>(localPlayer + offsets::m_pCameraServices);
14-
if (!cameraServices)
15-
return;
11+
if (!cameraServices) return;
1612

1713
std::uint16_t currentFov = memory.Read<std::uint16_t>(cameraServices + offsets::m_iFOV);
1814
bool isScoped = memory.Read<bool>(localPlayer + offsets::m_bIsScoped);
15+
1916
std::uint16_t desiredFov = static_cast<uint16_t>(globals::FOV);
2017

21-
if (!isScoped && currentFov != desiredFov)
18+
if (!isScoped && currentFov != desiredFov) {
2219
memory.Write<uint16_t>(cameraServices + offsets::m_iFOV, desiredFov);
20+
}
2321
}
2422
}

TempleWare-External/source/features/fov.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
#include "../memory/Memory.h"
44

5-
namespace features
6-
{
7-
class FOVManager
8-
{
5+
namespace features {
6+
class FOVManager {
97
public:
108
static void AdjustFOV(const Memory& memory) noexcept;
11-
129
};
1310
}

TempleWare-External/source/features/glow.cpp

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,8 @@
33
#include "../offsets/offsets.h"
44
#include <thread>
55

6-
namespace features
7-
{
8-
9-
uintptr_t GetEntityInListOffset(int index)
10-
{
11-
return 0x8 * (index & 0x7FFF) >> 9 + 16;
12-
}
13-
14-
DWORD PackColor(const ImVec4& color)
15-
{
16-
return ((DWORD)(color.w * 255) << 24) |
17-
((DWORD)(color.z * 255) << 16) |
18-
((DWORD)(color.y * 255) << 8) |
19-
(DWORD)(color.x * 255);
20-
}
21-
22-
void Glow::Run(const Memory& memory) noexcept
23-
{
6+
namespace features {
7+
void Glow::Run(const Memory& memory) noexcept {
248
if (!globals::Glow)
259
return;
2610

@@ -30,37 +14,47 @@ namespace features
3014

3115
int localTeam = memory.Read<int>(localPlayerController + offsets::m_iTeamNum);
3216

33-
34-
for (int i = 1; i < 64; ++i)
35-
{
17+
for (int i = 1; i < 64; i++) {
3618
uintptr_t entityList = memory.Read<uintptr_t>(globals::client + offsets::dwEntityList);
3719
if (!entityList)
3820
continue;
3921

40-
uintptr_t entity = memory.Read<uintptr_t>(entityList + GetEntityInListOffset(i));
41-
if (!entity)
22+
uintptr_t listEntry = memory.Read<uintptr_t>(entityList + (8 * (i & 0x7FFF) >> 9) + 16);
23+
if (!listEntry)
4224
continue;
4325

44-
int entityTeam = memory.Read<int>(entity + offsets::m_iTeamNum);
45-
if (entityTeam == localTeam)
26+
uintptr_t player = memory.Read<uintptr_t>(listEntry + 120 * (i & 0x1FF));
27+
if (!player)
4628
continue;
4729

48-
uint32_t playerPawn = memory.Read<uint32_t>(entity + offsets::m_hPlayerPawn);
30+
int playerTeam = memory.Read<int>(player + offsets::m_iTeamNum);
31+
if (playerTeam == localTeam)
32+
continue;
33+
34+
uint32_t playerPawn = memory.Read<uint32_t>(player + offsets::m_hPlayerPawn);
4935
if (!playerPawn)
5036
continue;
5137

52-
uintptr_t playerCsPawn = memory.Read<uintptr_t>(entityList + GetEntityInListOffset(playerPawn));
38+
uintptr_t listEntry2 = memory.Read<uintptr_t>(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
39+
if (!listEntry2)
40+
continue;
41+
42+
uintptr_t playerCsPawn = memory.Read<uintptr_t>(listEntry2 + 120 * (playerPawn & 0x1FF));
5343
if (!playerCsPawn)
5444
continue;
5545

5646
int health = memory.Read<int>(playerCsPawn + offsets::m_iHealth);
5747
if (health < 1)
5848
continue;
5949

60-
61-
6250
ImVec4 color = globals::GlowColor;
63-
DWORD colorArgb = PackColor(color);
51+
DWORD colorArgb = (
52+
((DWORD)(color.w * 255) << 24) |
53+
((DWORD)(color.z * 255) << 16) |
54+
((DWORD)(color.y * 255) << 8) |
55+
(DWORD)(color.x * 255)
56+
);
57+
6458
memory.Write<DWORD64>(playerCsPawn + offsets::m_Glow + offsets::m_glowColorOverride, colorArgb);
6559
memory.Write<DWORD64>(playerCsPawn + offsets::m_Glow + offsets::m_bGlowing, 1);
6660
}

TempleWare-External/source/features/glow.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
#include "../memory/memory.h"
44

5-
namespace features
6-
{
7-
class Glow
8-
{
5+
namespace features {
6+
class Glow {
97
public:
108
static void Run(const Memory& memory) noexcept;
11-
129
};
1310
}

TempleWare-External/source/features/noflash.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,16 @@
22
#include "../globals/globals.h"
33
#include "../offsets/offsets.h"
44

5-
namespace features
6-
{
7-
8-
void NoFlash::Run(const Memory& memory) noexcept
9-
{
10-
if (globals::NoFlashEnabled)
11-
{
5+
namespace features {
6+
void NoFlash::Run(const Memory& memory) noexcept {
7+
if (globals::NoFlashEnabled) {
128
std::uintptr_t localPlayer = memory.Read<std::uintptr_t>(globals::client + offsets::dwLocalPlayerPawn);
13-
14-
if (localPlayer)
15-
{
9+
if (localPlayer) {
1610
float flashDuration = memory.Read<float>(localPlayer + offsets::flFlashDuration);
17-
if (flashDuration > 0.0f)
11+
if (flashDuration > 0.0f) {
1812
memory.Write<float>(localPlayer + offsets::flFlashDuration, 0.0f);
13+
}
1914
}
2015
}
2116
}
22-
2317
}

TempleWare-External/source/features/noflash.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22

33
#include "../memory/Memory.h"
44

5-
namespace features
6-
{
7-
class NoFlash
8-
{
5+
namespace features {
6+
class NoFlash {
97
public:
108
static void Run(const Memory& memory) noexcept;
11-
129
};
1310
}

TempleWare-External/source/features/triggerbot.cpp

Lines changed: 27 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,29 @@
44
#include <thread>
55
#include <Windows.h>
66

7-
namespace features
8-
{
7+
namespace features {
98
void TriggerBot::Run(const Memory& memory) noexcept {
10-
while (globals::isRunning)
11-
{
12-
if (!globals::TriggerBot)
13-
{
9+
while (globals::isRunning) {
10+
if (!globals::TriggerBot) {
1411
std::this_thread::sleep_for(std::chrono::milliseconds(20));
1512
continue;
1613
}
1714

18-
bool keyDown = (GetAsyncKeyState(globals::TriggerBotKey) & 0x8000) != 0;
19-
if (globals::TriggerBotMode == 0)
20-
{
21-
if (!keyDown)
22-
{
15+
bool keyState = GetAsyncKeyState(globals::TriggerBotKey) & 0x8000;
16+
17+
if (globals::TriggerBotMode == 0) {
18+
if (!keyState) {
2319
std::this_thread::sleep_for(std::chrono::milliseconds(10));
2420
continue;
2521
}
2622
}
27-
else if (globals::TriggerBotMode == 1)
28-
{
29-
if (keyDown)
30-
{
23+
else if (globals::TriggerBotMode == 1) {
24+
if (keyState) {
3125
globals::TriggerBotToggled = !globals::TriggerBotToggled;
3226
std::this_thread::sleep_for(std::chrono::milliseconds(200));
3327
}
3428

35-
if (!globals::TriggerBotToggled)
36-
{
29+
if (!globals::TriggerBotToggled) {
3730
std::this_thread::sleep_for(std::chrono::milliseconds(10));
3831
continue;
3932
}
@@ -42,8 +35,7 @@ namespace features
4235
std::uintptr_t localPlayer = memory.Read<std::uintptr_t>(globals::client + offsets::dwLocalPlayerPawn);
4336
BYTE team = memory.Read<BYTE>(localPlayer + offsets::m_iTeamNum);
4437

45-
if (!globals::TriggerBotIgnoreFlash)
46-
{
38+
if (!globals::TriggerBotIgnoreFlash) {
4739
float flashDuration = memory.Read<float>(localPlayer + offsets::flFlashDuration);
4840
if (flashDuration > 0.0f) {
4941
std::this_thread::sleep_for(std::chrono::milliseconds(10));
@@ -52,25 +44,32 @@ namespace features
5244
}
5345

5446
int crosshairEntityIndex = memory.Read<int>(localPlayer + offsets::m_iIDEntIndex);
55-
if (crosshairEntityIndex == 0)
47+
if (crosshairEntityIndex == 0) {
5648
continue;
49+
}
5750

5851
std::uintptr_t entityList = memory.Read<std::uintptr_t>(globals::client + offsets::dwEntityList);
59-
std::uintptr_t entity = memory.Read<std::uintptr_t>(memory.Read<std::uintptr_t>(entityList + 0x8 * (crosshairEntityIndex >> 9) + 0x10) + 120 * (crosshairEntityIndex & 0x1ff));
60-
if (!entity)
52+
std::uintptr_t listEntry = memory.Read<std::uintptr_t>(entityList + 0x8 * (crosshairEntityIndex >> 9) + 0x10);
53+
std::uintptr_t entity = memory.Read<std::uintptr_t>(listEntry + 120 * (crosshairEntityIndex & 0x1ff));
54+
55+
if (!entity) {
6156
continue;
57+
}
6258

63-
// Skip teammate or dead target (optional)
64-
if (globals::TriggerBotTeamCheck && team == memory.Read<BYTE>(entity + offsets::m_iTeamNum))
59+
if (globals::TriggerBotTeamCheck && team == memory.Read<BYTE>(entity + offsets::m_iTeamNum)) {
6560
continue;
61+
}
6662

67-
if (memory.Read<int>(entity + offsets::m_iHealth) <= 0)
63+
if (memory.Read<int>(entity + offsets::m_iHealth) <= 0) {
6864
continue;
65+
}
66+
67+
memory.Write<int>(globals::client + offsets::attack, 65537);
6968

70-
// Simulate shooting
71-
memory.Write<int>(globals::client + offsets::attack, 65537); // Set attack command
7269
std::this_thread::sleep_for(std::chrono::milliseconds(globals::TriggerBotDelay));
73-
memory.Write<int>(globals::client + offsets::attack, 256); // Clear attack command
70+
71+
memory.Write<int>(globals::client + offsets::attack, 256);
72+
7473
std::this_thread::sleep_for(std::chrono::milliseconds(globals::TriggerBotDelay));
7574
}
7675
}

0 commit comments

Comments
 (0)