Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ jobs:

- name: Building project
run: |
msbuild CS2-External-Base.sln -t:Rebuild -p:Configuration=Release -p:Platform=x64
msbuild TempleWare-External.sln -t:Rebuild -p:Configuration=Release -p:Platform=x64

- name: Archive artifacts
uses: actions/upload-artifact@v4
with:
name: Compiled-Binaries
path: |
D:\a\CS2-External-Base\x64\Release\CS2-External-Base.exe
D:\a\TempleWare-External\x64\Release\TempleWare-External.exe
8 changes: 1 addition & 7 deletions TempleWare-External/source/features/bhop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,8 @@ namespace features
return;

HWND hwnd_cs2 = FindWindowA(NULL, "Counter-Strike 2");
if (hwnd_cs2 == NULL) {
if (hwnd_cs2 == NULL)
hwnd_cs2 = FindWindowA(NULL, "Counter-Strike 2");
}

bool spacePressed = GetAsyncKeyState(VK_SPACE);
int flags = memory.Read<std::uintptr_t>(localPlayer + offsets::m_fFlags);
Expand All @@ -27,14 +26,9 @@ namespace features
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
SendMessage(hwnd_cs2, WM_KEYDOWN, VK_SPACE, 0);
}

else if (spacePressed && !isInAir)
{
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
}
else if (!spacePressed)
{
SendMessage(hwnd_cs2, WM_KEYUP, VK_SPACE, 0);
}
}
}
1 change: 1 addition & 0 deletions TempleWare-External/source/features/bhop.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ namespace features
{
public:
static void Run(const Memory& memory) noexcept;

};
}
16 changes: 9 additions & 7 deletions TempleWare-External/source/features/fov.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,23 @@
#include "../globals/globals.h"
#include "../offsets/offsets.h"

