This commit is contained in:
LightCat 2018-08-19 22:32:22 +02:00
parent e5e03959d2
commit 558bf0dcbf
32 changed files with 72 additions and 32 deletions

View File

@ -7,9 +7,8 @@
#pragma once #pragma once
#include <core/logging.hpp>
#include "common.hpp" #include "common.hpp"
#include <core/logging.hpp>
namespace angles namespace angles
{ {

View File

@ -6,6 +6,7 @@
*/ */
#pragma once #pragma once
#include "config.h"
namespace backpacktf namespace backpacktf
{ {

View File

@ -7,6 +7,7 @@
#pragma once #pragma once
#include "config.h"
#include <string> #include <string>
namespace chatlog namespace chatlog

View File

@ -9,6 +9,7 @@
#define CHATSTACK_INTERVAL 0.8f #define CHATSTACK_INTERVAL 0.8f
#include "config.h"
#include <string> #include <string>
#include <stack> #include <stack>
#include <functional> #include <functional>

View File

@ -47,9 +47,8 @@
#include "averager.hpp" #include "averager.hpp"
#include "core/macros.hpp" #include "core/macros.hpp"
#include <visual/colors.hpp>
#if ENABLE_VISUALS #if ENABLE_VISUALS
#include <visual/colors.hpp>
#include <visual/drawing.hpp> #include <visual/drawing.hpp>
#include "visual/fidgetspinner.hpp" #include "visual/fidgetspinner.hpp"
#include <visual/EffectGlow.hpp> #include <visual/EffectGlow.hpp>

View File

@ -64,6 +64,7 @@ bool IsProjectileACrit(CachedEntity *ent);
class CachedEntity class CachedEntity
{ {
public: public:
typedef CachedEntity ThisClass;
CachedEntity(); CachedEntity();
~CachedEntity(); ~CachedEntity();

View File

@ -14,6 +14,7 @@
#include <studio.h> #include <studio.h>
#include <stdexcept> #include <stdexcept>
class CachedEntity;
#define CACHE_MAX_HITBOXES 64 #define CACHE_MAX_HITBOXES 64
namespace hitbox_cache namespace hitbox_cache

View File

@ -8,7 +8,7 @@
#pragma once #pragma once
#include "common.hpp" #include "common.hpp"
#if ENABLE_VISUALS
namespace hacks::shared::esp namespace hacks::shared::esp
{ {
@ -59,3 +59,4 @@ void AddEntityString(CachedEntity *entity, const std::string &string,
void SetEntityColor(CachedEntity *entity, const rgba_t &color); void SetEntityColor(CachedEntity *entity, const rgba_t &color);
void ResetEntityStrings(); void ResetEntityStrings();
} // namespace hacks::shared::esp } // namespace hacks::shared::esp
#endif

View File

@ -2,7 +2,9 @@
#include <hacks/Aimbot.hpp> #include <hacks/Aimbot.hpp>
namespace hacks::shared::lightesp namespace hacks::shared::lightesp
{ {
#if ENABLE_VISUALS
void run(); void run();
void draw(); void draw();
rgba_t LightESPColor(CachedEntity *ent); rgba_t LightESPColor(CachedEntity *ent);
#endif
} // namespace hacks::shared::lightesp } // namespace hacks::shared::lightesp

View File

@ -5,7 +5,9 @@
#pragma once #pragma once
#include <string> #include <string>
#if ENABLE_VISUALS
#include <colors.hpp> #include <colors.hpp>
#endif
#include <config.h> #include <config.h>
#include <vector> #include <vector>
@ -24,7 +26,9 @@ struct user_data
bool no_target{ false }; bool no_target{ false };
bool is_developer{}; bool is_developer{};
bool has_color{ false }; bool has_color{ false };
#if ENABLE_VISUALS
colors::rgba_t color{}; colors::rgba_t color{};
#endif
bool rainbow{ false }; bool rainbow{ false };
}; };

View File

@ -24,8 +24,9 @@ enum class k_EState
CAT, CAT,
STATE_LAST = CAT STATE_LAST = CAT
}; };
#if ENABLE_VISUALS
extern rgba_t k_Colors[]; extern rgba_t k_Colors[];
#endif
const std::string k_Names[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", const std::string k_Names[] = { "DEFAULT", "FRIEND", "RAGE", "IPC",
"DEVELOPER" }; "DEVELOPER" };
const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC", const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC",
@ -34,7 +35,9 @@ const char *const k_pszNames[] = { "DEFAULT", "FRIEND", "RAGE", "IPC",
struct userdata struct userdata
{ {
k_EState state{ k_EState::DEFAULT }; k_EState state{ k_EState::DEFAULT };
#if ENABLE_VISUALS
rgba_t color{ 0, 0, 0, 0 }; rgba_t color{ 0, 0, 0, 0 };
#endif
float inventory_value{ 0 }; float inventory_value{ 0 };
unsigned deaths_to{ 0 }; unsigned deaths_to{ 0 };
unsigned kills{ 0 }; unsigned kills{ 0 };
@ -50,9 +53,10 @@ constexpr bool IsFriendly(k_EState state)
return state == k_EState::DEVELOPER || state == k_EState::FRIEND || return state == k_EState::DEVELOPER || state == k_EState::FRIEND ||
state == k_EState::IPC; state == k_EState::IPC;
} }
#if ENABLE_VISUALS
rgba_t Color(unsigned steamid); rgba_t Color(unsigned steamid);
rgba_t Color(CachedEntity *player); rgba_t Color(CachedEntity *player);
#endif
userdata &AccessData(unsigned steamid); userdata &AccessData(unsigned steamid);
userdata &AccessData(CachedEntity *player); userdata &AccessData(CachedEntity *player);
bool IsDefault(unsigned steamid); bool IsDefault(unsigned steamid);

View File

@ -5,8 +5,8 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.hpp" "${CMAKE_CURRENT_LIST_DIR}/drawmgr.hpp"
"${CMAKE_CURRENT_LIST_DIR}/EffectChams.hpp" "${CMAKE_CURRENT_LIST_DIR}/EffectChams.hpp"
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.hpp" "${CMAKE_CURRENT_LIST_DIR}/EffectGlow.hpp"
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.hpp"
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.hpp" "${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.hpp"
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.hpp"
"${CMAKE_CURRENT_LIST_DIR}/SDLHooks.hpp") "${CMAKE_CURRENT_LIST_DIR}/SDLHooks.hpp")
if(EnableGUI) if(EnableGUI)

View File

@ -10,7 +10,7 @@
#include <glez/color.hpp> #include <glez/color.hpp>
class CachedEntity; class CachedEntity;
#if ENABLE_VISUALS
namespace colors namespace colors
{ {
namespace chat namespace chat
@ -165,3 +165,4 @@ rgba_t EntityF(CachedEntity *ent);
} // namespace colors } // namespace colors
using rgba_t = colors::rgba_t; using rgba_t = colors::rgba_t;
#endif

View File

@ -1,10 +1,11 @@
/* /*
Created on 29.07.18. Created on 29.07.18.
*/ */
#include "config.h"
#include <EventLogging.hpp> #include <EventLogging.hpp>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include <helpers.hpp> #include <helpers.hpp>
#if ENABLE_VISUALS
#include <colors.hpp> #include <colors.hpp>
#include <init.hpp> #include <init.hpp>
@ -166,3 +167,4 @@ bool event_logging::isEnabled()
{ {
return *enable; return *enable;
} }
#endif

View File

@ -4,7 +4,6 @@
* Created on: Jun 5, 2017 * Created on: Jun 5, 2017
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#include "angles.hpp" #include "angles.hpp"
namespace angles namespace angles

View File

@ -4,13 +4,12 @@
* Created on: Jul 23, 2017 * Created on: Jul 23, 2017
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#include "config.h"
#include "common.hpp"
#include "backpacktf.hpp" #include "backpacktf.hpp"
#include "json.hpp" #include "json.hpp"
#include "https_request.hpp" #include "https_request.hpp"
#include "common.hpp"
#include <thread> #include <thread>
#include <queue> #include <queue>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>

View File

@ -10,7 +10,9 @@
#include <hacks/AntiAim.hpp> #include <hacks/AntiAim.hpp>
#include <hacks/ESP.hpp> #include <hacks/ESP.hpp>
#include <hacks/Backtrack.hpp> #include <hacks/Backtrack.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <PlayerTools.hpp> #include <PlayerTools.hpp>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include "common.hpp" #include "common.hpp"

View File

@ -6,7 +6,6 @@
*/ */
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
#include <glez/draw.hpp>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include <hacks/AntiAim.hpp> #include <hacks/AntiAim.hpp>

View File

@ -35,10 +35,12 @@ void Accuse(int eid, const std::string &hack, const std::string &details)
} }
else else
{ {
#if ENABLE_VISUALS
PrintChat("\x07%06X%s\x01 (%s) suspected \x07%06X%s\x01: %s", PrintChat("\x07%06X%s\x01 (%s) suspected \x07%06X%s\x01: %s",
colors::chat::team(ENTITY(eid)->m_iTeam()), info.name, colors::chat::team(ENTITY(eid)->m_iTeam()), info.name,
classname(CE_INT(ent, netvar.iClass)), 0xe05938, classname(CE_INT(ent, netvar.iClass)), 0xe05938,
hack.c_str(), details.c_str()); hack.c_str(), details.c_str());
#endif
} }
} }
} }

