This commit is contained in:
nullifiedcat 2018-07-29 14:53:08 +03:00
parent a6d4a510d5
commit 579b4b6f58
39 changed files with 300 additions and 426 deletions

View File

@ -23,12 +23,9 @@ extern ConVar *cl_interp;
extern ConVar *cl_interpolate; extern ConVar *cl_interpolate;
extern bool *bSendPackets; extern bool *bSendPackets;
extern char *force_name_newlined;
extern bool need_name_change; extern bool need_name_change;
extern int last_cmd_number; extern int last_cmd_number;
extern char *disconnect_reason_newlined;
extern time_t time_injected; extern time_t time_injected;
struct brutestruct struct brutestruct
{ {

View File

@ -0,0 +1,12 @@
/*
Created on 29.07.18.
*/
#pragma once
namespace hacks::shared::anti_anti_aim
{
void createMove();
}

View File

@ -13,4 +13,5 @@ namespace hacks::shared::autojoin
void resetQueueTimer(); void resetQueueTimer();
void update(); void update();
void updateSearch(); void updateSearch();
void onShutdown();
} }

View File

@ -60,4 +60,6 @@ extern BestTickData sorted_ticks[66];
bool isBacktrackEnabled(); bool isBacktrackEnabled();
float getLatency(); float getLatency();
int getTicks(); int getTicks();
// FIXME
int getTicks2();
} }

View File

@ -9,6 +9,7 @@ target_sources(cathook PRIVATE
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.hpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.hpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.hpp" "${CMAKE_CURRENT_LIST_DIR}/Announcer.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.hpp" "${CMAKE_CURRENT_LIST_DIR}/AntiAim.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiBackstab.hpp" "${CMAKE_CURRENT_LIST_DIR}/AntiBackstab.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiCheat.hpp" "${CMAKE_CURRENT_LIST_DIR}/AntiCheat.hpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiDisguise.hpp" "${CMAKE_CURRENT_LIST_DIR}/AntiDisguise.hpp"

View File

@ -8,6 +8,7 @@
#pragma once #pragma once
#include <mathlib/vector.h> #include <mathlib/vector.h>
#include <enums.hpp>
class CachedEntity; class CachedEntity;

View File

@ -36,31 +36,32 @@ public:
setInternal(true); setInternal(true);
} }
Variable<bool>& operator=(const std::string& string) inline Variable<bool>& operator=(const std::string& string)
{ {
fromString(string); fromString(string);
} }
const std::string &toString() override inline const std::string &toString() override
{ {
return string; return string;
} }
explicit operator bool() const inline explicit operator bool() const
{ {
return value; return value;
} }
Variable<bool>& operator=(bool next)
inline Variable<bool>& operator=(bool next)
{ {
setInternal(next); setInternal(next);
} }
const bool &operator*() override inline const bool &operator*() override
{ {
return value; return value;
} }
void flip() inline void flip()
{ {
setInternal(!value); setInternal(!value);
} }

View File

@ -29,17 +29,17 @@ public:
set(next); set(next);
} }
Variable<float>& operator=(const std::string& string) inline Variable<float>& operator=(const std::string& string)
{ {
fromString(string); fromString(string);
} }
Variable<float>& operator=(const float& next) inline Variable<float>& operator=(const float& next)
{ {
set(next); set(next);
} }
explicit operator bool() const inline explicit operator bool() const
{ {
return value != 0.0f; return value != 0.0f;
} }

View File

@ -29,17 +29,17 @@ public:
set(result); set(result);
} }
Variable<int>& operator=(const std::string& string) inline Variable<int>& operator=(const std::string& string)
{ {
fromString(string); fromString(string);
} }
Variable<int>& operator=(const int& next) inline Variable<int>& operator=(const int& next)
{ {
set(next); set(next);
} }
explicit operator bool() const inline explicit operator bool() const
{ {
return value != 0; return value != 0;
} }

View File

@ -82,22 +82,22 @@ public:
setInternal(k); setInternal(k);
} }
const Key &operator*() override inline const Key &operator*() override
{ {
return value; return value;
} }
const std::string &toString() override inline const std::string &toString() override
{ {
return string; return string;
} }
explicit operator bool() const inline explicit operator bool() const
{ {
return value.mouse || value.scan; return value.mouse || value.scan;
} }
bool isKeyDown() const inline bool isKeyDown() const
{ {
if (value.mouse) if (value.mouse)
{ {

View File

@ -50,21 +50,21 @@ public:
setInternal(next); setInternal(next);
} }
Variable<glez::rgba>& operator=(const glez::rgba& rgba) inline Variable<glez::rgba>& operator=(const glez::rgba& rgba)
{ {
setInternal(rgba); setInternal(rgba);
} }
Variable<glez::rgba>& operator=(const std::string& string) inline Variable<glez::rgba>& operator=(const std::string& string)
{ {
fromString(string); fromString(string);
} }
const std::string &toString() override inline const std::string &toString() override
{ {
return string; return string;
} }
const glez::rgba &operator*() override inline const glez::rgba &operator*() override
{ {
return value; return value;
} }

View File

@ -94,15 +94,15 @@ class ArithmeticVariable: public VariableBase<T>
public: public:
~ArithmeticVariable<T>() override = default; ~ArithmeticVariable<T>() override = default;
explicit operator T() const explicit inline operator T() const
{ {
return value; return value;
} }
const std::string &toString() override const inline std::string &toString() override
{ {
return string; return string;
} }
const T &operator*() override const inline T &operator*() override
{ {
return value; return value;
} }

View File

@ -26,23 +26,23 @@ public:
value = string; value = string;
} }
const std::string &toString() override inline const std::string &toString() override
{ {
return value; return value;
} }
Variable<std::string>& operator=(const std::string& string) inline Variable<std::string>& operator=(const std::string& string)
{ {
fireCallbacks(std::string(string)); fireCallbacks(std::string(string));
value = string; value = string;
} }
const std::string &operator*() override inline const std::string &operator*() override
{ {
return value; return value;
} }
explicit operator bool() const inline explicit operator bool() const
{ {
return !value.empty(); return !value.empty();
} }

View File

@ -6,4 +6,5 @@
namespace event_logging namespace event_logging
{ {
bool isEnabled();
} }

View File

@ -352,7 +352,7 @@ free(logname);*/
#endif #endif
#if not LAGBOT_MODE #if not LAGBOT_MODE
// FIXME [MP] // FIXME [MP]
hacks::shared::killsay::Init(); hacks::shared::killsay::init();
hacks::shared::announcer::init(); hacks::shared::announcer::init();
hacks::tf2::killstreak::init(); hacks::tf2::killstreak::init();
#endif #endif
@ -435,7 +435,7 @@ void hack::Shutdown()
ConVar_Unregister(); ConVar_Unregister();
#if not LAGBOT_MODE #if not LAGBOT_MODE
logging::Info("Shutting down killsay..."); logging::Info("Shutting down killsay...");
hacks::shared::killsay::Shutdown(); hacks::shared::killsay::shutdown();
hacks::shared::announcer::shutdown(); hacks::shared::announcer::shutdown();
#endif #endif
logging::Info("Success.."); logging::Info("Success..");

View File

@ -619,7 +619,7 @@ void ProcessUserCmd(CUserCmd *cmd)
FakeCrouch(cmd); FakeCrouch(cmd);
} }
bool antiaim::isEnabled() bool isEnabled()
{ {
return *enable; return *enable;
} }

92
src/hacks/AntiAntiAim.cpp Normal file
View File