namespace features {
void FOVManager::AdjustFOV(const Memory& memory) noexcept {
namespace features
{
void FOVManager::AdjustFOV(const Memory& memory) noexcept
{
std::uintptr_t localPlayer = memory.Read<std::uintptr_t>(globals::client + offsets::dwLocalPlayerPawn);
if (!localPlayer) return;
if (!localPlayer)
return;

std::uintptr_t cameraServices = memory.Read<std::uintptr_t>(localPlayer + offsets::m_pCameraServices);
if (!cameraServices) return;
if (!cameraServices)
return;

std::uint16_t currentFov = memory.Read<std::uint16_t>(cameraServices + offsets::m_iFOV);
bool isScoped = memory.Read<bool>(localPlayer + offsets::m_bIsScoped);

std::uint16_t desiredFov = static_cast<uint16_t>(globals::FOV);

if (!isScoped && currentFov != desiredFov) {
if (!isScoped && currentFov != desiredFov)
memory.Write<uint16_t>(cameraServices + offsets::m_iFOV, desiredFov);
}
}
}
7 changes: 5 additions & 2 deletions TempleWare-External/source/features/fov.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

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

namespace features {
class FOVManager {
namespace features
{
class FOVManager
{
public:
static void AdjustFOV(const Memory& memory) noexcept;

};
}
54 changes: 30 additions & 24 deletions TempleWare-External/source/features/glow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,24 @@
#include "../offsets/offsets.h"
#include <thread>

namespace features {
void Glow::Run(const Memory& memory) noexcept {
namespace features
{

uintptr_t GetEntityInListOffset(int index)
{
return 0x8 * (index & 0x7FFF) >> 9 + 16;
}

DWORD PackColor(const ImVec4& color)
{
return ((DWORD)(color.w * 255) << 24) |
((DWORD)(color.z * 255) << 16) |
((DWORD)(color.y * 255) << 8) |
(DWORD)(color.x * 255);
}

void Glow::Run(const Memory& memory) noexcept
{
if (!globals::Glow)
return;

Expand All @@ -14,47 +30,37 @@ namespace features {

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

for (int i = 1; i < 64; i++) {

for (int i = 1; i < 64; ++i)
{
uintptr_t entityList = memory.Read<uintptr_t>(globals::client + offsets::dwEntityList);
if (!entityList)
continue;

uintptr_t listEntry = memory.Read<uintptr_t>(entityList + (8 * (i & 0x7FFF) >> 9) + 16);
if (!listEntry)
uintptr_t entity = memory.Read<uintptr_t>(entityList + GetEntityInListOffset(i));
if (!entity)
continue;

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

int playerTeam = memory.Read<int>(player + offsets::m_iTeamNum);
if (playerTeam == localTeam)
continue;

uint32_t playerPawn = memory.Read<uint32_t>(player + offsets::m_hPlayerPawn);
uint32_t playerPawn = memory.Read<uint32_t>(entity + offsets::m_hPlayerPawn);
if (!playerPawn)
continue;

uintptr_t listEntry2 = memory.Read<uintptr_t>(entityList + 0x8 * ((playerPawn & 0x7FFF) >> 9) + 16);
if (!listEntry2)
continue;

uintptr_t playerCsPawn = memory.Read<uintptr_t>(listEntry2 + 120 * (playerPawn & 0x1FF));
uintptr_t playerCsPawn = memory.Read<uintptr_t>(entityList + GetEntityInListOffset(playerPawn));
if (!playerCsPawn)
continue;

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

ImVec4 color = globals::GlowColor;
DWORD colorArgb = (
((DWORD)(color.w * 255) << 24) |
((DWORD)(color.z * 255) << 16) |
((DWORD)(color.y * 255) << 8) |
(DWORD)(color.x * 255)
);


ImVec4 color = globals::GlowColor;
DWORD colorArgb = PackColor(color);
memory.Write<DWORD64>(playerCsPawn + offsets::m_Glow + offsets::m_glowColorOverride, colorArgb);
memory.Write<DWORD64>(playerCsPawn + offsets::m_Glow + offsets::m_bGlowing, 1);
}
Expand Down
7 changes: 5 additions & 2 deletions TempleWare-External/source/features/glow.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

#include "../memory/memory.h"

namespace features {
class Glow {
namespace features
{
class Glow
{
public:
static void Run(const Memory& memory) noexcept;

};
}
18 changes: 12 additions & 6 deletions TempleWare-External/source/features/noflash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@
#include "../globals/globals.h"
#include "../offsets/offsets.h"

namespace features {
void NoFlash::Run(const Memory& memory) noexcept {
if (globals::NoFlashEnabled) {
namespace features
{

void NoFlash::Run(const Memory& memory) noexcept
{
if (globals::NoFlashEnabled)
{
std::uintptr_t localPlayer = memory.Read<std::uintptr_t>(globals::client + offsets::dwLocalPlayerPawn);
if (localPlayer) {

if (localPlayer)
{
float flashDuration = memory.Read<float>(localPlayer + offsets::flFlashDuration);
if (flashDuration > 0.0f) {
if (flashDuration > 0.0f)
memory.Write<float>(localPlayer + offsets::flFlashDuration, 0.0f);
}
}
}
}

}
7 changes: 5 additions & 2 deletions TempleWare-External/source/features/noflash.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

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

namespace features {
class NoFlash {
namespace features
{
class NoFlash
{
public:
static void Run(const Memory& memory) noexcept;

};
}
55 changes: 28 additions & 27 deletions TempleWare-External/source/features/triggerbot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,36 @@
#include <thread>
#include <Windows.h>

namespace features {
namespace features
{
void TriggerBot::Run(const Memory& memory) noexcept {
while (globals::isRunning) {
if (!globals::TriggerBot) {
while (globals::isRunning)
{
if (!globals::TriggerBot)
{
std::this_thread::sleep_for(std::chrono::milliseconds(20));
continue;
}

bool keyState = GetAsyncKeyState(globals::TriggerBotKey) & 0x8000;

if (globals::TriggerBotMode == 0) {
if (!keyState) {
bool keyDown = (GetAsyncKeyState(globals::TriggerBotKey) & 0x8000) != 0;
if (globals::TriggerBotMode == 0)
{
if (!keyDown)
{
std::this_thread::sleep_for(std::chrono::milliseconds(10));
continue;
}
}
else if (globals::TriggerBotMode == 1) {
if (keyState) {
else if (globals::TriggerBotMode == 1)
{
if (keyDown)
{
globals::TriggerBotToggled = !globals::TriggerBotToggled;
std::this_thread::sleep_for(std::chrono::milliseconds(200));
}

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

if (!globals::TriggerBotIgnoreFlash) {
if (!globals::TriggerBotIgnoreFlash)
{
float flashDuration = memory.Read<float>(localPlayer + offsets::flFlashDuration);
if (flashDuration > 0.0f) {
std::this_thread::sleep_for(std::chrono::milliseconds(10));
Expand All @@ -44,32 +52,25 @@ namespace features {
}

int crosshairEntityIndex = memory.Read<int>(localPlayer + offsets::m_iIDEntIndex);
if (crosshairEntityIndex == 0) {
if (crosshairEntityIndex == 0)
continue;
}

std::uintptr_t entityList = memory.Read<std::uintptr_t>(globals::client + offsets::dwEntityList);
std::uintptr_t listEntry = memory.Read<std::uintptr_t>(entityList + 0x8 * (crosshairEntityIndex >> 9) + 0x10);
std::uintptr_t entity = memory.Read<std::uintptr_t>(listEntry + 120 * (crosshairEntityIndex & 0x1ff));

if (!entity) {
std::uintptr_t entity = memory.Read<std::uintptr_t>(memory.Read<std::uintptr_t>(entityList + 0x8 * (crosshairEntityIndex >> 9) + 0x10) + 120 * (crosshairEntityIndex & 0x1ff));
if (!entity)
continue;
}

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

if (memory.Read<int>(entity + offsets::m_iHealth) <= 0) {
if (memory.Read<int>(entity + offsets::m_iHealth) <= 0)
continue;
}

memory.Write<int>(globals::client + offsets::attack, 65537);

// Simulate shooting
memory.Write<int>(globals::client + offsets::attack, 65537); // Set attack command
std::this_thread::sleep_for(std::chrono::milliseconds(globals::TriggerBotDelay));

memory.Write<int>(globals::client + offsets::attack, 256);

memory.Write<int>(globals::client + offsets::attack, 256); // Clear attack command
std::this_thread::sleep_for(std::chrono::milliseconds(globals::TriggerBotDelay));
}
}
Expand Down
7 changes: 5 additions & 2 deletions TempleWare-External/source/features/triggerbot.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@

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

namespace features {
class TriggerBot {
namespace features
{
class TriggerBot
{
public:
static void Run(const Memory& memory) noexcept;

};
}
3 changes: 2 additions & 1 deletion TempleWare-External/source/globals/globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

#include "../../external/imgui/imgui.h"

namespace globals {
namespace globals
{

// TriggerBot
inline bool TriggerBot = false;
Expand Down
Loading
Loading