View File

@ -7,7 +7,9 @@
#include "common.hpp" #include "common.hpp"
#include <hacks/AutoReflect.hpp> #include <hacks/AutoReflect.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
static settings::Bool enable{ "autoreflect.enable", "false" }; static settings::Bool enable{ "autoreflect.enable", "false" };

View File

@ -9,7 +9,9 @@
#include "hacks/Aimbot.hpp" #include "hacks/Aimbot.hpp"
#include "hacks/Backtrack.hpp" #include "hacks/Backtrack.hpp"
#include <boost/circular_buffer.hpp> #include <boost/circular_buffer.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include <hacks/Backtrack.hpp> #include <hacks/Backtrack.hpp>

View File

@ -8,7 +8,9 @@
#include "common.hpp" #include "common.hpp"
#include <hacks/FollowBot.hpp> #include <hacks/FollowBot.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
static settings::Bool enable{ "follow-bot.enable", "false" }; static settings::Bool enable{ "follow-bot.enable", "false" };

View File

@ -1,4 +1,6 @@
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include "hacks/LightESP.hpp" #include "hacks/LightESP.hpp"
@ -71,7 +73,7 @@ void draw()
} }
#endif #endif
} }
#if ENABLE_VISUALS
rgba_t LightESPColor(CachedEntity *ent) rgba_t LightESPColor(CachedEntity *ent)
{ {
if (!playerlist::IsDefault(ent)) if (!playerlist::IsDefault(ent))
@ -80,4 +82,5 @@ rgba_t LightESPColor(CachedEntity *ent)
} }
return colors::green; return colors::green;
} }
#endif
} // namespace hacks::shared::lightesp } // namespace hacks::shared::lightesp