@ -0,0 +1,92 @@
/*
Created on 29.07.18.
*/
#include <hacks/AntiAntiAim.hpp>
#include <core/interfaces.hpp>
#include <core/sdk.hpp>
#include <globals.h>
#include <core/netvars.hpp>
#include <settings/Bool.hpp>
#include <localplayer.hpp>
#include <entitycache.hpp>
static settings::Bool enable{ "anti-anti-aim.enable", "false" };
void hacks::shared::anti_anti_aim::createMove()
{
if (!enable)
return;
if (CE_BAD(LOCAL_E))
return;
IClientEntity *entity{ nullptr };
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{
if (i == g_IEngine->GetLocalPlayer())
continue;
entity = g_IEntityList->GetClientEntity(i);
if (entity && !entity->IsDormant() && !NET_BYTE(entity, netvar.iLifeState))
{
float quotat = 0;
float quotaf = 0;
if (!g_Settings.brute.choke[i].empty())
for (auto it : g_Settings.brute.choke[i])
{
if (it)
quotat++;
else
quotaf++;
}
float quota = quotat / quotaf;
Vector &angles = NET_VECTOR(entity, netvar.m_angEyeAngles);
static bool brutepitch = false;
if (g_Settings.brute.brutenum[i] > 5)
{
g_Settings.brute.brutenum[i] = 0;
brutepitch = !brutepitch;
}
angles.y = fmod(angles.y + 180.0f, 360.0f);
if (angles.y < 0)
angles.y += 360.0f;
angles.y -= 180.0f;
if (quota < 0.8f)
switch (g_Settings.brute.brutenum[i])
{
case 0:
break;
case 1:
angles.y += 180.0f;
break;
case 2:
angles.y -= 90.0f;
break;
case 3:
angles.y += 90.0f;
break;
case 4:
angles.y -= 180.0f;
break;
case 5:
angles.y = 0.0f;
break;
}
if (brutepitch || quota < 0.8f)
switch (g_Settings.brute.brutenum[i] % 4)
{
case 0:
break;
case 1:
angles.x = -89.0f;
break;
case 2:
angles.x = 89.0f;
break;
case 3:
angles.x = 0.0f;
break;
}
}
}
}

View File

@ -451,8 +451,8 @@ void CreateMove()
current_user_cmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
/*if (m_iNewTarget || !(g_GlobalVars->tickcount % 300)) { /*if (m_iNewTarget || !(g_GlobalVars->tickcount % 300)) {
if (silent) g_pLocalPlayer->bUseSilentAngles = true; if (silent) g_pLocalPlayer->bUseSilentAngles = true;
AimAt(g_pLocalPlayer->v_Eye, out, g_pUserCmd); AimAt(g_pLocalPlayer->v_Eye, out, current_user_cmd);
g_pUserCmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
}*/ }*/
if (IsVaccinator() && CE_GOOD(target) && auto_vacc) if (IsVaccinator() && CE_GOOD(target) && auto_vacc)
{ {

View File

@ -133,4 +133,10 @@ void resetQueueTimer()
queuetime.update(); queuetime.update();
} }
void onShutdown()
{
if (auto_queue)
tfmm::startQueue();
}
} }

View File