View File

@ -12,7 +12,9 @@
#include <fcntl.h> #include <fcntl.h>
#include <link.h> #include <link.h>
#include <hacks/AntiAim.hpp> #include <hacks/AntiAim.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include "core/sharedobj.hpp" #include "core/sharedobj.hpp"

View File

@ -2,8 +2,6 @@
// Created by bencat07 on 17.08.18. // Created by bencat07 on 17.08.18.
// //
#include "common.hpp" #include "common.hpp"
#include <glez/draw.hpp>
#include <glez/color.hpp>
#include "navparser.hpp" #include "navparser.hpp"
#include "FollowBot.hpp" #include "FollowBot.hpp"
#include "NavBot.hpp" #include "NavBot.hpp"

View File

@ -4,8 +4,9 @@
* Created on: Mar 28, 2017 * Created on: Mar 28, 2017
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Int.hpp> #include <settings/Int.hpp>
#include "common.hpp" #include "common.hpp"
#include "hacks/Radar.hpp" #include "hacks/Radar.hpp"

View File

@ -12,7 +12,9 @@
#include <sys/dir.h> #include <sys/dir.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
static settings::Button recording_key{ "walkbot.recording-key", "<null>" }; static settings::Button recording_key{ "walkbot.recording-key", "<null>" };

View File

@ -5,7 +5,9 @@
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#if ENABLE_VISUALS
#include <menu/GuiInterface.hpp> #include <menu/GuiInterface.hpp>
#endif
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
#include "MiscTemporary.hpp" #include "MiscTemporary.hpp"
#include "navparser.hpp" #include "navparser.hpp"
@ -78,14 +80,13 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
logging::Info("Loaded Skybox: %s", succ ? "true" : "false"); logging::Info("Loaded Skybox: %s", succ ? "true" : "false");
ConVar *holiday = g_ICvar->FindVar("tf_forced_holiday"); ConVar *holiday = g_ICvar->FindVar("tf_forced_holiday");
for (int i = 0; i < 32; i++)
g_Settings.brute.brutenum[i] = 0;
if (halloween_mode) if (halloween_mode)
holiday->SetValue(2); holiday->SetValue(2);
else if (holiday->m_nValue == 2) else if (holiday->m_nValue == 2)
holiday->SetValue(0); holiday->SetValue(0);
#endif #endif
for (int i = 0; i < 32; i++)
g_Settings.brute.brutenum[i] = 0;
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
#if !LAGBOT_MODE #if !LAGBOT_MODE
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();

View File