@ -158,7 +158,7 @@ void Run()
BestTickData{ headPositions[iBestTarget][t].tickcount, t }; BestTickData{ headPositions[iBestTarget][t].tickcount, t };
} }
std::sort(sorted_ticks, sorted_ticks + getTicks()); std::sort(sorted_ticks, sorted_ticks + getTicks());
int tickus = (*latency > 800 || *latency < 200) ? 12 : 24; int tickus = getTicks2();
for (int t = 0; t < getTicks(); ++t) for (int t = 0; t < getTicks(); ++t)
{ {
bool good_tick = false; bool good_tick = false;
@ -214,7 +214,7 @@ void Draw()
return; return;
if (!shouldDrawBt) if (!shouldDrawBt)
return; return;
int tickus = (*latency > 800 || *latency < 200.0f) ? 12 : 24; int tickus = getTicks2();
for (int i = 0; i < g_IEngine->GetMaxClients(); i++) for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{ {
for (int j = 0; j < getTicks(); j++) for (int j = 0; j < getTicks(); j++)
@ -304,4 +304,9 @@ int getTicks()
{ {
return max(min(*latency / 15, 65), 12); return max(min(*latency / 15, 65), 12);
} }
int getTicks2()
{
return (*latency > 800 || *latency < 200) ? 12 : 24;
}
} }

View File

@ -9,6 +9,7 @@ if(NOT LagbotMode)
"${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp" "${CMAKE_CURRENT_LIST_DIR}/Aimbot.cpp"
"${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp" "${CMAKE_CURRENT_LIST_DIR}/Announcer.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiAim.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiAntiAim.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiBackstab.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiBackstab.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiCheat.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiCheat.cpp"
"${CMAKE_CURRENT_LIST_DIR}/AntiDisguise.cpp" "${CMAKE_CURRENT_LIST_DIR}/AntiDisguise.cpp"

View File

@ -76,6 +76,8 @@ static settings::Bool online_support{ "esp.online.enable", "true" };
static settings::Bool online_groups{ "esp.online.groups", "true" }; static settings::Bool online_groups{ "esp.online.groups", "true" };
static settings::Bool online_software{ "esp.online.software", "true" }; static settings::Bool online_software{ "esp.online.software", "true" };
static settings::Bool v9mode{ "esp.v952-mode", "false" };
namespace hacks::shared::esp namespace hacks::shared::esp
{ {
@ -232,7 +234,7 @@ std::unordered_map<studiohdr_t *, bonelist_s> bonelist_map{};
// Function called on draw // Function called on draw
void Draw() void Draw()
{ {
if (!enabled) if (!enable)
return; return;
std::lock_guard<std::mutex> esp_lock(threadsafe_mutex); std::lock_guard<std::mutex> esp_lock(threadsafe_mutex);
for (auto &i : entities_need_repaint) for (auto &i : entities_need_repaint)
@ -249,7 +251,7 @@ void CreateMove()
{ {
// Check usersettings if enabled // Check usersettings if enabled
if (!enabled) if (!enable)
return; return;
// Something // Something
@ -341,14 +343,14 @@ void _FASTCALL emoji(CachedEntity *ent)
if (draw::WorldToScreen(hit->center, head_scr)) if (draw::WorldToScreen(hit->center, head_scr))
{ {
float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y)
: float(emoji_esp_size); : *emoji_esp_size;
if (v9mode) if (v9mode)
size *= 1.4; size *= 1.4;
if (!size || !float(emoji_min_size)) if (!size || !emoji_min_size)
return; return;
if (emoji_esp_scaling && (size < float(emoji_min_size))) if (emoji_esp_scaling && (size < *emoji_min_size))
size = float(emoji_min_size); size = *emoji_min_size;
player_info_s info; player_info_s info{};
unsigned int steamID; unsigned int steamID;
unsigned int steamidarray[32]{}; unsigned int steamidarray[32]{};
bool hascall = false; bool hascall = false;
@ -797,11 +799,11 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
// Used to process entities from CreateMove // Used to process entities from CreateMove
void _FASTCALL ProcessEntity(CachedEntity *ent) void _FASTCALL ProcessEntity(CachedEntity *ent)
{ {
if (!enabled) if (!enable)
return; // Esp enable check return; // Esp enable check
if (CE_BAD(ent)) if (CE_BAD(ent))
return; // CE_BAD check to prevent crashes return; // CE_BAD check to prevent crashes
if (max_dist && ent->m_flDistance() > (float) max_dist) if (max_dist && ent->m_flDistance() > *max_dist)
return; return;
int classid = ent->m_iClassID(); int classid = ent->m_iClassID();
// Entity esp // Entity esp
@ -1410,7 +1412,7 @@ void BoxCorners(int minx, int miny, int maxx, int maxy, const rgba_t &color,
{ {
const rgba_t &black = const rgba_t &black =
transparent ? colors::Transparent(colors::black) : colors::black; transparent ? colors::Transparent(colors::black) : colors::black;
const int size = box_corner_size; const int size = *box_corner_size;
// Black corners // Black corners
// Top Left // Top Left
@ -1470,7 +1472,7 @@ bool GetCollide(CachedEntity *ent)
// If user setting for box expnad is true, spread the max and mins // If user setting for box expnad is true, spread the max and mins
if (esp_expand) if (esp_expand)
{ {
const float &exp = (float) esp_expand; const float exp = *esp_expand;
maxs.x += exp; maxs.x += exp;
maxs.y += exp; maxs.y += exp;
maxs.z += exp; maxs.z += exp;

View File

@ -424,7 +424,7 @@ void WorldTick()
DistanceToGround({ breadcrumbs[0].x, breadcrumbs[0].y, DistanceToGround({ breadcrumbs[0].x, breadcrumbs[0].y,
breadcrumbs[0].z + 5 }) > 47)) breadcrumbs[0].z + 5 }) > 47))
{ {
g_pUserCmd->buttons |= IN_JUMP; current_user_cmd->buttons |= IN_JUMP;
lastJump.update(); lastJump.update();
} }
// Check if still moving. 70 HU = Sniper Zoomed Speed // Check if still moving. 70 HU = Sniper Zoomed Speed
@ -511,7 +511,7 @@ void WorldTick()
void DrawTick() void DrawTick()
{ {
#if ENABLE_VISUALS #if ENABLE_VISUALS
if (!followbot || !draw_crumb) if (!enable || !draw_crumb)
return; return;
if (breadcrumbs.size() < 2) if (breadcrumbs.size() < 2)
return; return;

View File

@ -17,7 +17,7 @@ static settings::Bool radar_enabled{ "radar.enable", "false" };
static settings::Int size{ "radar.size", "300" }; static settings::Int size{ "radar.size", "300" };
static settings::Float zoom{ "radar.zoom", "20" }; static settings::Float zoom{ "radar.zoom", "20" };
static settings::Bool healthbar{ "radar.healthbar", "true" }; static settings::Bool healthbar{ "radar.healthbar", "true" };
static settings::Bool enemis_over_teammates{ "radar.enemies-over-teammates", "true" }; static settings::Bool enemies_over_teammates{ "radar.enemies-over-teammates", "true" };
static settings::Int icon_size{ "radar.icon-size", "20" }; static settings::Int icon_size{ "radar.icon-size", "20" };
static settings::Int radar_x{ "radar.x", "100" }; static settings::Int radar_x{ "radar.x", "100" };
static settings::Int radar_y{ "radar.y", "100" }; static settings::Int radar_y{ "radar.y", "100" };
@ -146,7 +146,7 @@ void DrawEntity(int x, int y, CachedEntity *ent)
(int) icon_size, 4, colors::black, 0.5f); (int) icon_size, 4, colors::black, 0.5f);
glez::draw::rect(x + wtr.first + 1, glez::draw::rect(x + wtr.first + 1,
y + wtr.second + (int) icon_size + 1, y + wtr.second + (int) icon_size + 1,
((float) icon_size - 2.0f) * healthp, 2, clr); (*icon_size - 2.0f) * healthp, 2, clr);
} }
} }
else if (ent->m_Type() == ENTITY_BUILDING) else if (ent->m_Type() == ENTITY_BUILDING)
@ -179,8 +179,8 @@ void DrawEntity(int x, int y, CachedEntity *ent)
{ {
const auto &wtr = const auto &wtr =
WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y);
float sz = float(icon_size) * 0.15f * 0.5f; float sz = *icon_size * 0.15f * 0.5f;
float sz2 = float(icon_size) * 0.85; float sz2 = *icon_size * 0.85;
tx_items[0].draw(x + wtr.first + sz, y + wtr.second + sz, sz2, tx_items[0].draw(x + wtr.first + sz, y + wtr.second + sz, sz2,
sz2, colors::white); sz2, colors::white);
} }
@ -190,8 +190,8 @@ void DrawEntity(int x, int y, CachedEntity *ent)
{ {
const auto &wtr = const auto &wtr =
WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y); WorldToRadar(ent->m_vecOrigin().x, ent->m_vecOrigin().y);
float sz = float(icon_size) * 0.15f * 0.5f; float sz = *icon_size * 0.15f * 0.5f;
float sz2 = float(icon_size) * 0.85; float sz2 = *icon_size * 0.85;
tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz, sz2, tx_items[1].draw(x + wtr.first + sz, y + wtr.second + sz, sz2,
sz2, colors::white); sz2, colors::white);
} }
@ -214,7 +214,7 @@ void Draw()
x = (int) radar_x; x = (int) radar_x;
y = (int) radar_y; y = (int) radar_y;
int radar_size = size; int radar_size = *size;
int half_size = radar_size / 2; int half_size = radar_size / 2;
outlineclr = GUIColor(); outlineclr = GUIColor();

View File

@ -195,7 +195,7 @@ void FrameStageNotify(int stage)
if (stage != FRAME_NET_UPDATE_POSTDATAUPDATE_START) if (stage != FRAME_NET_UPDATE_POSTDATAUPDATE_START)
return; return;
if (!enabled) if (!enable)
return; return;
if (CE_BAD(LOCAL_E)) if (CE_BAD(LOCAL_E))
return; return;
@ -253,9 +253,9 @@ void DrawText()
{ {
CAttributeList *list; CAttributeList *list;
if (!enabled) if (!enable)
return; return;
if (!show_debug_info) if (!debug)
return; return;
if (CE_GOOD(LOCAL_W)) if (CE_GOOD(LOCAL_W))
{ {
@ -417,7 +417,7 @@ void patched_weapon_cookie::Update(int entity)
ent = g_IEntityList->GetClientEntity(entity); ent = g_IEntityList->GetClientEntity(entity);
if (!ent || ent->IsDormant()) if (!ent || ent->IsDormant())
return; return;
if (show_debug_info) if (debug)
logging::Info("Updating cookie for %i", entity); // FIXME DEBUG LOGS! logging::Info("Updating cookie for %i", entity); // FIXME DEBUG LOGS!
list = (CAttributeList *) ((uintptr_t) ent + netvar.AttributeList); list = (CAttributeList *) ((uintptr_t) ent + netvar.AttributeList);
attrs = list->m_Attributes.Size(); attrs = list->m_Attributes.Size();
@ -482,7 +482,7 @@ void def_attribute_modifier::Apply(int entity)
NET_INT(ent, netvar.iItemDefinitionIndex) != defidx_redirect) NET_INT(ent, netvar.iItemDefinitionIndex) != defidx_redirect)
{ {
NET_INT(ent, netvar.iItemDefinitionIndex) = defidx_redirect; NET_INT(ent, netvar.iItemDefinitionIndex) = defidx_redirect;
if (show_debug_info) if (debug)
logging::Info("Redirect -> %i", logging::Info("Redirect -> %i",
NET_INT(ent, netvar.iItemDefinitionIndex)); NET_INT(ent, netvar.iItemDefinitionIndex));
GetModifier(defidx_redirect).Apply(entity); GetModifier(defidx_redirect).Apply(entity);

View File

@ -43,7 +43,7 @@ bool CanBacktrack()
{ {
int target = hacks::shared::backtrack::iBestTarget; int target = hacks::shared::backtrack::iBestTarget;
int tickcnt = 0; int tickcnt = 0;
int tickus = (float(hacks::shared::backtrack::latency) > 800.0f || float(hacks::shared::backtrack::latency) < 200.0f) ? 12 : 24; int tickus = hacks::shared::backtrack::getTicks2();
for (auto i : hacks::shared::backtrack::headPositions[target]) for (auto i : hacks::shared::backtrack::headPositions[target])
{ {
bool good_tick = false; bool good_tick = false;
@ -90,8 +90,8 @@ bool CanBacktrack()
Vector &angles = NET_VECTOR(RAW_ENT(tar), netvar.m_angEyeAngles); Vector &angles = NET_VECTOR(RAW_ENT(tar), netvar.m_angEyeAngles);
float &simtime = NET_FLOAT(RAW_ENT(tar), netvar.m_flSimulationTime); float &simtime = NET_FLOAT(RAW_ENT(tar), netvar.m_flSimulationTime);
angles.y = i.viewangles; angles.y = i.viewangles;
g_pUserCmd->tick_count = i.tickcount; current_user_cmd->tick_count = i.tickcount;
g_pUserCmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
return false; return false;
} }
} }
@ -119,7 +119,7 @@ void CreateMove()
CachedEntity *ent = FindEntInSight(EffectiveTargetingRange()); CachedEntity *ent = FindEntInSight(EffectiveTargetingRange());
// Check if can backtrack, shoot if we can // Check if can backtrack, shoot if we can
if (!CanBacktrack() || hacks::shared::backtrack::enable) if (!CanBacktrack() || hacks::shared::backtrack::isBacktrackEnabled())
return; return;
// Check if dormant or null to prevent crashes // Check if dormant or null to prevent crashes
@ -144,16 +144,15 @@ void CreateMove()
{ {
if (g_GlobalVars->curtime - float(delay) >= target_time) if (g_GlobalVars->curtime - float(delay) >= target_time)
{ {
g_pUserCmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
} }
} }
} }
else else
{ {
g_pUserCmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
} }
} }
return;
} }
// The first check to see if the player should shoot in the first place // The first check to see if the player should shoot in the first place
@ -161,7 +160,7 @@ bool ShouldShoot()
{ {
// Check for +use // Check for +use
if (g_pUserCmd->buttons & IN_USE) if (current_user_cmd->buttons & IN_USE)
return false; return false;
// Check if using action slot item // Check if using action slot item
@ -183,7 +182,7 @@ bool ShouldShoot()
// If zoomed only is on, check if zoomed // If zoomed only is on, check if zoomed
if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle) if (zoomed_only && g_pLocalPlayer->holding_sniper_rifle)
{ {
if (!g_pLocalPlayer->bZoomed && !(g_pUserCmd->buttons & IN_ATTACK)) if (!g_pLocalPlayer->bZoomed && !(current_user_cmd->buttons & IN_ATTACK))
return false; return false;
} }
// Check if player is taunting // Check if player is taunting
@ -223,7 +222,7 @@ bool ShouldShoot()
// Check if player is zooming // Check if player is zooming
if (g_pLocalPlayer->bZoomed) if (g_pLocalPlayer->bZoomed)
{ {
if (!(g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2))) if (!(current_user_cmd->buttons & (IN_ATTACK | IN_ATTACK2)))
{ {
if (!CanHeadshot()) if (!CanHeadshot())
return false; return false;
@ -554,8 +553,7 @@ bool UpdateAimkey()
if (trigger_key && trigger_key_mode) if (trigger_key && trigger_key_mode)
{ {
// Grab whether the aimkey is depressed // Grab whether the aimkey is depressed
bool key_down = bool key_down = trigger_key.isKeyDown();
g_IInputSystem->IsButtonDown((ButtonCode_t)(int) trigger_key);
// Switch based on the user set aimkey mode // Switch based on the user set aimkey mode
switch ((int) trigger_key_mode) switch ((int) trigger_key_mode)
{ {
@ -599,7 +597,7 @@ float EffectiveTargetingRange()
return 200.0f; return 200.0f;
// If user has set a max range, then use their setting, // If user has set a max range, then use their setting,
if (max_range) if (max_range)
return (float) max_range; return *max_range;
// else use a pre-set range // else use a pre-set range
else else
return 8012.0f; return 8012.0f;

View File

@ -25,7 +25,7 @@ TextFile custom_lines;
static CatCommand custom_file_reload( static CatCommand custom_file_reload(
"uberspam_file_reload", "Reload Ubercharge Spam File", "uberspam_file_reload", "Reload Ubercharge Spam File",
[]() { custom_lines.Load(std::string(custom_file.GetString())); }); []() { custom_lines.Load(*custom_file); });
const std::vector<std::string> *GetSource() const std::vector<std::string> *GetSource()
{ {

View File

@ -24,10 +24,10 @@ static settings::Bool draw_indices{ "walkbot.draw.indices", "false" };
static settings::Bool draw_connection_flags{ "walkbot.draw.connection-flags", "true" }; static settings::Bool draw_connection_flags{ "walkbot.draw.connection-flags", "true" };
static settings::Bool free_move{ "walkbot.free-move", "true" }; static settings::Bool free_move{ "walkbot.free-move", "true" };
static settings::Bool spawn_distance{ "walkbot.edit.node-spawn-distance", "54" }; static settings::Int spawn_distance{ "walkbot.edit.node-spawn-distance", "54" };
static settings::Bool max_distance{ "walkbot.node-max-distance", "100" }; static settings::Int max_distance{ "walkbot.node-max-distance", "100" };
static settings::Bool reach_distance{ "walkbot.node-reach-distance", "32" }; static settings::Int reach_distance{ "walkbot.node-reach-distance", "32" };
static settings::Bool force_slot{ "walkbot.force-slot", "0" }; static settings::Int force_slot{ "walkbot.force-slot", "0" };
static settings::Bool leave_if_empty{ "walkbot.leave-if-empty", "false" }; static settings::Bool leave_if_empty{ "walkbot.leave-if-empty", "false" };
namespace hacks::shared::walkbot namespace hacks::shared::walkbot
@ -212,7 +212,7 @@ walkbot_node_s *closest()
// Global state // Global state
EWalkbotState state{ WB_DISABLED }; EWalkbotState state{ WB_DISABLED };
// g_pUserCmd->buttons state when last node was recorded // current_user_cmd->buttons state when last node was recorded
int last_node_buttons{ 0 }; int last_node_buttons{ 0 };
// Set to true when bot is moving to nearest node after dying/losing its active // Set to true when bot is moving to nearest node after dying/losing its active
@ -516,7 +516,7 @@ CatCommand c_delete_node("wb_delete", "Delete node",
CatCommand c_create_node("wb_create", "Create node", []() { CatCommand c_create_node("wb_create", "Create node", []() {
index_t node = CreateNode(g_pLocalPlayer->v_Origin); index_t node = CreateNode(g_pLocalPlayer->v_Origin);
auto &n = state::nodes[node]; auto &n = state::nodes[node];
if (g_pUserCmd->buttons & IN_DUCK) if (current_user_cmd->buttons & IN_DUCK)
n.flags |= NF_DUCK; n.flags |= NF_DUCK;
if (state::node_good(state::closest_node)) if (state::node_good(state::closest_node))
{ {
@ -883,14 +883,14 @@ index_t SelectNextNode()
// Release Sticky if > chargetime // Release Sticky if > chargetime
if ((chargetime >= 0.1f) && begansticky > 3) if ((chargetime >= 0.1f) && begansticky > 3)
{ {
g_pUserCmd->buttons &= ~IN_ATTACK; current_user_cmd->buttons &= ~IN_ATTACK;
hacks::shared::antiaim::SetSafeSpace(3); hacks::shared::antiaim::SetSafeSpace(3);
begansticky = 0; begansticky = 0;
} }
// Else just keep charging // Else just keep charging
else else
{ {
g_pUserCmd->buttons |= IN_ATTACK; current_user_cmd->buttons |= IN_ATTACK;
begansticky++; begansticky++;
} }
} }
@ -924,9 +924,9 @@ void UpdateSlot()
if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon)) if (re::C_BaseCombatWeapon::IsBaseCombatWeapon(weapon))
{ {
int slot = re::C_BaseCombatWeapon::GetSlot(weapon); int slot = re::C_BaseCombatWeapon::GetSlot(weapon);
if (slot != int(force_slot) - 1) if (slot != *force_slot - 1)
{ {
hack::ExecuteCommand(format("slot", int(force_slot))); hack::ExecuteCommand(format("slot", *force_slot));
} }
} }
} }
@ -936,7 +936,7 @@ void UpdateWalker()
free_move_used = false; free_move_used = false;
if (free_move) if (free_move)
{ {
if (g_pUserCmd->forwardmove != 0.0f or g_pUserCmd->sidemove != 0.0f) if (current_user_cmd->forwardmove != 0.0f or current_user_cmd->sidemove != 0.0f)
{ {
free_move_used = true; free_move_used = true;
return; return;
@ -946,7 +946,7 @@ void UpdateWalker()
static int jump_ticks = 0; static int jump_ticks = 0;
if (jump_ticks > 0) if (jump_ticks > 0)
{ {
g_pUserCmd->buttons |= IN_JUMP; current_user_cmd->buttons |= IN_JUMP;
jump_ticks--; jump_ticks--;
} }
bool timeout = std::chrono::duration_cast<std::chrono::seconds>( bool timeout = std::chrono::duration_cast<std::chrono::seconds>(
@ -963,15 +963,15 @@ void UpdateWalker()
{ {
auto &l = state::nodes[state::last_node]; auto &l = state::nodes[state::last_node];
if (l.flags & NF_DUCK) if (l.flags & NF_DUCK)
g_pUserCmd->buttons |= IN_DUCK; current_user_cmd->buttons |= IN_DUCK;
} }
float dist = distance_2d(n.xyz()); float dist = distance_2d(n.xyz());
if (dist > float(max_distance)) if (dist > *max_distance)
{ {
state::active_node = FindNearestNode(true); state::active_node = FindNearestNode(true);
state::recovery = true; state::recovery = true;
} }
if (dist < float(reach_distance)) if (dist < *reach_distance)
{ {
state::recovery = false; state::recovery = false;
index_t last = state::active_node; index_t last = state::active_node;
@ -982,8 +982,8 @@ void UpdateWalker()
{ {
if (state::nodes[state::active_node].flags & NF_JUMP) if (state::nodes[state::active_node].flags & NF_JUMP)
{ {
g_pUserCmd->buttons |= IN_DUCK; current_user_cmd->buttons |= IN_DUCK;
g_pUserCmd->buttons |= IN_JUMP; current_user_cmd->buttons |= IN_JUMP;
jump_ticks = 6; jump_ticks = 6;
} }
} }
@ -1003,17 +1003,17 @@ bool ShouldSpawnNode()
return true; return true;
bool was_jumping = state::last_node_buttons & IN_JUMP; bool was_jumping = state::last_node_buttons & IN_JUMP;
bool is_jumping = g_pUserCmd->buttons & IN_JUMP; bool is_jumping = current_user_cmd->buttons & IN_JUMP;
if (was_jumping != is_jumping and is_jumping) if (was_jumping != is_jumping and is_jumping)
return true; return true;
if ((state::last_node_buttons & IN_DUCK) != (g_pUserCmd->buttons & IN_DUCK)) if ((state::last_node_buttons & IN_DUCK) != (current_user_cmd->buttons & IN_DUCK))
return true; return true;
auto &node = state::nodes[state::active_node]; auto &node = state::nodes[state::active_node];
if (distance_2d(node.xyz()) > float(spawn_distance)) if (distance_2d(node.xyz()) > *spawn_distance)
{ {
return true; return true;
} }
@ -1025,9 +1025,9 @@ void RecordNode()
{ {
index_t node = CreateNode(g_pLocalPlayer->v_Origin); index_t node = CreateNode(g_pLocalPlayer->v_Origin);
auto &n = state::nodes[node]; auto &n = state::nodes[node];
if (g_pUserCmd->buttons & IN_DUCK) if (current_user_cmd->buttons & IN_DUCK)
n.flags |= NF_DUCK; n.flags |= NF_DUCK;
if (g_pUserCmd->buttons & IN_JUMP) if (current_user_cmd->buttons & IN_JUMP)
n.flags |= NF_JUMP; n.flags |= NF_JUMP;
if (state::node_good(state::active_node)) if (state::node_good(state::active_node))
{ {
@ -1037,7 +1037,7 @@ void RecordNode()
logging::Info("[wb] Node %u auto-linked to node %u at (%.2f %.2f %.2f)", logging::Info("[wb] Node %u auto-linked to node %u at (%.2f %.2f %.2f)",
node, state::active_node, c.x, c.y, c.z); node, state::active_node, c.x, c.y, c.z);
} }
state::last_node_buttons = g_pUserCmd->buttons; state::last_node_buttons = current_user_cmd->buttons;
state::active_node = node; state::active_node = node;
} }
@ -1222,7 +1222,7 @@ void Move()
case WB_RECORDING: case WB_RECORDING:
{ {
UpdateClosestNode(); UpdateClosestNode();
if (active_recording and ShouldSpawnNode()) if (recording_key.isKeyDown() and ShouldSpawnNode())
{ {
RecordNode(); RecordNode();
} }
@ -1253,7 +1253,7 @@ void Move()
} }
} }
} }
prevlvlname = g_IEngine->GetLevelName(); /*prevlvlname = g_IEngine->GetLevelName();
std::string prvlvlname(prevlvlname); std::string prvlvlname(prevlvlname);
if (boost::contains(prvlvlname, "pl_") || if (boost::contains(prvlvlname, "pl_") ||
boost::contains(prvlvlname, "cp_")) boost::contains(prvlvlname, "cp_"))
@ -1274,7 +1274,7 @@ void Move()
hacks::shared::followbot::roambot = 0; hacks::shared::followbot::roambot = 0;
hacks::shared::followbot::followcart = false; hacks::shared::followbot::followcart = false;
} }
} }*/
if (nodes.size() == 0) if (nodes.size() == 0)
return; return;
if (force_slot) if (force_slot)

View File

@ -37,7 +37,7 @@ void Init()
void Update(CachedEntity *player) void Update(CachedEntity *player)
{ {
if (not enabled) if (!enable)
return; return;
auto &data = data_table[player->m_IDX - 1]; auto &data = data_table[player->m_IDX - 1];
auto &am = amount[player->m_IDX - 1]; auto &am = amount[player->m_IDX - 1];
@ -97,7 +97,7 @@ void Update(CachedEntity *player)
void Event(KeyValues *event) void Event(KeyValues *event)
{ {
if (not enabled) if (!enable)
return; return;
if (!strcmp(event->GetName(), "player_death") || if (!strcmp(event->GetName(), "player_death") ||
!strcmp(event->GetName(), "player_hurt")) !strcmp(event->GetName(), "player_hurt"))

View File

@ -33,7 +33,7 @@ void Init()
void Update(CachedEntity *player) void Update(CachedEntity *player)
{ {
if (!enabled) if (!enable)
return; return;
int amount[32]; int amount[32];
auto &am = amount[player->m_IDX - 1]; auto &am = amount[player->m_IDX - 1];

View File

@ -10,9 +10,19 @@
#include "MiscTemporary.hpp" #include "MiscTemporary.hpp"
#include <link.h> #include <link.h>
#include <hacks/hacklist.hpp> #include <hacks/hacklist.hpp>
#include <settings/Bool.hpp>
#include <hacks/AntiAntiAim.hpp>
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
static settings::Bool minigun_jump{ "misc.minigun-jump-tf2c", "false" };
static settings::Bool nolerp{ "misc.no-lerp", "false" };
static settings::Button roll_speedhack{ "misc.roll-speedhack", "false" };
static settings::Bool engine_pred{ "misc.engine-prediction", "false" };
static settings::Bool debug_projectiles{ "debug.projectiles", "false" };
static settings::Int semiauto{ "misc.semi-auto", "0" };
static settings::Int fakelag_amount{ "misc.fakelag", "0" };
class CMoveData; class CMoveData;
#if LAGBOT_MODE #if LAGBOT_MODE
CatCommand set_value("set", "Set value", [](const CCommand &args) { CatCommand set_value("set", "Set value", [](const CCommand &args) {
@ -66,7 +76,7 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd)
g_GlobalVars->frametime = g_GlobalVars->interval_per_tick; g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;
*g_PredictionRandomSeed = *g_PredictionRandomSeed =
MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF; MD5_PseudoRandom(current_user_cmd->command_number) & 0x7FFFFFFF;
g_IGameMovement->StartTrackPredictionErrors( g_IGameMovement->StartTrackPredictionErrors(
reinterpret_cast<CBasePlayer *>(ent)); reinterpret_cast<CBasePlayer *>(ent));
oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData); oSetupMove(g_IPrediction, ent, ucmd, NULL, pMoveData);
@ -91,6 +101,9 @@ void RunEnginePrediction(IClientEntity *ent, CUserCmd *ucmd)
#endif #endif
const char *cmds[7] = { "use", "voicecommand", "spec_next", "spec_prev", const char *cmds[7] = { "use", "voicecommand", "spec_next", "spec_prev",
"spec_player", "invprev", "invnext" }; "spec_player", "invprev", "invnext" };
static int attackticks = 0;
namespace hooked_methods namespace hooked_methods
{ {
@ -116,8 +129,8 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
firstcm = false; firstcm = false;
} }
tickcount++; tickcount++;
g_pUserCmd = cmd; current_user_cmd = cmd;
#if not LAGBOT_MODE #if !LAGBOT_MODE
IF_GAME(IsTF2C()) IF_GAME(IsTF2C())
{ {
if (CE_GOOD(LOCAL_W) && minigun_jump && if (CE_GOOD(LOCAL_W) && minigun_jump &&
@ -137,7 +150,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
return ret; return ret;
} }
if (!cathook) if (!isHackActive())
{ {
g_Settings.is_create_move = false; g_Settings.is_create_move = false;
return ret; return ret;
@ -152,12 +165,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
// PROF_BEGIN(); // PROF_BEGIN();
if (g_pUserCmd && g_pUserCmd->command_number) if (current_user_cmd && current_user_cmd->command_number)
last_cmd_number = g_pUserCmd->command_number; last_cmd_number = current_user_cmd->command_number;
/**bSendPackets = true; /**bSendPackets = true;
if (hacks::shared::lagexploit::ExploitActive()) { if (hacks::shared::lagexploit::ExploitActive()) {
*bSendPackets = ((g_pUserCmd->command_number % 4) == 0); *bSendPackets = ((current_user_cmd->command_number % 4) == 0);
//logging::Info("%d", *bSendPackets); //logging::Info("%d", *bSendPackets);
}*/ }*/
@ -167,82 +180,9 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
time_replaced = false; time_replaced = false;
curtime_old = g_GlobalVars->curtime; curtime_old = g_GlobalVars->curtime;
hacks::tf2::global::runcfg();
static IClientEntity *enti;
if (resolver && cathook && CE_GOOD(LOCAL_E))
{
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{
if (i == g_IEngine->GetLocalPlayer())
continue;
enti = g_IEntityList->GetClientEntity(i);
if (enti && !enti->IsDormant() &&
!NET_BYTE(enti, netvar.iLifeState))
{
float quotat = 0;
float quotaf = 0;
if (!g_Settings.brute.choke[i].empty())
for (auto it : g_Settings.brute.choke[i])
{
if (it)
quotat++;
else
quotaf++;
}
float quota = quotat / quotaf;
Vector &angles = NET_VECTOR(enti, netvar.m_angEyeAngles);
static bool brutepitch = false;
if (g_Settings.brute.brutenum[i] > 5)
{
g_Settings.brute.brutenum[i] = 0;
brutepitch = !brutepitch;
}
angles.y = fmod(angles.y + 180.0f, 360.0f);
if (angles.y < 0)
angles.y += 360.0f;
angles.y -= 180.0f;
if (quota < 0.8f)
switch (g_Settings.brute.brutenum[i])
{
case 0:
break;
case 1:
angles.y += 180.0f;
break;
case 2:
angles.y -= 90.0f;
break;
case 3:
angles.y += 90.0f;
break;
case 4:
angles.y -= 180.0f;
break;
case 5:
angles.y = 0.0f;
break;
}
if (brutepitch || quota < 0.8f)
switch (g_Settings.brute.brutenum[i] % 4)
{
case 0:
break;
case 1:
angles.x = -89.0f;
break;
case 2:
angles.x = 89.0f;
break;
case 3:
angles.x = 0.0f;
break;
}
}
}
}
if (nolerp) if (nolerp)
{ {
// g_pUserCmd->tick_count += 1; // current_user_cmd->tick_count += 1;
if (sv_client_min_interp_ratio->GetInt() != -1) if (sv_client_min_interp_ratio->GetInt() != -1)
{ {
// sv_client_min_interp_ratio->m_nFlags = 0; // sv_client_min_interp_ratio->m_nFlags = 0;
@ -289,82 +229,24 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
g_Settings.bInvalid = false; g_Settings.bInvalid = false;
hacks::shared::autojoin::Update(); hacks::shared::autojoin::update();
{
PROF_SECTION(CM_AAA);
hacks::shared::anti_anti_aim::createMove();
}
#if ENABLE_IPC #if ENABLE_IPC
#if not LAGBOT_MODE #if !LAGBOT_MODE
static int team_joining_state = 0; if (hacks::shared::followbot::isEnabled())
static float last_jointeam_try = 0;
CachedEntity *found_entity, *ent;
if (hacks::shared::followbot::followbot)
{ {
hacks::shared::followbot::WorldTick(); hacks::shared::followbot::WorldTick();
if (g_GlobalVars->curtime < last_jointeam_try)
{
team_joining_state = 0;
last_jointeam_try = 0.0f;
}
if (!g_pLocalPlayer->team || (g_pLocalPlayer->team == TEAM_SPEC))
{
// if (!team_joining_state) logging::Info("Bad team, trying to
// join...");
team_joining_state = 1;
}
else
{
if (team_joining_state)
{
logging::Info("Trying to change CLASS");
g_IEngine->ExecuteClientCmd(
format("join_class ", joinclass.GetString()).c_str());
}
team_joining_state = 0;
}
if (team_joining_state)
{
found_entity = nullptr;
for (int i = 1; i < 32 && i < HIGHEST_ENTITY; i++)
{
ent = ENTITY(i);
if (CE_BAD(ent))
continue;
if (ent->player_info.friendsID ==
hacks::shared::followbot::steamid)
{
found_entity = ent;
break;
}
}
if (found_entity && CE_GOOD(found_entity))
{
if (jointeam &&
(g_GlobalVars->curtime - last_jointeam_try) > 1.0f)
{
last_jointeam_try = g_GlobalVars->curtime;
switch (CE_INT(found_entity, netvar.iTeamNum))
{
case TEAM_RED:
logging::Info("Trying to join team RED");
g_IEngine->ExecuteClientCmd("jointeam red");
break;
case TEAM_BLU:
logging::Info("Trying to join team BLUE");
g_IEngine->ExecuteClientCmd("jointeam blue");
break;
}
}
}
}
} }
#endif #endif
#endif #endif
if (CE_GOOD(g_pLocalPlayer->entity)) if (CE_GOOD(g_pLocalPlayer->entity))
{ {
#if not LAGBOT_MODE #if !LAGBOT_MODE
IF_GAME(IsTF2()) IF_GAME(IsTF2())
{ {
UpdateHoovyList(); UpdateHoovyList();
@ -383,7 +265,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
#endif #endif
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon())) if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
{ {
#if not LAGBOT_MODE #if !LAGBOT_MODE
{ {
PROF_SECTION(CM_walkbot); PROF_SECTION(CM_walkbot);
hacks::shared::walkbot::Move(); hacks::shared::walkbot::Move();
@ -414,7 +296,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
if (engine_pred) if (engine_pred)
engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E), engine_prediction::RunEnginePrediction(RAW_ENT(LOCAL_E),
g_pUserCmd); current_user_cmd);
{ {
PROF_SECTION(CM_backtracc); PROF_SECTION(CM_backtracc);
hacks::shared::backtrack::Run(); hacks::shared::backtrack::Run();
@ -423,22 +305,21 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
PROF_SECTION(CM_aimbot); PROF_SECTION(CM_aimbot);
hacks::shared::aimbot::CreateMove(); hacks::shared::aimbot::CreateMove();
} }
static int attackticks = 0; if (current_user_cmd->buttons & IN_ATTACK)
if (g_pUserCmd->buttons & IN_ATTACK)
++attackticks; ++attackticks;
else else
attackticks = 0; attackticks = 0;
if (semiauto) if (semiauto)
if (g_pUserCmd->buttons & IN_ATTACK) if (current_user_cmd->buttons & IN_ATTACK)
if (attackticks % int(semiauto) < int(semiauto) - 1) if (attackticks % *semiauto < *semiauto - 1)
g_pUserCmd->buttons &= ~IN_ATTACK; current_user_cmd->buttons &= ~IN_ATTACK;
static int fakelag_queue = 0; static int fakelag_queue = 0;
if (CE_GOOD(LOCAL_E)) if (CE_GOOD(LOCAL_E))
if (fakelag_amount) if (fakelag_amount)
{ {
*bSendPackets = int(fakelag_amount) == fakelag_queue; *bSendPackets = *fakelag_amount == fakelag_queue;
fakelag_queue++; fakelag_queue++;
if (fakelag_queue > int(fakelag_amount)) if (fakelag_queue > *fakelag_amount)
fakelag_queue = 0; fakelag_queue = 0;
} }
{ {
@ -489,7 +370,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
Prediction_CreateMove(); Prediction_CreateMove();
#endif #endif
} }
#if not LAGBOT_MODE #if !LAGBOT_MODE
{ {
PROF_SECTION(CM_misc); PROF_SECTION(CM_misc);
hacks::shared::misc::CreateMove(); hacks::shared::misc::CreateMove();
@ -501,9 +382,9 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
#endif #endif
{ {
PROF_SECTION(CM_spam); PROF_SECTION(CM_spam);
hacks::shared::spam::CreateMove(); hacks::shared::spam::createMove();
} }
#if not LAGBOT_MODE #if !LAGBOT_MODE
{ {
PROF_SECTION(CM_AC); PROF_SECTION(CM_AC);
hacks::shared::anticheat::CreateMove(); hacks::shared::anticheat::CreateMove();
@ -513,19 +394,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
if (time_replaced) if (time_replaced)
g_GlobalVars->curtime = curtime_old; g_GlobalVars->curtime = curtime_old;
g_Settings.bInvalid = false; g_Settings.bInvalid = false;
#if not LAGBOT_MODE #if !LAGBOT_MODE
{ {
PROF_SECTION(CM_chat_stack); PROF_SECTION(CM_chat_stack);
chat_stack::OnCreateMove(); chat_stack::OnCreateMove();
} }
{
PROF_SECTION(CM_healarrow);
hacks::tf2::healarrow::CreateMove();
}
{
PROF_SECTION(CM_lagexploit);
hacks::shared::lagexploit::CreateMove();
}
#endif #endif
// TODO Auto Steam Friend // TODO Auto Steam Friend
@ -541,14 +414,12 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
} }
#endif #endif
#if not LAGBOT_MODE #if !LAGBOT_MODE
hacks::shared::backtrack::UpdateIncomingSequences(); hacks::shared::backtrack::UpdateIncomingSequences();
if (CE_GOOD(g_pLocalPlayer->entity)) if (CE_GOOD(g_pLocalPlayer->entity))
{ {
speedapplied = false; speedapplied = false;
if (roll_speedhack && if (roll_speedhack.isKeyDown() &&
g_IInputSystem->IsButtonDown(
(ButtonCode_t)((int) roll_speedhack)) &&
!(cmd->buttons & IN_ATTACK)) !(cmd->buttons & IN_ATTACK))
{ {
speed = cmd->forwardmove; speed = cmd->forwardmove;
@ -587,8 +458,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
if (cmd && if (cmd &&
(cmd->buttons & IN_ATTACK || (cmd->buttons & IN_ATTACK ||
!(hacks::shared::antiaim::enabled && !(hacks::shared::antiaim::isEnabled() && !*bSendPackets)))
float(hacks::shared::antiaim::yaw_mode) >= 9 && !*bSendPackets)))
g_Settings.brute.last_angles[LOCAL_E->m_IDX] = cmd->viewangles; g_Settings.brute.last_angles[LOCAL_E->m_IDX] = cmd->viewangles;
for (int i = 0; i < g_IEngine->GetMaxClients(); i++) for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
{ {
@ -614,88 +484,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
} }
#endif #endif
int nextdata = 0;
NET_StringCmd senddata(cmds[nextdata]);
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
senddata.SetNetChannel(ch);
senddata.SetReliable(false);
if (servercrash && DelayTimer.check((int) delay * 1000))
{
for (int i = 0; i < 7800; i += sizeof(cmds[nextdata]))
{
senddata.m_szCommand = cmds[nextdata];
ch->SendNetMsg(senddata);
if (nextdata == 6)
nextdata = 0;
else
nextdata++;
}
ch->Transmit();
}
if (serverlag_amount || (votelogger::active &&
!votelogger::antikick.check(antikick_time * 1000)))
{
if (adjust && !votelogger::active)
{
if ((int) serverlag_amount == 1)
serverlag_amount = (int) serverlag_amount + 10;
if (ch->GetAvgData(FLOW_INCOMING) == prevflow)
{
if (prevflowticks > 66 * (int) adjust)
serverlag_amount = (int) serverlag_amount - 1;
prevflowticks++;
}
if (ch->GetAvgData(FLOW_INCOMING) != prevflow)
{
if (prevflowticks < 66 * (int) adjust)
serverlag_amount = (int) serverlag_amount + 4;
prevflowticks = 0;
}
}
if (votelogger::active &&
!votelogger::antikick.check(antikick_time * 1000))
{
static int additionallag = 1;
if (ch->GetAvgData(FLOW_INCOMING) == prevflow)
{
prevflowticks++;
}
else
prevflowticks = 0;
if (prevflowticks <= 10)
additionallag *= 0.1f;
for (int i = 0; i < 7800 + additionallag;
i += sizeof(cmds[nextdata]))
{
senddata.m_szCommand = cmds[nextdata];
ch->SendNetMsg(senddata, false);
if (nextdata == 6)
nextdata = 0;
else
nextdata++;
}
ch->Transmit();
}
else if (!votelogger::active && serverlag_amount &&
DelayTimer.check((int) delay * 1000))
{
for (int i = 0; i < (int) serverlag_amount; i++)
{
senddata.m_szCommand = cmds[nextdata];
if (nextdata == 6)
nextdata = 0;
else
nextdata++;
ch->SendNetMsg(senddata, false);
}
ch->Transmit();
}
prevflow = ch->GetAvgData(FLOW_INCOMING);
}
else if (votelogger::active &&
votelogger::antikick.test_and_set(antikick_time * 1000))
votelogger::active = false;
// PROF_END("CreateMove"); // PROF_END("CreateMove");
if (!(cmd->buttons & IN_ATTACK)) if (!(cmd->buttons & IN_ATTACK))
{ {
@ -716,9 +505,9 @@ void Start() {
IClientEntity* player = RAW_ENT(LOCAL_E); IClientEntity* player = RAW_ENT(LOCAL_E);
// CPredictableId::ResetInstanceCounters(); // CPredictableId::ResetInstanceCounters();
*(reinterpret_cast<CUserCmd*>(reinterpret_cast<uintptr_t>(player) + 1047)) = *(reinterpret_cast<CUserCmd*>(reinterpret_cast<uintptr_t>(player) + 1047)) =
g_pUserCmd; o_curtime = g_GlobalVars->curtime; o_frametime = current_user_cmd; o_curtime = g_GlobalVars->curtime; o_frametime =
g_GlobalVars->frametime; *g_PredictionRandomSeed = g_GlobalVars->frametime; *g_PredictionRandomSeed =
MD5_PseudoRandom(g_pUserCmd->command_number) & 0x7FFFFFFF; g_GlobalVars->curtime MD5_PseudoRandom(current_user_cmd->command_number) & 0x7FFFFFFF; g_GlobalVars->curtime
= CE_INT(LOCAL_E, netvar.nTickBase) * g_GlobalVars->interval_per_tick; = CE_INT(LOCAL_E, netvar.nTickBase) * g_GlobalVars->interval_per_tick;
g_GlobalVars->frametime = g_GlobalVars->interval_per_tick; g_GlobalVars->frametime = g_GlobalVars->interval_per_tick;

View File

@ -3,6 +3,7 @@
Copyright (c) 2018 nullworks. All rights reserved. Copyright (c) 2018 nullworks. All rights reserved.
*/ */
#include <EventLogging.hpp>
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
namespace hooked_methods namespace hooked_methods
@ -13,7 +14,8 @@ DEFINE_HOOKED_METHOD(FireGameEvent, void, void *this_, IGameEvent *event)
const char *name = event->GetName(); const char *name = event->GetName();
if (name) if (name)
{ {
if (event_log) #if ENABLE_VISUALS
if (event_logging::isEnabled())
{ {
if (!strcmp(name, "player_connect_client") || if (!strcmp(name, "player_connect_client") ||
!strcmp(name, "player_disconnect") || !strcmp(name, "player_disconnect") ||
@ -23,6 +25,7 @@ DEFINE_HOOKED_METHOD(FireGameEvent, void, void *this_, IGameEvent *event)
} }
} }
// hacks::tf2::killstreak::fire_event(event); // hacks::tf2::killstreak::fire_event(event);
#endif
} }
original::FireGameEvent(this_, event); original::FireGameEvent(this_, event);
} }

View File

@ -7,6 +7,7 @@
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
static settings::String ipc_name{ "name.ipc", "" }; static settings::String ipc_name{ "name.ipc", "" };
static settings::String force_name{ "name.custom", "" };
static settings::Int namesteal{ "name.namesteal", "0" }; static settings::Int namesteal{ "name.namesteal", "0" };
static std::string stolen_name; static std::string stolen_name;
@ -106,11 +107,11 @@ DEFINE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *this_,
#if ENABLE_IPC #if ENABLE_IPC
if (ipc::peer) if (ipc::peer)
{ {
static std::string namestr(ipc_name.GetString()); std::string namestr(*ipc_name);
namestr.assign(ipc_name.GetString());
if (namestr.length() > 3) if (namestr.length() > 3)
{ {
ReplaceString(namestr, "%%", std::to_string(ipc::peer->client_id)); ReplaceString(namestr, "%%", std::to_string(ipc::peer->client_id));
ReplaceString(namestr, "\\n", "\n");
return namestr.c_str(); return namestr.c_str();
} }
} }
@ -136,11 +137,10 @@ DEFINE_HOOKED_METHOD(GetFriendPersonaName, const char *, ISteamFriends *this_,
} }
} }
if ((strlen(force_name.GetString()) > 1) && if ((*force_name).size() > 1 &&
steam_id == g_ISteamUser->GetSteamID()) steam_id == g_ISteamUser->GetSteamID())
{ {
return force_name.toString().c_str();
return force_name_newlined;
} }
return original::GetFriendPersonaName(this_, steam_id); return original::GetFriendPersonaName(this_, steam_id);
} }

View File

@ -7,7 +7,7 @@
#include <settings/Bool.hpp> #include <settings/Bool.hpp>
#include "HookedMethods.hpp" #include "HookedMethods.hpp"
#include "MiscTemporary.hpp" #include "MiscTemporary.hpp"
#if not LAGBOT_MODE #if !LAGBOT_MODE
#include "hacks/Backtrack.hpp" #include "hacks/Backtrack.hpp"
#endif #endif
@ -45,55 +45,21 @@ const char *skynum[] = { "sky_tf2_04",
"sky_pyroland_01", "sky_pyroland_01",
"sky_pyroland_02", "sky_pyroland_02",
"sky_pyroland_03" }; "sky_pyroland_03" };
static CatEnum skys({ "sky_tf2_04",
"sky_upward",
"sky_dustbowl_01",
"sky_goldrush_01",
"sky_granary_01",
"sky_well_01",
"sky_gravel_01",
"sky_badlands_01",
"sky_hydro_01",
"sky_night_01",
"sky_nightfall_01",
"sky_trainyard_01",
"sky_stormfront_01",
"sky_morningsnow_01",
"sky_alpinestorm_01",
"sky_harvest_01",
"sky_harvest_night_01",
"sky_halloween",
"sky_halloween_night_01",
"sky_halloween_night2014_01",
"sky_island_01",
"sky_jungle_01",
"sky_invasion2fort_01",
"sky_well_02",
"sky_outpost_01",
"sky_coastal_01",
"sky_rainbow_01",
"sky_badlands_pyroland_01",
"sky_pyroland_01",
"sky_pyroland_02",
"sky_pyroland_03" });
namespace hooked_methods namespace hooked_methods
{ {
DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
{ {
#if not LAGBOT_MODE #if !LAGBOT_MODE
hacks::shared::backtrack::lastincomingsequencenumber = 0; hacks::shared::backtrack::lastincomingsequencenumber = 0;
hacks::shared::backtrack::sequences.clear(); hacks::shared::backtrack::sequences.clear();
#endif #endif
hacks::shared::autojoin::queuetime.update(); hacks::shared::autojoin::resetQueueTimer();
firstcm = true; firstcm = true;
#if not LAGBOT_MODE #if !LAGBOT_MODE
playerlist::Save(); playerlist::Save();
#endif #endif
#if not LAGBOT_MODE
hacks::shared::lagexploit::bcalled = false;
#endif
#if ENABLE_VISUALS #if ENABLE_VISUALS
typedef bool (*LoadNamedSkys_Fn)(const char *); typedef bool (*LoadNamedSkys_Fn)(const char *);
uintptr_t addr = gSignatures.GetEngineSignature( uintptr_t addr = gSignatures.GetEngineSignature(
@ -114,7 +80,7 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
#endif #endif
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
#if not LAGBOT_MODE #if !LAGBOT_MODE
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
hacks::shared::backtrack::Init(); hacks::shared::backtrack::Init();
chat_stack::Reset(); chat_stack::Reset();

View File

@ -12,13 +12,13 @@ namespace hooked_methods
DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_) DEFINE_HOOKED_METHOD(LevelShutdown, void, void *this_)
{ {
hacks::shared::autojoin::queuetime.update(); hacks::shared::autojoin::resetQueueTimer();
need_name_change = true; need_name_change = true;
#if not LAGBOT_MODE #if !LAGBOT_MODE
playerlist::Save(); playerlist::Save();
#endif #endif
g_Settings.bInvalid = true; g_Settings.bInvalid = true;
#if not LAGBOT_MODE #if !LAGBOT_MODE
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
chat_stack::Reset(); chat_stack::Reset();
hacks::shared::anticheat::ResetEverything(); hacks::shared::anticheat::ResetEverything();

View File

@ -28,10 +28,7 @@ DEFINE_HOOKED_METHOD(Paint, void, IEngineVGui *this_, PaintMode_t mode)
hacks::tf2::killstreak::apply_killstreaks(); hacks::tf2::killstreak::apply_killstreaks();
#endif #endif
hacks::shared::catbot::update(); hacks::shared::catbot::update();
if (hitrate::hitrate_check)
{
hitrate::Update(); hitrate::Update();
}
online::update(); online::update();
#if ENABLE_IPC #if ENABLE_IPC
static Timer nametimer{}; static Timer nametimer{};

View File

@ -9,6 +9,7 @@
static settings::Bool die_if_vac{ "misc.die-if-vac", "false" }; static settings::Bool die_if_vac{ "misc.die-if-vac", "false" };
static settings::Bool autoabandon{ "misc.auto-abandon", "false" }; static settings::Bool autoabandon{ "misc.auto-abandon", "false" };
static settings::String custom_disconnect_reason{ "misc.disconnect-reason", "" };
namespace hooked_methods namespace hooked_methods
{ {
@ -31,10 +32,10 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
#if ENABLE_IPC #if ENABLE_IPC
ipc::UpdateServerAddress(true); ipc::UpdateServerAddress(true);
#endif #endif
if (cathook && (disconnect_reason.convar_parent->m_StringLength > 3) && if (isHackActive() && (custom_disconnect_reason.toString().size() > 3) &&
strstr(reason, "user")) strstr(reason, "user"))
{ {
original::Shutdown(this_, disconnect_reason_newlined); original::Shutdown(this_, custom_disconnect_reason.toString().c_str());
} }
else else
{ {
@ -44,14 +45,8 @@ DEFINE_HOOKED_METHOD(Shutdown, void, INetChannel *this_, const char *reason)
if (autoabandon) if (autoabandon)
{ {
t.update(); t.update();
while (1) tfmm::disconnectAndAbandon();
if (t.test_and_set(5000))
{
tfmm::dcandabandon();
break;
} }
} hacks::shared::autojoin::onShutdown();
if (hacks::shared::autojoin::auto_queue)
tfmm::queue_start();
} }
} }

View File

@ -168,7 +168,7 @@ Vector EnginePrediction(CachedEntity *entity, float time)
Vector old_origin = entity->m_vecOrigin(); Vector old_origin = entity->m_vecOrigin();
NET_VECTOR(ent, 0x354) = entity->m_vecOrigin(); NET_VECTOR(ent, 0x354) = entity->m_vecOrigin();
//*g_PredictionRandomSeed = MD5_PseudoRandom(g_pUserCmd->command_number) & //*g_PredictionRandomSeed = MD5_PseudoRandom(current_user_cmd->command_number) &
// 0x7FFFFFFF; // 0x7FFFFFFF;
g_IGameMovement->StartTrackPredictionErrors( g_IGameMovement->StartTrackPredictionErrors(
reinterpret_cast<CBasePlayer *>(ent)); reinterpret_cast<CBasePlayer *>(ent));

View File

@ -174,3 +174,7 @@ InitRoutine init([]() {
g_IGameEventManager->AddListener(&listener, false); g_IGameEventManager->AddListener(&listener, false);
}); });
bool event_logging::isEnabled()
{
return *enable;
}