@ -18,14 +18,17 @@ namespace playerlist
std::unordered_map<unsigned, userdata> data{}; std::unordered_map<unsigned, userdata> data{};
const userdata null_data{}; const userdata null_data{};
#if ENABLE_VISUALS
rgba_t k_Colors[] = { colors::empty, colors::FromRGBA8(99, 226, 161, 255), rgba_t k_Colors[] = { colors::empty, colors::FromRGBA8(99, 226, 161, 255),
colors::FromRGBA8(226, 204, 99, 255), colors::FromRGBA8(226, 204, 99, 255),
colors::FromRGBA8(232, 134, 6, 255), colors::empty }; colors::FromRGBA8(232, 134, 6, 255), colors::empty };
#endif
bool ShouldSave(const userdata &data) bool ShouldSave(const userdata &data)
{ {
#if ENABLE_VISUALS
return data.color || (data.state != k_EState::DEFAULT); return data.color || (data.state != k_EState::DEFAULT);
#endif
return (data.state != k_EState::DEFAULT);
} }
void Save() void Save()
@ -114,7 +117,7 @@ void Load()
logging::Info("Reading unsuccessful: %s", e.what()); logging::Info("Reading unsuccessful: %s", e.what());
} }
} }
#if ENABLE_VISUALS
rgba_t Color(unsigned steamid) rgba_t Color(unsigned steamid)
{ {
if (AccessData(steamid).state == k_EState::DEVELOPER) if (AccessData(steamid).state == k_EState::DEVELOPER)
@ -137,7 +140,7 @@ rgba_t Color(CachedEntity *player)
return Color(player->player_info.friendsID); return Color(player->player_info.friendsID);
return colors::empty; return colors::empty;
} }
#endif
userdata &AccessData(unsigned steamid) userdata &AccessData(unsigned steamid)
{ {
return data[steamid]; return data[steamid];
@ -154,7 +157,10 @@ userdata &AccessData(CachedEntity *player)
bool IsDefault(unsigned steamid) bool IsDefault(unsigned steamid)
{ {
const userdata &data = AccessData(steamid); const userdata &data = AccessData(steamid);
#if ENABLE_VISUALS
return data.state == k_EState::DEFAULT && !data.color.a; return data.state == k_EState::DEFAULT && !data.color.a;
#endif
return data.state == k_EState ::DEFAULT;
} }
bool IsDefault(CachedEntity *entity) bool IsDefault(CachedEntity *entity)
@ -184,7 +190,7 @@ CatCommand pl_set_state(
AccessData(steamid).state = state; AccessData(steamid).state = state;
logging::Info("Set %d to %d", steamid, state); logging::Info("Set %d to %d", steamid, state);
}); });
#if ENABLE_VISUALS
CatCommand pl_set_color("pl_set_color", "pl_set_color uniqueid r g b", CatCommand pl_set_color("pl_set_color", "pl_set_color uniqueid r g b",
[](const CCommand &args) { [](const CCommand &args) {
if (args.ArgC() < 5) if (args.ArgC() < 5)
@ -201,7 +207,7 @@ CatCommand pl_set_color("pl_set_color", "pl_set_color uniqueid r g b",
AccessData(steamid).color = color; AccessData(steamid).color = color;
logging::Info("Changed %d's color", steamid); logging::Info("Changed %d's color", steamid);
}); });
#endif
CatCommand pl_info("pl_info", "pl_info uniqueid", [](const CCommand &args) { CatCommand pl_info("pl_info", "pl_info uniqueid", [](const CCommand &args) {
if (args.ArgC() < 2) if (args.ArgC() < 2)
{ {

View File

@ -4,8 +4,9 @@
* Created on: Dec 5, 2016 * Created on: Dec 5, 2016
* Author: nullifiedcat * Author: nullifiedcat
*/ */
#if ENABLE_VISUALS
#include <glez/draw.hpp> #include <glez/draw.hpp>
#endif
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include "common.hpp" #include "common.hpp"

View File

@ -5,10 +5,10 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp" "${CMAKE_CURRENT_LIST_DIR}/drawmgr.cpp"
"${CMAKE_CURRENT_LIST_DIR}/EffectChams.cpp" "${CMAKE_CURRENT_LIST_DIR}/EffectChams.cpp"
"${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp" "${CMAKE_CURRENT_LIST_DIR}/EffectGlow.cpp"
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp"
"${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp" "${CMAKE_CURRENT_LIST_DIR}/fidgetspinner.cpp"
"${CMAKE_CURRENT_LIST_DIR}/EventLogging.cpp"
"${CMAKE_CURRENT_LIST_DIR}/SDLHooks.cpp") "${CMAKE_CURRENT_LIST_DIR}/SDLHooks.cpp")
if(EnableGUI) if(EnableGUI)
add_subdirectory(menu) add_subdirectory(menu)
endif() endif()

View File

@ -1,10 +1,11 @@
/* /*
Created on 29.07.18. Created on 29.07.18.
*/ */
#include "config.h"
#include <EventLogging.hpp> #include <EventLogging.hpp>
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include <helpers.hpp> #include <helpers.hpp>
#if ENABLE_VISUALS
#include <colors.hpp> #include <colors.hpp>
#include <init.hpp> #include <init.hpp>
@ -166,3 +167,4 @@ bool event_logging::isEnabled()
{ {
return *enable; return *enable;
} }
#endif