From df4b73caced2ad1c56c32a7399146c9ed7c33b30 Mon Sep 17 00:00:00 2001 From: LightCat Date: Fri, 13 Jul 2018 12:41:19 +0200 Subject: [PATCH 1/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 51cc91c1..9cd81377 100755 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ and a lot of useful features, including # INSTALLATION -## Automatic: (Ubuntu based only) +## Automatic: (Ubuntu based only, 17.10 and onwards) Run in terminal: * `wget https://raw.githubusercontent.com/nullworks/One-in-all-cathook-install/master/install-all && bash install-all` From d57a8c6a392c1997854183af0325a488f9c4ad52 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Wed, 18 Jul 2018 22:02:31 +0200 Subject: [PATCH 2/6] push with merge conflicts for Elite to fix --- include/MiscTemporary.hpp | 3 + include/helpers.hpp | 2 +- src/MiscTemporary.cpp | 5 +- src/copypasted/CSignature.cpp | 72 ++++++++++++-- src/hacks/Aimbot.cpp | 19 ++-- src/hacks/AntiAim.cpp | 130 +++++++++++++------------- src/hacks/AutoBackstab.cpp | 2 +- src/hacks/AutoHeal.cpp | 2 +- src/hacks/Backtrack.cpp | 22 +++-- src/hacks/ESP.cpp | 12 --- src/hacks/FollowBot.cpp | 114 ++++++++++++++-------- src/hacks/LightESP.cpp | 10 +- src/helpers.cpp | 17 ++-- src/hitrate.cpp | 46 ++++++++- src/hooks/CreateMove.cpp | 47 ++++------ src/hooks/visual/FrameStageNotify.cpp | 79 ++++++++-------- src/hooks/visual/PaintTraverse.cpp | 107 ++++++++++++++++++++- src/localplayer.cpp | 10 +- src/reclasses/CMakeLists.txt | 2 +- src/reclasses/CTFGCClientSystem.cpp | 13 ++- src/reclasses/CTFPartyClient.cpp | 4 +- src/trace.cpp | 2 +- 22 files changed, 479 insertions(+), 241 deletions(-) mode change 100755 => 100644 include/helpers.hpp mode change 100755 => 100644 src/trace.cpp diff --git a/include/MiscTemporary.hpp b/include/MiscTemporary.hpp index 48b2a1ef..3102ea90 100644 --- a/include/MiscTemporary.hpp +++ b/include/MiscTemporary.hpp @@ -9,6 +9,8 @@ // This is a temporary file to put code that needs moving/refactoring in. extern bool *bSendPackets; +extern std::array bruteint; +extern std::array timers; extern CatVar no_zoom; extern CatVar clean_screenshots; extern CatVar disable_visuals; @@ -23,6 +25,7 @@ extern CatVar serverlag_amount; extern CatVar servercrash; extern CatVar debug_projectiles; extern CatVar semiauto; +extern CatVar resolver; extern CatVar engine_pred; extern Timer DelayTimer; extern bool firstcm; diff --git a/include/helpers.hpp b/include/helpers.hpp old mode 100755 new mode 100644 index 03751cd8..3adc393d --- a/include/helpers.hpp +++ b/include/helpers.hpp @@ -81,7 +81,7 @@ Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist, bool checkWalkable); float vectorMax(Vector i); Vector vectorAbs(Vector i); -bool canReachVector(Vector loc, Vector dest = {0,0,0}); +bool canReachVector(Vector loc, Vector dest = { 0, 0, 0 }); bool isJumping(Vector vec); bool LineIntersectsBox(Vector &bmin, Vector &bmax, Vector &lmin, Vector &lmax); diff --git a/src/MiscTemporary.cpp b/src/MiscTemporary.cpp index dca4ed33..417615e0 100644 --- a/src/MiscTemporary.cpp +++ b/src/MiscTemporary.cpp @@ -4,6 +4,8 @@ */ #include "MiscTemporary.hpp" +std::array timers{}; +std::array bruteint{}; CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump", "Allows jumping while shooting with minigun"); @@ -25,7 +27,8 @@ CatVar serverlag_amount( CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", "Crash servers by spamming signon net messages"); CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); -bool *bSendPackets; +bool *bSendPackets = nullptr; +CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles"); CatVar crypt_chat( CV_SWITCH, "chat_crypto", "1", "Crypto chat", diff --git a/src/copypasted/CSignature.cpp b/src/copypasted/CSignature.cpp index 84e055b4..d624a404 100644 --- a/src/copypasted/CSignature.cpp +++ b/src/copypasted/CSignature.cpp @@ -3,12 +3,6 @@ #include "common.hpp" -#define INRANGE(x, a, b) (x >= a && x <= b) -#define getBits(x) \ - (INRANGE((x & (~0x20)), 'A', 'F') ? ((x & (~0x20)) - 'A' + 0xa) \ - : (INRANGE(x, '0', '9') ? x - '0' : 0)) -#define getByte(x) (getBits(x[0]) << 4 | getBits(x[1])) - // module should be a pointer to the base of an elf32 module // this is not the value returned by dlopen (which returns an opaque handle to // the module) the best method to get this address is with fopen() and mmap() @@ -51,9 +45,73 @@ Elf32_Shdr *getSectionHeader(void *module, const char *sectionName) } return 0; } +bool InRange(char x, char a, char b) +{ + return x >= a && x <= b; +} +int GetBits(char x) +{ + if (InRange((char) (x & (~0x20)), 'A', 'F')) + { + return (x & (~0x20)) - 'A' + 0xa; + } + else if (InRange(x, '0', '9')) + { + return x - '0'; + } + + return 0; +} +int GetBytes(const char *x) +{ + return GetBits(x[0]) << 4 | GetBits(x[1]); +} uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, const char *szPattern) +{ + const char *pattern = szPattern; + uintptr_t firstMatch = 0; + + uintptr_t start = dwAddress; + uintptr_t end = dwLength; + + for (uintptr_t pos = start; pos < end; pos++) + { + if (*pattern == 0) + return firstMatch; + + const uint8_t currentPattern = + *reinterpret_cast(pattern); + const uint8_t currentMemory = *reinterpret_cast(pos); + + if (currentPattern == '\?' || currentMemory == GetBytes(pattern)) + { + if (firstMatch == 0) + firstMatch = pos; + + if (pattern[2] == 0) + { + logging::Info("Found pattern \"%s\" at 0x%08X.", szPattern, + firstMatch); + return firstMatch; + } + + pattern += currentPattern != '\?' ? 3 : 2; + } + else + { + pattern = szPattern; + firstMatch = 0; + } + } + logging::Info("THIS IS SERIOUS: Could not locate signature: " + "\n============\n\"%s\"\n============", + szPattern); + return 0; +} +/*uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, + const char *szPattern) { const char *pat = szPattern; uintptr_t firstMatch = NULL; @@ -84,7 +142,7 @@ uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, szPattern); return NULL; -} +}*/ //=================================================================================== void *CSignature::GetModuleHandleSafe(const char *pszModuleName) { diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 1c52c229..30a54c76 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -182,8 +182,8 @@ bool BacktrackAimbot() { if (!hacks::shared::backtrack::enable || !backtrackAimbot) return false; - if (aimkey && !aimkey.KeyDown()) - return false; + if (aimkey && !aimkey.KeyDown()) + return false; if (CE_BAD(LOCAL_E) || !LOCAL_E->m_bAlivePlayer() || !CanShoot()) return false; @@ -194,14 +194,15 @@ bool BacktrackAimbot() int iBestTarget = hacks::shared::backtrack::iBestTarget; if (iBestTarget == -1) - return true; + return true; int tickcnt = 0; for (auto i : hacks::shared::backtrack::headPositions[iBestTarget]) { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != FLT_MAX) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && + hacks::shared::backtrack::sorted_ticks[j].tickcount != FLT_MAX) good_tick = true; tickcnt++; if (!i.hitboxpos.z) @@ -216,6 +217,7 @@ bool BacktrackAimbot() // ok just in case if (CE_BAD(tar)) continue; + //target_eid = tar->m_IDX; Vector &angles = NET_VECTOR(tar, netvar.m_angEyeAngles); float &simtime = NET_FLOAT(tar, netvar.m_flSimulationTime); angles.y = i.viewangles; @@ -232,11 +234,11 @@ bool BacktrackAimbot() else if (silent) g_pLocalPlayer->bUseSilentAngles = true; if (!slow_aim) - slow_can_shoot = true; + slow_can_shoot = true; // Set angles g_pUserCmd->viewangles = angles2; if (autoshoot && slow_can_shoot) - g_pUserCmd->buttons |= IN_ATTACK; + g_pUserCmd->buttons |= IN_ATTACK; return true; } return true; @@ -289,8 +291,6 @@ void CreateMove() g_pLocalPlayer->weapon_mode == weapon_throwable)) projectileAimbotRequired = true; - - // Local player check + Aimkey if (!aimkey_status || !ShouldAim()) return; @@ -308,7 +308,7 @@ void CreateMove() cur_proj_grav = float(proj_gravity); } if (BacktrackAimbot()) - return; + return; if (!g_IEntityList->GetClientEntity(target_entity->m_IDX)) return; @@ -325,6 +325,7 @@ void CreateMove() // Attemt to auto-shoot // flNextPrimaryAttack meme + //target_eid = target_entity->m_IDX; if (only_can_shoot) { diff --git a/src/hacks/AntiAim.cpp b/src/hacks/AntiAim.cpp index 38507506..742fdf74 100644 --- a/src/hacks/AntiAim.cpp +++ b/src/hacks/AntiAim.cpp @@ -6,27 +6,31 @@ */ #include +#include #include "common.hpp" namespace hacks::shared::antiaim { - CatVar communicate(CV_SWITCH, "identify", "0", "identify", "Auto identify for other cathook users"); CatVar enabled(CV_SWITCH, "aa_enabled", "0", "Anti-Aim", "Master AntiAim switch"); -static CatVar crouch(CV_SWITCH, "aa_fakecrouch", "0", "Fake Crouch", "Fake crouch"); +CatVar draw_fakes(CV_SWITCH, "aa_drawfakes", "1", "Draw Fakes", + "Draw a nice box around the head hitboxes"); +static CatVar crouch(CV_SWITCH, "aa_fakecrouch", "0", "Fake Crouch", + "Fake crouch"); static CatVar yaw(CV_FLOAT, "aa_yaw", "0.0", "Yaw", "Static yaw (left/right)", 360.0); static CatVar pitch(CV_FLOAT, "aa_pitch", "-89.0", "Pitch", "Static pitch (up/down)", -89.0, 89.0); -static CatEnum yaw_mode_enum({ "KEEP", "STATIC", "JITTER", - "BIGRANDOM", "RANDOM", "SPIN", - "OFFSETKEEP", "EDGE", "HECK", - "FAKEKEEP", "FAKESTATIC", "FAKEJITTER", - "FAKEBIGRANDOM", "FAKERANDOM", "FAKESPIN", - "FAKEOFFSETKEEP", "FAKEEDGE", "FAKEHECK", "FAKESIDEWAYS", "FAKELEFT", - "FAKERIGHT", "FAKEREVERSEEDGE"}); +static CatEnum yaw_mode_enum({ "KEEP", "STATIC", "JITTER", + "BIGRANDOM", "RANDOM", "SPIN", + "OFFSETKEEP", "EDGE", "HECK", + "FAKEKEEP", "FAKESTATIC", "FAKEJITTER", + "FAKEBIGRANDOM", "FAKERANDOM", "FAKESPIN", + "FAKEOFFSETKEEP", "FAKEEDGE", "FAKEHECK", + "FAKESIDEWAYS", "FAKELEFT", "FAKERIGHT", + "FAKEREVERSEEDGE" }); static CatEnum pitch_mode_enum({ "KEEP", "STATIC", "JITTER", "RANDOM", "FLIP", "FAKEFLIP", "FAKEUP", "FAKEDOWN", "FAKECENTER", "UP", "DOWN", "HECK" }); @@ -74,7 +78,7 @@ float GetAAAAPitch() case 1: return aaaa_stage ? 271 : 89; case 2: - return aaaa_stage ? -180 : 180; + return aaaa_stage ? -180 : 180; default: break; } @@ -388,59 +392,54 @@ float useEdge(float edgeViewAngle) Timer delay{}; int val = 0; int value[32] = { 0 }; -void FakeCrouch(CUserCmd * cmd) +void FakeCrouch(CUserCmd *cmd) { - if (!crouch) - return; - if (cmd->buttons & IN_ATTACK) - { - *bSendPackets = true; - return; - } - static bool bDuck = false; + if (!crouch) + return; + if (cmd->buttons & IN_ATTACK) + { + *bSendPackets = true; + return; + } + static bool bDuck = false; - static int waittime = 0; + static int waittime = 0; - if (waittime) - { - waittime--; - return; - } - bDuck = !bDuck; + if (waittime) + { + waittime--; + return; + } + bDuck = !bDuck; - if (bDuck) - { - cmd->buttons |= IN_DUCK; - *bSendPackets = false; - waittime = 15; - } - else{ - cmd->buttons &= ~IN_DUCK; - *bSendPackets = true; - } + if (bDuck) + { + cmd->buttons |= IN_DUCK; + *bSendPackets = false; + waittime = 15; + } + else + { + cmd->buttons &= ~IN_DUCK; + *bSendPackets = true; + } } void ProcessUserCmd(CUserCmd *cmd) { if (!enabled) + { + *bSendPackets = true; return; + } if (!ShouldAA(cmd)) return; - static bool angstate = true; - static bool keepmode = true; - keepmode = !keepmode; - if ((int) yaw_mode >= 8) - angstate = !angstate; - else - angstate = true; - if (!LOCAL_E->m_bAlivePlayer()) - angstate = true; - if (g_pUserCmd->buttons & IN_ATTACK || g_pUserCmd->buttons & IN_ATTACK2) - angstate = true; - *bSendPackets = angstate; - float &p = cmd->viewangles.x; - float &y = cmd->viewangles.y; - static bool flip = false; - bool clamp = !no_clamping; + static bool keepmode = true; + keepmode = !keepmode; + float &p = cmd->viewangles.x; + float &y = cmd->viewangles.y; + static bool flip = false; + static bool bsendflip = true; + bool clamp = !no_clamping; if (test) { cmd->viewangles.x = FLT_MAX; @@ -503,7 +502,6 @@ void ProcessUserCmd(CUserCmd *cmd) else y -= 90; break; - flip = !flip; } clamp = false; break; @@ -547,20 +545,20 @@ void ProcessUserCmd(CUserCmd *cmd) y += (float) yaw; break; case 16: // Fake edge - if (*bSendPackets) - { + if (*bSendPackets) + { // Attemt to find an edge and if found, edge if (findEdge(y)) y = useEdge(y); - } - break; + } + break; case 17: // Fake heck - if (*bSendPackets) - { + if (*bSendPackets) + { FuckYaw(y); clamp = false; - } - break; + } + break; case 18: // Fake sideways y += *bSendPackets ? 90.0f : -90.0f; break; @@ -571,13 +569,13 @@ void ProcessUserCmd(CUserCmd *cmd) y += !*bSendPackets ? 0.0f : 90.0f; break; case 21: // Fake reverse edge - if (*bSendPackets) - { + if (*bSendPackets) + { // Attemt to find an edge and if found, edge if (findEdge(y)) y = useEdge(y) + 180.0f; - } - break; + } + break; default: break; } @@ -625,7 +623,7 @@ void ProcessUserCmd(CUserCmd *cmd) clamp = false; } if (*bSendPackets) - flip = !flip; + flip = !flip; if (clamp) fClampAngle(cmd->viewangles); if (roll) diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index 3e0f853f..f1442423 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -71,7 +71,7 @@ void CreateMove() Vector &angles = NET_VECTOR(tar, netvar.m_angEyeAngles); float &simtime = NET_FLOAT(tar, netvar.m_flSimulationTime); angles.y = i.viewangles; - simtime = i.simtime; + simtime = i.simtime; g_pUserCmd->tick_count = i.tickcount; g_pUserCmd->buttons |= IN_ATTACK; break; diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp index 3bfabfcc..769c538f 100644 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -578,7 +578,7 @@ int HealingPriority(int idx) int overheal = maxoverheal - (maxbuffedhealth - health); float overhealp = ((float) overheal / (float) maxoverheal); float healthp = ((float) health / (float) maxhealth); - priority += hacks::shared::followbot::ClassPriority(ent) * 10; + priority += hacks::shared::followbot::ClassPriority(ent) * 1.3; switch (playerlist::AccessData(ent).state) { case playerlist::k_EState::FRIEND: diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 7cbc34ee..2c703fdb 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -102,10 +102,10 @@ void Run() } shouldDrawBt = true; - CUserCmd *cmd = g_pUserCmd; - float bestFov = 99999; - BestTick = 0; - iBestTarget = -1; + CUserCmd *cmd = g_pUserCmd; + float bestFov = 99999; + BestTick = 0; + iBestTarget = -1; float prev_distance = 9999; @@ -161,20 +161,26 @@ void Run() float bestFOV = 180.0f; float distance, prev_distance_ticks = 9999; +<<<<<<< Updated upstream for (int i = 0; i < 12; ++i) sorted_ticks[i] = BestTickData{INT_MAX, i}; +======= + for (int i = 0; i < 12; ++i) + sorted_ticks[i] = BestTickData{ FLT_MAX, i }; +>>>>>>> Stashed changes for (int t = 0; t < ticks; ++t) { - if (headPositions[iBestTarget][t].tickcount) - sorted_ticks[t] = - BestTickData{ headPositions[iBestTarget][t].tickcount, t }; + if (headPositions[iBestTarget][t].tickcount) + sorted_ticks[t] = + BestTickData{ headPositions[iBestTarget][t].tickcount, t }; } std::sort(sorted_ticks, sorted_ticks + ticks); for (int t = 0; t < ticks; ++t) { bool good_tick = false; for (int i = 0; i < 12; ++i) - if (t == sorted_ticks[i].tick && sorted_ticks[i].tickcount != FLT_MAX) + if (t == sorted_ticks[i].tick && + sorted_ticks[i].tickcount != FLT_MAX) good_tick = true; if (!good_tick) continue; diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index 8832b27e..457b71c9 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -308,7 +308,6 @@ struct bonelist_s }; std::unordered_map bonelist_map{}; - // Function called on draw void Draw() { @@ -505,17 +504,6 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent) // Get if ent should be transparent bool transparent = vischeck && ent_data.transparent; - // Bone esp - if (draw_bones && type == ENTITY_PLAYER) - { - const model_t *model = RAW_ENT(ent)->GetModel(); - if (model) - { - auto hdr = g_IModelInfo->GetStudiomodel(model); - bonelist_map[hdr].Draw(ent, fg); - } - } - // Tracers if (tracers && type == ENTITY_PLAYER) { diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index bb205159..e38f7748 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -54,8 +54,9 @@ static CatVar afk(CV_SWITCH, "fb_afk", "1", "Switch target if AFK", static CatVar afktime( CV_INT, "fb_afk_time", "15000", "Max AFK Time", "Max time in ms spent standing still before player gets declared afk"); -static CatVar corneractivate(CV_SWITCH, "fb_activation_corners", "1", "Activate arround corners", - "Try to find an activation path to an entity behind a corner."); +static CatVar corneractivate( + CV_SWITCH, "fb_activation_corners", "1", "Activate arround corners", + "Try to find an activation path to an entity behind a corner."); // Something to store breadcrumbs created by followed players static std::vector breadcrumbs; @@ -102,7 +103,9 @@ void addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin) int maxiterations = floor(corner.DistTo(g_pLocalPlayer->v_Origin)) / 40; for (int i = 0; i < maxiterations; i++) { - breadcrumbs.push_back(g_pLocalPlayer->v_Origin + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); + breadcrumbs.push_back(g_pLocalPlayer->v_Origin + + dist / vectorMax(vectorAbs(dist)) * 40.0f * + (i + 1)); } } @@ -110,34 +113,35 @@ void addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin) int maxiterations = floor(corner.DistTo(target->m_vecOrigin())) / 40; for (int i = 0; i < maxiterations; i++) { - breadcrumbs.push_back(corner + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); + breadcrumbs.push_back( + corner + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1)); } } -int ClassPriority(CachedEntity* ent) +int ClassPriority(CachedEntity *ent) { - switch (g_pPlayerResource->GetClass(ent)) - { - if (g_pPlayerResource->GetClass(ent) == tf_spy) - return 0; - case tf_engineer: - return 1; - case tf_medic: - return 2; - case tf_pyro: - return 3; - case tf_scout: - return 4; - case tf_sniper: - return 5; - case tf_demoman: - return 6; - case tf_soldier: - return 7; - case tf_heavy: - return 8; - default: - return 0; - } + switch (g_pPlayerResource->GetClass(ent)) + { + if (g_pPlayerResource->GetClass(ent) == tf_spy) + return 0; + case tf_engineer: + return 1; + case tf_medic: + return 2; + case tf_pyro: + return 3; + case tf_scout: + return 4; + case tf_sniper: + return 5; + case tf_demoman: + return 6; + case tf_soldier: + return 7; + case tf_heavy: + return 8; + default: + return 0; + } } void WorldTick() { @@ -183,7 +187,7 @@ void WorldTick() if (CE_BAD(entity)) // Exist + dormant continue; if (i == follow_target) - continue; + break; if (entity->m_Type() != ENTITY_PLAYER) continue; if (steamid != entity->player_info.friendsID) // steamid check @@ -193,10 +197,21 @@ void WorldTick() continue; if (corneractivate) { - Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250, true); //get the corner location that the future target is visible from - if (!indirectOrigin.z) //if we couldn't find it, exit + Vector indirectOrigin = + VischeckWall(LOCAL_E, entity, 250, + true); // get the corner location that the + // future target is visible from + if (!indirectOrigin.z) // if we couldn't find it, exit continue; +<<<<<<< Updated upstream addCrumbs(entity, indirectOrigin); +======= + breadcrumbs.clear(); // we need to ensure that the breadcrumbs + // std::vector is empty + breadcrumbs.push_back(indirectOrigin); // add the corner + // location to the + // breadcrumb list +>>>>>>> Stashed changes } else { @@ -209,10 +224,14 @@ void WorldTick() } // If we dont have a follow target from that, we look again for someone // else who is suitable - if ((!follow_target || change || (ClassPriority(ENTITY(follow_target)) < 6 && ENTITY(follow_target)->player_info.friendsID != steamid)) && roambot) + if ((!follow_target || change || + (ClassPriority(ENTITY(follow_target)) < 6 && + ENTITY(follow_target)->player_info.friendsID != steamid)) && + roambot) { // Try to get a new target - auto ent_count = followcart ? HIGHEST_ENTITY : g_IEngine->GetMaxClients(); + auto ent_count = + followcart ? HIGHEST_ENTITY : g_IEngine->GetMaxClients(); for (int i = 0; i < ent_count; i++) { auto entity = ENTITY(i); @@ -263,8 +282,11 @@ void WorldTick() if (corneractivate) { - Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250, true); //get the corner location that the future target is visible from - if (!indirectOrigin.z) //if we couldn't find it, exit + Vector indirectOrigin = + VischeckWall(LOCAL_E, entity, 250, + true); // get the corner location that the + // future target is visible from + if (!indirectOrigin.z) // if we couldn't find it, exit continue; addCrumbs(entity, indirectOrigin); } @@ -273,6 +295,18 @@ void WorldTick() if (!VisCheckEntFromEnt(LOCAL_E, entity)) continue; } +<<<<<<< Updated upstream +======= + // favor closer entitys + if (follow_target && + ENTITY(follow_target)->m_flDistance() > + entity->m_flDistance()) // favor closer entitys + { + if (ClassPriority(ENTITY(follow_target)) > + ClassPriority(entity)) + continue; + } +>>>>>>> Stashed changes // ooooo, a target follow_target = i; @@ -306,11 +340,11 @@ void WorldTick() } } -// if(!checkPath()) //wip do not merge if you see this -// { -// follow_target = 0; -// return; -// } + // if(!checkPath()) //wip do not merge if you see this + // { + // follow_target = 0; + // return; + // } // Update timer on new target static Timer idle_time{}; diff --git a/src/hacks/LightESP.cpp b/src/hacks/LightESP.cpp index 70689747..f7029901 100644 --- a/src/hacks/LightESP.cpp +++ b/src/hacks/LightESP.cpp @@ -53,14 +53,16 @@ void draw() CachedEntity *pEntity = ENTITY(i); if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer()) continue; + if (pEntity == LOCAL_E) + continue; Vector out; if (draw::WorldToScreen(hitp[i], out)) { float size; - if (abs(maxp[i].x - minp[i].x) > abs(maxp[i].y - minp[i].y)) - size = abs(maxp[i].x - minp[i].x); - else - size = abs(maxp[i].y - minp[i].y); + Vector pout, pout2; + if (draw::WorldToScreen(minp[i], pout) && + draw::WorldToScreen(maxp[i], pout2)) + size = fmaxf(fabsf(pout2.x - pout.x), fabsf(pout2.y - pout.y)); glez::draw::rect(out.x, out.y, size / 4, size / 4, hacks::shared::lightesp::LightESPColor(pEntity)); diff --git a/src/helpers.cpp b/src/helpers.cpp index 1867137e..cf3cd2e8 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -192,7 +192,8 @@ bool canReachVector(Vector loc, Vector dest) int maxiterations = floor(dest.DistTo(loc)) / 40; for (int i = 0; i < maxiterations; i++) { - Vector vec = loc + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1); + Vector vec = + loc + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1); trace_t trace; Ray_t ray; @@ -243,7 +244,8 @@ bool canReachVector(Vector loc, Vector dest) down.z = down.z - 50; ray.Init(loc, down); g_ITrace->TraceRay(ray, 0x4200400B, &trace::filter_no_player, &trace); - // higher to avoid small false positives, player can jump 42 hu according to + // higher to avoid small false positives, player can jump 42 hu + // according to // the tf2 wiki if (!(trace.startpos.DistTo(trace.endpos) <= 45)) return false; @@ -271,7 +273,8 @@ bool canReachVector(Vector loc, Vector dest) trace_t trace2; Ray_t ray2; ray2.Init(loc, directionalLoc); - g_ITrace->TraceRay(ray, 0x4200400B, &trace::filter_no_player, &trace2); + g_ITrace->TraceRay(ray, 0x4200400B, &trace::filter_no_player, + &trace2); // distance of trace < than 26 if (trace2.startpos.DistTo(trace2.endpos) < 26.0f) return false; @@ -984,11 +987,11 @@ bool IsVectorVisible(Vector origin, Vector target, bool enviroment_only) trace::filter_no_player.SetSelf(RAW_ENT(g_pLocalPlayer->entity)); ray.Init(origin, target); if (!enviroment_only) - g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_no_player, - &trace_visible); + g_ITrace->TraceRay(ray, MASK_SHOT_HULL, &trace::filter_no_player, + &trace_visible); else - g_ITrace->TraceRay(ray, 0x4200400B, &trace::filter_no_player, - &trace_visible); + g_ITrace->TraceRay(ray, 0x4200400B, &trace::filter_no_player, + &trace_visible); return (trace_visible.fraction == 1.0f); } diff --git a/src/hitrate.cpp b/src/hitrate.cpp index bb303f34..4b44b71c 100755 --- a/src/hitrate.cpp +++ b/src/hitrate.cpp @@ -6,6 +6,8 @@ */ #include "common.hpp" +#include +#include "MiscTemporary.hpp" #include "init.hpp" namespace hitrate @@ -58,7 +60,7 @@ CatCommand debug_ammo("debug_ammo", "Debug ammo", []() { logging::Info("%d %d", i, CE_INT(LOCAL_E, netvar.m_iAmmo + i * 4)); } }); - +std::deque entstocheck{}; void Update() { CachedEntity *weapon = LOCAL_W; @@ -67,14 +69,50 @@ void Update() if (LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) || LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap)) { + /*INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo(); + static int prevhits = count_hits; + int latency = ch->GetAvgLatency(MAX_FLOWS) * 1000 + 0.5f; + if (hacks::shared::aimbot::target_eid != -1 && !timers[hacks::shared::aimbot::target_eid].check(latency)) + { + if (count_hits > prevhits) + { + prevhits = count_hits; + timers[hacks::shared::aimbot::target_eid].update(); + } + }*/ // ONLY tracks primary ammo int ammo = CE_INT(LOCAL_E, netvar.m_iAmmo + 4); + if (lastweapon) { if (ammo < lastammo) { - OnShot(); + //for (auto i : entstocheck) + //{ + OnShot(); + /*static int prevent = 0; + + if (hacks::shared::aimbot::target_eid != prevent) + { + entstocheck.push_back(hacks::shared::aimbot::target_eid); + prevent = hacks::shared::aimbot::target_eid; + timers[hacks::shared::aimbot::target_eid].update(); + } + if (i != -1) + { + if (timers[i].test_and_set(latency)) + { + bruteint[i]++; + entstocheck[]; + } + } + } + }*/ } + /*else if (timers[hacks::shared::aimbot::target_eid].check(latency / 2)) + { + + }*/ } lastweapon = weapon->m_IDX; lastammo = ammo; @@ -91,7 +129,7 @@ class HurtListener : public IGameEventListener public: virtual void FireGameEvent(KeyValues *event) { - if (strcmp("player_hurt", event->GetName())) + if (strcmp("player_hurt", event->GetName()) || strcmp("player_death", event->GetName())) return; if (g_IEngine->GetPlayerForUserID(event->GetInt("attacker")) == g_IEngine->GetLocalPlayer()) @@ -99,7 +137,7 @@ public: if (CE_GOOD(LOCAL_W) && (LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) || LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap))) - OnHit(event->GetBool("crit")); + OnHit(strcmp("player_death", event->GetName()) ? event->GetBool("crit") : false); } } }; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index b42da318..a2ed9cca 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -304,7 +304,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, } #endif #endif - *bSendPackets = true; if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon())) { #if not LAGBOT_MODE @@ -347,26 +346,24 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, PROF_SECTION(CM_aimbot); hacks::shared::aimbot::CreateMove(); } - IF_GAME(IsTF2()) - { - PROF_SECTION(CM_antibackstab); - hacks::tf2::antibackstab::CreateMove(); - } static int attackticks = 0; if (g_pUserCmd->buttons & IN_ATTACK) ++attackticks; else attackticks = 0; if (semiauto) - { if (g_pUserCmd->buttons & IN_ATTACK) - { if (attackticks % int(semiauto) < int(semiauto) - 1) - { g_pUserCmd->buttons &= ~IN_ATTACK; - } + static int fakelag_queue = 0; + if (CE_GOOD(LOCAL_E)) + if (fakelag_amount) + { + *bSendPackets = int(fakelag_amount) == fakelag_queue; + fakelag_queue++; + if (fakelag_queue > int(fakelag_amount)) + fakelag_queue = 0; } - } { PROF_SECTION(CM_antiaim); hacks::shared::antiaim::ProcessUserCmd(cmd); @@ -396,6 +393,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, hacks::tf::autoheal::CreateMove(); } IF_GAME(IsTF2()) + { + PROF_SECTION(CM_antibackstab); + hacks::tf2::antibackstab::CreateMove(); + } + IF_GAME(IsTF2()) { PROF_SECTION(CM_autobackstab); hacks::tf2::autobackstab::CreateMove(); @@ -466,24 +468,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, hacks::shared::backtrack::UpdateIncomingSequences(); if (CE_GOOD(g_pLocalPlayer->entity)) { - static int fakelag_queue = 0; - if (fakelag_amount) - { - if (fakelag_queue == int(fakelag_amount) || - (g_pUserCmd->buttons & IN_ATTACK)) - { - *bSendPackets = true; - } - else if (fakelag_queue < int(fakelag_amount)) - { - *bSendPackets = false; - } - else - { - fakelag_queue = 0; - } - fakelag_queue++; - } speedapplied = false; if (roll_speedhack && g_IInputSystem->IsButtonDown( @@ -524,7 +508,10 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, ret = false; } - if (cmd) + if (cmd && + (cmd->buttons & IN_ATTACK || + !(hacks::shared::antiaim::enabled && + float(hacks::shared::antiaim::yaw_mode) >= 9 && !*bSendPackets))) g_Settings.last_angles = cmd->viewangles; } #endif diff --git a/src/hooks/visual/FrameStageNotify.cpp b/src/hooks/visual/FrameStageNotify.cpp index 64249a8a..957de814 100644 --- a/src/hooks/visual/FrameStageNotify.cpp +++ b/src/hooks/visual/FrameStageNotify.cpp @@ -9,55 +9,56 @@ #if not LAGBOT_MODE #include "hacks/Backtrack.hpp" #endif -static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles"); -static CatVar nightmode(CV_SWITCH, "nightmode", "0", "Enable nightmode", ""); + +static CatVar nightmode(CV_FLOAT, "nightmode", "0", "Enable nightmode", ""); namespace hooked_methods { DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_, ClientFrameStage_t stage) { - if (nightmode) + static float OldNightmode = 0.0f; + if (OldNightmode != (float) nightmode) { - static int OldNightmode = 0; - if (OldNightmode != (int) nightmode) + + static ConVar *r_DrawSpecificStaticProp = + g_ICvar->FindVar("r_DrawSpecificStaticProp"); + if (!r_DrawSpecificStaticProp) { - - static ConVar *r_DrawSpecificStaticProp = + r_DrawSpecificStaticProp = g_ICvar->FindVar("r_DrawSpecificStaticProp"); - if (!r_DrawSpecificStaticProp) - { - r_DrawSpecificStaticProp = - g_ICvar->FindVar("r_DrawSpecificStaticProp"); - return; - } - r_DrawSpecificStaticProp->SetValue(0); - - for (MaterialHandle_t i = g_IMaterialSystem->FirstMaterial(); - i != g_IMaterialSystem->InvalidMaterial(); - i = g_IMaterialSystem->NextMaterial(i)) - { - IMaterial *pMaterial = g_IMaterialSystem->GetMaterial(i); - - if (!pMaterial) - continue; - if (strstr(pMaterial->GetTextureGroupName(), "World") || - strstr(pMaterial->GetTextureGroupName(), "StaticProp")) - { - if (nightmode) - { - if (strstr(pMaterial->GetTextureGroupName(), - "StaticProp")) - pMaterial->ColorModulate(0.3f, 0.3f, 0.3f); - else - pMaterial->ColorModulate(0.05f, 0.05f, 0.05f); - } - else - pMaterial->ColorModulate(1.0f, 1.0f, 1.0f); - } - } - OldNightmode = nightmode; + return; } + r_DrawSpecificStaticProp->SetValue(0); + + for (MaterialHandle_t i = g_IMaterialSystem->FirstMaterial(); + i != g_IMaterialSystem->InvalidMaterial(); + i = g_IMaterialSystem->NextMaterial(i)) + { + IMaterial *pMaterial = g_IMaterialSystem->GetMaterial(i); + + if (!pMaterial) + continue; + if (strstr(pMaterial->GetTextureGroupName(), "World") || + strstr(pMaterial->GetTextureGroupName(), "StaticProp")) + { + if (float(nightmode) > 0.0f) + { + if (strstr(pMaterial->GetTextureGroupName(), "StaticProp")) + pMaterial->ColorModulate(1.0f - float(nightmode) / 100.0f, + 1.0f - float(nightmode) / 100.0f, + 1.0f - float(nightmode) / 100.0f); + else + pMaterial->ColorModulate( + (1.0f - float(nightmode) / 100.0f) / 6.0f, + (1.0f - float(nightmode) / 100.0f) / 6.0f, + (1.0f - float(nightmode) / 100.0f) / 6.0f); + } + else + pMaterial->ColorModulate(1.0f, 1.0f, 1.0f); + } + } + OldNightmode = nightmode; } static IClientEntity *ent; diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp index 0b87818c..aa4d1dc4 100644 --- a/src/hooks/visual/PaintTraverse.cpp +++ b/src/hooks/visual/PaintTraverse.cpp @@ -15,6 +15,17 @@ CatVar no_zoom(CV_SWITCH, "no_zoom", "0", "Disable scope", "Disables black scope overlay"); static CatVar pure_bypass(CV_SWITCH, "pure_bypass", "0", "Pure Bypass", "Bypass sv_pure"); +int spamdur = 0; +Timer joinspam{}; +CatCommand join_spam("join_spam", + "Spam joins server for X seconds", + [](const CCommand &args) { + if (args.ArgC() < 1) + return; + int id = atoi(args.Arg(1)); + joinspam.update(); + spamdur = id; + }); void *pure_orig = nullptr; void **pure_addr = nullptr; @@ -27,6 +38,34 @@ static CatVar static CatVar no_reportlimit(CV_SWITCH, "no_reportlimit", "0", "no report limit", "Remove playerlist report time limit"); +// static CatVar disable_ban_tf(CV_SWITCH, "disable_mm_ban", "0", "Disable MM +// ban", "Disable matchmaking ban"); +// static CatVar party_bypass(CV_SWITCH, "party_bypass", "0", "Party bypass", +// "Bypass the have to be friended restrictions on party"); +/*void JoinParty(uint32 steamid) +{ + CSteamID id(steamid, EUniverse::k_EUniversePublic, + EAccountType::k_EAccountTypeIndividual); +} +CatCommand join_party("join_party", "Join this players party (steamid3, no U:1: +and no [])", [](const CCommand &args) { + if (args.ArgC() < 1) + { + g_ICvar->ConsolePrintf("Please give a steamid3, thanks.\n"); + return; + } + + std::string tofind(args.Arg(1)); + if (tofind.find("[U:1:") || tofind.find("]")) + g_ICvar->ConsolePrintf("Invalid steamid3. Please remove the [U:1 and the +].\n"); + unsigned int id = atol(args.Arg(1)); + if (!id) + g_ICvar->ConsolePrintf("Invalid steamid3.\n"); + else + JoinParty(id); +});*/ + bool replaced = false; namespace hooked_methods { @@ -46,10 +85,74 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, #if ENABLE_VISUALS if (!textures_loaded) - { textures_loaded = true; - } #endif + static bool switcherido = false; + if (switcherido && spamdur && !joinspam.check(spamdur * 1000)) + { + auto gc = re::CTFGCClientSystem::GTFGCClientSystem(); + if (!gc) + goto label1; + gc->JoinMMMatch(); + } + else if (!joinspam.check(spamdur * 1000) && spamdur) + { + INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo(); + if (!ch) + goto label1; + ch->Shutdown("GET GOOD GET CATHOOK"); + } + label1: + /*static bool replacedparty = false; + if (party_bypass && !replacedparty) + { + static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + static unsigned char patch2[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; + static unsigned char patch3[] = { 0x90, 0x90}; + static unsigned char patch4[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; + uintptr_t addr = gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 7B ? + 8D 45"); + uintptr_t addr2 = gSignatures.GetClientSignature("0F 8F ? ? ? ? 80 BD ? + ? ? ? ? 0F 84 ? ? ? ? 80 BD"); + uintptr_t addr3 = gSignatures.GetClientSignature("74 ? E8 ? ? ? ? 89 + F1"); + uintptr_t addr4 = gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 45 ? + 8B 70 ? 8B 78 ? 8D 45"); + uintptr_t addr5 = gSignatures.GetClientSignature("89 C6 74 ? 8B 43 ? 85 + C0 74 ? 8B 10"); + if (addr && addr2 && addr3 && addr4 && addr5) + { + logging::Info("Party bypass: 0x%08X, 0x%08X, 0x%08X, 0x%08X", addr, + addr2, addr3, addr4); + Patch((void*) addr, (void *) patch, sizeof(patch)); + Patch((void*) addr2, (void *) patch2, sizeof(patch2)); + Patch((void*) addr3, (void *) patch3, sizeof(patch3)); + Patch((void*) addr4, (void *) patch4, sizeof(patch4)); + replacedparty = true; + } + else + logging::Info("No Party bypass Signature"); + } + static bool replacedban = false; + if (disable_ban_tf && !replacedban) + { + static unsigned char patch[] = { 0x31, 0xe0 }; + static unsigned char patch2[] = { 0xb0, 0x01, 0x90 }; + uintptr_t addr = gSignatures.GetClientSignature("31 C0 5B 5E 5F 5D C3 8D + B6 00 00 00 00 BA"); + uintptr_t addr2 = gSignatures.GetClientSignature("0F 92 C0 83 C4 ? 5B 5E + 5F 5D C3 8D B4 26 00 00 00 00 83 C4"); + if (addr && addr2) + { + logging::Info("MM Banned: 0x%08x, 0x%08x", addr, addr2); + Patch((void*) addr, (void *) patch, sizeof(patch)); + Patch((void*) addr2, (void *) patch2, sizeof(patch2)); + replacedban = true; + } + else + logging::Info("No disable ban Signature"); + + }*/ if (no_reportlimit && !replaced) { static unsigned char patch[] = { 0xB8, 0x01, 0x00, 0x00, 0x00 }; diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 6140d810..649c6e1d 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -7,11 +7,11 @@ #include "common.hpp" -CatCommand printfov( - "fov_print", "Dump achievements to file (development)", []() { - if (CE_GOOD(LOCAL_E)) - logging::Info("%d", CE_INT(LOCAL_E, netvar.iFOV)); - }); +CatCommand printfov("fov_print", "Dump achievements to file (development)", + []() { + if (CE_GOOD(LOCAL_E)) + logging::Info("%d", CE_INT(LOCAL_E, netvar.iFOV)); + }); void LocalPlayer::Update() { CachedEntity *wep; diff --git a/src/reclasses/CMakeLists.txt b/src/reclasses/CMakeLists.txt index 23e158b6..0739d958 100644 --- a/src/reclasses/CMakeLists.txt +++ b/src/reclasses/CMakeLists.txt @@ -1,7 +1,7 @@ target_sources(cathook PRIVATE "${CMAKE_CURRENT_LIST_DIR}/C_MannVsMachineStats.cpp" - "${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp" "${CMAKE_CURRENT_LIST_DIR}/CTFInventoryManager.cpp" "${CMAKE_CURRENT_LIST_DIR}/CTFPartyClient.cpp" "${CMAKE_CURRENT_LIST_DIR}/CTFParty.cpp" + "${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp" "${CMAKE_CURRENT_LIST_DIR}/ITFGroupMatchCriteria.cpp") \ No newline at end of file diff --git a/src/reclasses/CTFGCClientSystem.cpp b/src/reclasses/CTFGCClientSystem.cpp index df26d39b..4d7fd7bc 100644 --- a/src/reclasses/CTFGCClientSystem.cpp +++ b/src/reclasses/CTFGCClientSystem.cpp @@ -72,5 +72,16 @@ CTFParty *CTFGCClientSystem::GetParty() int CTFGCClientSystem::JoinMMMatch() { // TODO - return 0; + typedef int (*JoinMMMatch_t)(CTFGCClientSystem *); + static uintptr_t addr = + gSignatures.GetClientSignature("55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2"); + if (!addr) + { + logging::Info("calling NULL!"); + addr = gSignatures.GetClientSignature( + "55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2"); + return true; + } + static JoinMMMatch_t JoinMMMatch_fn = JoinMMMatch_t(addr); + return JoinMMMatch_fn(this); } diff --git a/src/reclasses/CTFPartyClient.cpp b/src/reclasses/CTFPartyClient.cpp index 1a17a917..5503511a 100644 --- a/src/reclasses/CTFPartyClient.cpp +++ b/src/reclasses/CTFPartyClient.cpp @@ -58,7 +58,9 @@ int re::CTFPartyClient::LoadSavedCasualCriteria() { typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *); uintptr_t addr = gSignatures.GetClientSignature( - "55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - 0x40; + "55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 " + "8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - + 0x40; LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = LoadSavedCasualCriteria_t(addr); diff --git a/src/trace.cpp b/src/trace.cpp old mode 100755 new mode 100644 index 381dd08d..f54885eb --- a/src/trace.cpp +++ b/src/trace.cpp @@ -79,7 +79,7 @@ void trace::FilterNoPlayer::SetSelf(IClientEntity *self) bool trace::FilterNoPlayer::ShouldHitEntity(IHandleEntity *handle, int mask) { - return false; + return false; IClientEntity *entity; ClientClass *clazz; From 29d4316c8385c64b3ab940261ebf9cd33459b480 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Wed, 18 Jul 2018 22:15:00 +0200 Subject: [PATCH 3/6] Fix merge conflicts --- src/hacks/Backtrack.cpp | 5 ----- src/hacks/FollowBot.cpp | 20 -------------------- 2 files changed, 25 deletions(-) diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 2c703fdb..66ee5215 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -161,13 +161,8 @@ void Run() float bestFOV = 180.0f; float distance, prev_distance_ticks = 9999; -<<<<<<< Updated upstream for (int i = 0; i < 12; ++i) sorted_ticks[i] = BestTickData{INT_MAX, i}; -======= - for (int i = 0; i < 12; ++i) - sorted_ticks[i] = BestTickData{ FLT_MAX, i }; ->>>>>>> Stashed changes for (int t = 0; t < ticks; ++t) { if (headPositions[iBestTarget][t].tickcount) diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index e38f7748..731d5b0f 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -203,15 +203,7 @@ void WorldTick() // future target is visible from if (!indirectOrigin.z) // if we couldn't find it, exit continue; -<<<<<<< Updated upstream addCrumbs(entity, indirectOrigin); -======= - breadcrumbs.clear(); // we need to ensure that the breadcrumbs - // std::vector is empty - breadcrumbs.push_back(indirectOrigin); // add the corner - // location to the - // breadcrumb list ->>>>>>> Stashed changes } else { @@ -295,18 +287,6 @@ void WorldTick() if (!VisCheckEntFromEnt(LOCAL_E, entity)) continue; } -<<<<<<< Updated upstream -======= - // favor closer entitys - if (follow_target && - ENTITY(follow_target)->m_flDistance() > - entity->m_flDistance()) // favor closer entitys - { - if (ClassPriority(ENTITY(follow_target)) > - ClassPriority(entity)) - continue; - } ->>>>>>> Stashed changes // ooooo, a target follow_target = i; From abca1bf89bb9705fb259a9ff89def0058dcaafa6 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Fri, 20 Jul 2018 14:45:42 +0200 Subject: [PATCH 4/6] Fix backtrack issues --- src/hacks/Aimbot.cpp | 2 +- src/hacks/AutoBackstab.cpp | 2 +- src/hacks/Backtrack.cpp | 8 +++++--- src/hacks/Trigger.cpp | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 30a54c76..70ec3dd3 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -202,7 +202,7 @@ bool BacktrackAimbot() bool good_tick = false; for (int j = 0; j < 12; ++j) if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && - hacks::shared::backtrack::sorted_ticks[j].tickcount != FLT_MAX) + hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!i.hitboxpos.z) diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index f1442423..73e302b0 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -52,7 +52,7 @@ void CreateMove() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!good_tick) diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 66ee5215..5140ffc2 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -9,8 +9,10 @@ #include "hacks/Backtrack.hpp" #include #include -#define IsMelee GetWeaponMode() == weapon_melee - +bool IsMelee() +{ + return GetWeaponMode() == weapon_melee; +} namespace hacks::shared::backtrack { CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", @@ -175,7 +177,7 @@ void Run() bool good_tick = false; for (int i = 0; i < 12; ++i) if (t == sorted_ticks[i].tick && - sorted_ticks[i].tickcount != FLT_MAX) + sorted_ticks[i].tickcount != INT_MAX && sorted_ticks[i].tickcount) good_tick = true; if (!good_tick) continue; diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index c302f412..7911e951 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -86,7 +86,7 @@ bool CanBacktrack() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!good_tick) From 89696118a079ff39b8cfdf784d595a42b2e03fd6 Mon Sep 17 00:00:00 2001 From: TotallyNotElite <1yourexperiment@protonmail.com> Date: Fri, 20 Jul 2018 21:05:27 +0200 Subject: [PATCH 5/6] Fix backtrack issues --- src/hacks/Aimbot.cpp | 3 ++- src/hacks/AutoBackstab.cpp | 2 +- src/hacks/Backtrack.cpp | 9 ++++++--- src/hacks/Trigger.cpp | 2 +- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 1c52c229..cf1a7a21 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -201,7 +201,8 @@ bool BacktrackAimbot() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != FLT_MAX) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && + hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!i.hitboxpos.z) diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index 3e0f853f..15cea298 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -52,7 +52,7 @@ void CreateMove() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!good_tick) diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 7cbc34ee..1b70ef1c 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -9,8 +9,10 @@ #include "hacks/Backtrack.hpp" #include #include -#define IsMelee GetWeaponMode() == weapon_melee - +bool IsMelee() +{ + return GetWeaponMode() == weapon_melee; +} namespace hacks::shared::backtrack { CatVar enable(CV_SWITCH, "backtrack", "0", "Enable backtrack", @@ -174,7 +176,8 @@ void Run() { bool good_tick = false; for (int i = 0; i < 12; ++i) - if (t == sorted_ticks[i].tick && sorted_ticks[i].tickcount != FLT_MAX) + if (t == sorted_ticks[i].tick && + sorted_ticks[i].tickcount != INT_MAX && sorted_ticks[i].tickcount) good_tick = true; if (!good_tick) continue; diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index c302f412..7911e951 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -86,7 +86,7 @@ bool CanBacktrack() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!good_tick) From c35e31e15232a3ef78392bb6c8766510babcedbb Mon Sep 17 00:00:00 2001 From: LightCat Date: Sat, 21 Jul 2018 15:27:07 +0200 Subject: [PATCH 6/6] Party bypass tm More bytepatches yay more bytepatches more bytepatches and fixes byte-patch who would have thought, more byte patches byte remove macos sig wow ok wrong patch bytepatch.so bytepatch no 14 More stuff --- include/reclasses/CTFPartyClient.hpp | 3 +- src/copypasted/CSignature.cpp | 10 ++ src/core/logging.cpp | 6 +- src/hack.cpp | 3 +- src/hacks/Aimbot.cpp | 8 +- src/hacks/AutoBackstab.cpp | 4 +- src/hacks/AutoJoin.cpp | 3 +- src/hacks/Backtrack.cpp | 9 +- src/hacks/CatBot.cpp | 46 ++++++++ src/hacks/FollowBot.cpp | 7 +- src/hacks/SpyAlert.cpp | 8 +- src/hacks/Trigger.cpp | 3 +- src/hacks/Walkbot.cpp | 5 +- src/helpers.cpp | 5 +- src/hitrate.cpp | 69 ++++++------ src/hooks/CreateMove.cpp | 4 +- src/hooks/DispatchUserMessage.cpp | 6 +- src/hooks/visual/FrameStageNotify.cpp | 7 +- src/hooks/visual/PaintTraverse.cpp | 154 +++++++++++++++++--------- src/reclasses/CTFGCClientSystem.cpp | 4 +- src/reclasses/CTFPartyClient.cpp | 43 +++++-- src/sdk/netmessage.cpp | 9 +- src/visual/EffectGlow.cpp | 2 +- 23 files changed, 285 insertions(+), 133 deletions(-) mode change 100755 => 100644 src/core/logging.cpp mode change 100755 => 100644 src/hitrate.cpp diff --git a/include/reclasses/CTFPartyClient.hpp b/include/reclasses/CTFPartyClient.hpp index ca27ac32..7b32678c 100755 --- a/include/reclasses/CTFPartyClient.hpp +++ b/include/reclasses/CTFPartyClient.hpp @@ -21,7 +21,8 @@ public: static bool BCanQueueForStandby(CTFPartyClient *this_); char RequestQueueForMatch(int type); char RequestLeaveForMatch(int type); - int BInvitePlayerToParty(int steamid); + int BInvitePlayerToParty(CSteamID steamid); + int BRequestJoinPlayer(CSteamID steamid); static bool BInQueue(CTFPartyClient *this_); }; } diff --git a/src/copypasted/CSignature.cpp b/src/copypasted/CSignature.cpp index d624a404..f12a2714 100644 --- a/src/copypasted/CSignature.cpp +++ b/src/copypasted/CSignature.cpp @@ -67,6 +67,16 @@ int GetBytes(const char *x) { return GetBits(x[0]) << 4 | GetBits(x[1]); } + +/* Shoutouts + * To + * Marc3842h + * for + * the + * way + * better + * sigscan + */ uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength, const char *szPattern) { diff --git a/src/core/logging.cpp b/src/core/logging.cpp old mode 100755 new mode 100644 index 235eb769..d09cbc35 --- a/src/core/logging.cpp +++ b/src/core/logging.cpp @@ -17,9 +17,9 @@ FILE *logging::handle = 0; void logging::Initialize() { // FIXME other method of naming the file? - passwd *pwd = getpwuid(getuid()); - logging::handle = - fopen(strfmt("/tmp/cathook-%s-%d.log", pwd->pw_name, getpid()).get(), "w"); + passwd *pwd = getpwuid(getuid()); + logging::handle = fopen( + strfmt("/tmp/cathook-%s-%d.log", pwd->pw_name, getpid()).get(), "w"); } void logging::Info(const char *fmt, ...) diff --git a/src/hack.cpp b/src/hack.cpp index f221c482..6338628c 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -279,7 +279,8 @@ void crit_err_hdlr(int sig_num, siginfo_t *info, void *ucontext) // just fprintf to stderr (or do both). passwd *pwd = getpwuid(getuid()); backtraceFile = fopen( - strfmt("/tmp/cathook-%s-%d-segfault.log", pwd->pw_name, getpid()).get(), "w"); + strfmt("/tmp/cathook-%s-%d-segfault.log", pwd->pw_name, getpid()).get(), + "w"); if (sig_num == SIGSEGV) fprintf(backtraceFile, "signal %d (%s), address is %p from %p\n", diff --git a/src/hacks/Aimbot.cpp b/src/hacks/Aimbot.cpp index 70ec3dd3..11222a44 100644 --- a/src/hacks/Aimbot.cpp +++ b/src/hacks/Aimbot.cpp @@ -158,8 +158,8 @@ static CatVar auto_zoom( "Automatically zoom in if you can see target, useful for followbots"); static CatVar auto_unzoom(CV_SWITCH, "aimbot_auto_unzoom", "0", "Auto Un-zoom", "Automatically unzoom"); -static CatVar backtrackAimbot(CV_SWITCH, "backtrack_aimbot", "0", "Backtrack Aimbot", - "Enable Backtrack Aimbot"); +static CatVar backtrackAimbot(CV_SWITCH, "backtrack_aimbot", "0", + "Backtrack Aimbot", "Enable Backtrack Aimbot"); // Current Entity int target_eid{ 0 }; @@ -217,7 +217,7 @@ bool BacktrackAimbot() // ok just in case if (CE_BAD(tar)) continue; - //target_eid = tar->m_IDX; + // target_eid = tar->m_IDX; Vector &angles = NET_VECTOR(tar, netvar.m_angEyeAngles); float &simtime = NET_FLOAT(tar, netvar.m_flSimulationTime); angles.y = i.viewangles; @@ -325,7 +325,7 @@ void CreateMove() // Attemt to auto-shoot // flNextPrimaryAttack meme - //target_eid = target_entity->m_IDX; + // target_eid = target_entity->m_IDX; if (only_can_shoot) { diff --git a/src/hacks/AutoBackstab.cpp b/src/hacks/AutoBackstab.cpp index 73e302b0..ff1ecff0 100644 --- a/src/hacks/AutoBackstab.cpp +++ b/src/hacks/AutoBackstab.cpp @@ -52,7 +52,9 @@ void CreateMove() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && + hacks::shared::backtrack::sorted_ticks[j].tickcount != + INT_MAX) good_tick = true; tickcnt++; if (!good_tick) diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index 1f0bbc86..6ec40044 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -97,7 +97,8 @@ void UpdateSearch() if (!gc->BConnectedToMatchServer(false) && queuetime.test_and_set(10 * 1000 * 60) && !gc->BHaveLiveMatch()) tfmm::queue_leave(); - if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch()) + if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch() && + autoqueue_timer.test_and_set(1000 * 30)) { logging::Info("Starting queue"); tfmm::queue_start(); diff --git a/src/hacks/Backtrack.cpp b/src/hacks/Backtrack.cpp index 5140ffc2..a9c44646 100644 --- a/src/hacks/Backtrack.cpp +++ b/src/hacks/Backtrack.cpp @@ -11,7 +11,7 @@ #include bool IsMelee() { - return GetWeaponMode() == weapon_melee; + return GetWeaponMode() == weapon_melee; } namespace hacks::shared::backtrack { @@ -163,8 +163,8 @@ void Run() float bestFOV = 180.0f; float distance, prev_distance_ticks = 9999; - for (int i = 0; i < 12; ++i) - sorted_ticks[i] = BestTickData{INT_MAX, i}; + for (int i = 0; i < 12; ++i) + sorted_ticks[i] = BestTickData{ INT_MAX, i }; for (int t = 0; t < ticks; ++t) { if (headPositions[iBestTarget][t].tickcount) @@ -177,7 +177,8 @@ void Run() bool good_tick = false; for (int i = 0; i < 12; ++i) if (t == sorted_ticks[i].tick && - sorted_ticks[i].tickcount != INT_MAX && sorted_ticks[i].tickcount) + sorted_ticks[i].tickcount != INT_MAX && + sorted_ticks[i].tickcount) good_tick = true; if (!good_tick) continue; diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp index 77accb49..49039be1 100644 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -29,6 +29,7 @@ static CatVar micspam_on(CV_INT, "cbu_micspam_on_interval", "3", "+voicerecord interval"); static CatVar micspam_off(CV_INT, "cbu_micspam_off_interval", "60", "-voicerecord interval"); +static CatVar auto_crouch(CV_SWITCH, "cbu_autocrouch", "1", "Auto crouch"); struct catbot_user_state { @@ -215,6 +216,49 @@ void reportall() } } CatCommand report("report_debug", "debug", []() { reportall(); }); +Timer crouchcdr{}; +void smart_crouch() +{ + bool foundtar = false; + static bool crouch = false; + if (crouchcdr.test_and_set(1000)) + { + for (int i = 0; i < g_IEngine->GetMaxClients(); i++) + { + auto ent = ENTITY(i); + if (CE_BAD(ent) || ent->m_iTeam() == LOCAL_E->m_iTeam() || + !(ent->hitboxes.GetHitbox(0)) || !(ent->m_bAlivePlayer()) || + playerlist::AccessData(ent).state == + playerlist::k_EState::FRIEND || + playerlist::AccessData(ent).state == + playerlist::k_EState::IPC || + should_ignore_player(ent)) + continue; + bool failedvis = false; + for (int j = -1; j < 18; j++) + if (IsEntityVisible(ent, j)) + failedvis = true; + if (failedvis) + continue; + for (int j = 0; j < 18; j++) + { + if (!LOCAL_E->hitboxes.GetHitbox(j)) + continue; + if (!IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->center) && !IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->min) && !IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->max)) + continue; + else + { + foundtar = true; + crouch = true; + } + } + } + if (!foundtar && crouch) + crouch = false; + } + if (crouch) + g_pUserCmd->buttons |= IN_DUCK; +} void update() { if (!enabled) @@ -239,6 +283,8 @@ void update() do_random_votekick(); if (timer_catbot_list.test_and_set(3000)) update_catbot_list(); + if (auto_crouch) + smart_crouch(); if (timer_abandon.test_and_set(2000) && level_init_timer.check(13000)) { count_bots = 0; diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 731d5b0f..c2041a1c 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -201,7 +201,7 @@ void WorldTick() VischeckWall(LOCAL_E, entity, 250, true); // get the corner location that the // future target is visible from - if (!indirectOrigin.z) // if we couldn't find it, exit + if (!indirectOrigin.z) // if we couldn't find it, exit continue; addCrumbs(entity, indirectOrigin); } @@ -269,7 +269,8 @@ void WorldTick() continue; } // check if new target has a higher priority than current target - if (ClassPriority(ENTITY(follow_target)) >= ClassPriority(ENTITY(i))) + if (ClassPriority(ENTITY(follow_target)) >= + ClassPriority(ENTITY(i))) continue; if (corneractivate) @@ -278,7 +279,7 @@ void WorldTick() VischeckWall(LOCAL_E, entity, 250, true); // get the corner location that the // future target is visible from - if (!indirectOrigin.z) // if we couldn't find it, exit + if (!indirectOrigin.z) // if we couldn't find it, exit continue; addCrumbs(entity, indirectOrigin); } diff --git a/src/hacks/SpyAlert.cpp b/src/hacks/SpyAlert.cpp index 13342dfd..f019a96d 100644 --- a/src/hacks/SpyAlert.cpp +++ b/src/hacks/SpyAlert.cpp @@ -22,11 +22,11 @@ static CatVar sound_alerts(CV_SWITCH, "spyalert_sound", "1", "Sound Alerts", "Demoman yells spy when a spy is within distance"); static CatVar sound_alert_interval(CV_FLOAT, "spyalert_interval", "3", "Alert Interval", "Sound alert interval"); -static CatVar voicemenu(CV_SWITCH, "spyalert_voice", "0", - "Voicemenu", "Inform other Players of a nearby Spy using the Voicemenu."); +static CatVar + voicemenu(CV_SWITCH, "spyalert_voice", "0", "Voicemenu", + "Inform other Players of a nearby Spy using the Voicemenu."); static CatVar invisible(CV_SWITCH, "spyalert_invisible", "0", - "Detect Invisible", "Detect invisible Spies."); - + "Detect Invisible", "Detect invisible Spies."); bool warning_triggered = false; bool backstab_triggered = false; diff --git a/src/hacks/Trigger.cpp b/src/hacks/Trigger.cpp index 7911e951..27f9df2d 100644 --- a/src/hacks/Trigger.cpp +++ b/src/hacks/Trigger.cpp @@ -86,7 +86,8 @@ bool CanBacktrack() { bool good_tick = false; for (int j = 0; j < 12; ++j) - if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) + if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && + hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX) good_tick = true; tickcnt++; if (!good_tick) diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index c15c0584..8cc83e8e 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -1260,9 +1260,8 @@ void Move() } } } - prevlvlname = g_IEngine->GetLevelName(); - std::string prvlvlname = format(prevlvlname); - logging::Info("%s %s", prevlvlname, prvlvlname.c_str()); + prevlvlname = g_IEngine->GetLevelName(); + std::string prvlvlname(prevlvlname); if (boost::contains(prvlvlname, "pl_") || boost::contains(prvlvlname, "cp_")) { diff --git a/src/helpers.cpp b/src/helpers.cpp index cf3cd2e8..005c9a90 100644 --- a/src/helpers.cpp +++ b/src/helpers.cpp @@ -1245,7 +1245,8 @@ void PrintChat(const char *fmt, ...) va_end(list); std::unique_ptr str(strfmt("\x07%06X[\x07%06XCAT\x07%06X]\x01 %s", 0x5e3252, 0xba3d9a, 0x5e3252, - buf.get()).get()); + buf.get()) + .get()); // FIXME DEBUG LOG logging::Info("%s", str.get()); chat->Printf(str.get()); @@ -1259,7 +1260,7 @@ void PrintChat(const char *fmt, ...) // does it on its own std::unique_ptr strfmt(const char *fmt, ...) { - //char *buf = new char[1024]; + // char *buf = new char[1024]; auto buf = std::make_unique(1024); va_list list; va_start(list, fmt); diff --git a/src/hitrate.cpp b/src/hitrate.cpp old mode 100755 new mode 100644 index 4b44b71c..cb6438d6 --- a/src/hitrate.cpp +++ b/src/hitrate.cpp @@ -69,16 +69,17 @@ void Update() if (LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) || LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap)) { - /*INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo(); - static int prevhits = count_hits; - int latency = ch->GetAvgLatency(MAX_FLOWS) * 1000 + 0.5f; - if (hacks::shared::aimbot::target_eid != -1 && !timers[hacks::shared::aimbot::target_eid].check(latency)) + /*INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo(); + static int prevhits = count_hits; + int latency = ch->GetAvgLatency(MAX_FLOWS) * 1000 + 0.5f; + if (hacks::shared::aimbot::target_eid != -1 && + !timers[hacks::shared::aimbot::target_eid].check(latency)) { - if (count_hits > prevhits) - { - prevhits = count_hits; - timers[hacks::shared::aimbot::target_eid].update(); - } + if (count_hits > prevhits) + { + prevhits = count_hits; + timers[hacks::shared::aimbot::target_eid].update(); + } }*/ // ONLY tracks primary ammo int ammo = CE_INT(LOCAL_E, netvar.m_iAmmo + 4); @@ -87,29 +88,30 @@ void Update() { if (ammo < lastammo) { - //for (auto i : entstocheck) - //{ - OnShot(); - /*static int prevent = 0; + // for (auto i : entstocheck) + //{ + OnShot(); + /*static int prevent = 0; - if (hacks::shared::aimbot::target_eid != prevent) - { - entstocheck.push_back(hacks::shared::aimbot::target_eid); - prevent = hacks::shared::aimbot::target_eid; - timers[hacks::shared::aimbot::target_eid].update(); - } - if (i != -1) - { - if (timers[i].test_and_set(latency)) - { - bruteint[i]++; - entstocheck[]; - } - } - } - }*/ + if (hacks::shared::aimbot::target_eid != prevent) + { + entstocheck.push_back(hacks::shared::aimbot::target_eid); + prevent = hacks::shared::aimbot::target_eid; + timers[hacks::shared::aimbot::target_eid].update(); + } + if (i != -1) + { + if (timers[i].test_and_set(latency)) + { + bruteint[i]++; + entstocheck[]; + } + } + } + }*/ } - /*else if (timers[hacks::shared::aimbot::target_eid].check(latency / 2)) + /*else if + (timers[hacks::shared::aimbot::target_eid].check(latency / 2)) { }*/ @@ -129,7 +131,8 @@ class HurtListener : public IGameEventListener public: virtual void FireGameEvent(KeyValues *event) { - if (strcmp("player_hurt", event->GetName()) || strcmp("player_death", event->GetName())) + if (strcmp("player_hurt", event->GetName()) || + strcmp("player_death", event->GetName())) return; if (g_IEngine->GetPlayerForUserID(event->GetInt("attacker")) == g_IEngine->GetLocalPlayer()) @@ -137,7 +140,9 @@ public: if (CE_GOOD(LOCAL_W) && (LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) || LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap))) - OnHit(strcmp("player_death", event->GetName()) ? event->GetBool("crit") : false); + OnHit(strcmp("player_death", event->GetName()) + ? event->GetBool("crit") + : false); } } }; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index a2ed9cca..346a3a3b 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -359,9 +359,9 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, if (CE_GOOD(LOCAL_E)) if (fakelag_amount) { - *bSendPackets = int(fakelag_amount) == fakelag_queue; + *bSendPackets = int(fakelag_amount) == fakelag_queue; fakelag_queue++; - if (fakelag_queue > int(fakelag_amount)) + if (fakelag_queue > int(fakelag_amount)) fakelag_queue = 0; } { diff --git a/src/hooks/DispatchUserMessage.cpp b/src/hooks/DispatchUserMessage.cpp index 675a5aee..4d71ad2a 100644 --- a/src/hooks/DispatchUserMessage.cpp +++ b/src/hooks/DispatchUserMessage.cpp @@ -22,7 +22,11 @@ static CatVar chat_filter(CV_STRING, "chat_censor", "", "Censor words", "said, seperate with commas"); static CatVar chat_filter_enabled(CV_SWITCH, "chat_censor_enabled", "0", "Enable censor", "Censor Words in chat"); -const std::string clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; +const std::string clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" + "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"; std::string lastfilter{}; std::string lastname{}; diff --git a/src/hooks/visual/FrameStageNotify.cpp b/src/hooks/visual/FrameStageNotify.cpp index 957de814..42e50d53 100644 --- a/src/hooks/visual/FrameStageNotify.cpp +++ b/src/hooks/visual/FrameStageNotify.cpp @@ -45,9 +45,10 @@ DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_, if (float(nightmode) > 0.0f) { if (strstr(pMaterial->GetTextureGroupName(), "StaticProp")) - pMaterial->ColorModulate(1.0f - float(nightmode) / 100.0f, - 1.0f - float(nightmode) / 100.0f, - 1.0f - float(nightmode) / 100.0f); + pMaterial->ColorModulate( + 1.0f - float(nightmode) / 100.0f, + 1.0f - float(nightmode) / 100.0f, + 1.0f - float(nightmode) / 100.0f); else pMaterial->ColorModulate( (1.0f - float(nightmode) / 100.0f) / 6.0f, diff --git a/src/hooks/visual/PaintTraverse.cpp b/src/hooks/visual/PaintTraverse.cpp index aa4d1dc4..fb694da5 100644 --- a/src/hooks/visual/PaintTraverse.cpp +++ b/src/hooks/visual/PaintTraverse.cpp @@ -17,15 +17,18 @@ static CatVar pure_bypass(CV_SWITCH, "pure_bypass", "0", "Pure Bypass", "Bypass sv_pure"); int spamdur = 0; Timer joinspam{}; -CatCommand join_spam("join_spam", - "Spam joins server for X seconds", - [](const CCommand &args) { - if (args.ArgC() < 1) - return; - int id = atoi(args.Arg(1)); - joinspam.update(); - spamdur = id; - }); +CatCommand join_spam("join_spam", "Spam joins server for X seconds", + [](const CCommand &args) { + if (args.ArgC() < 1) + return; + int id = atoi(args.Arg(1)); + joinspam.update(); + spamdur = id; + }); + +CatVar waittime(CV_INT, "join_debug_time", "2500", "wait time", + "Wait this many Paint Traverse Calls between each join (~2500 " + "recommended, higher if slower internet)"); void *pure_orig = nullptr; void **pure_addr = nullptr; @@ -40,13 +43,24 @@ static CatVar no_reportlimit(CV_SWITCH, "no_reportlimit", "0", "Remove playerlist report time limit"); // static CatVar disable_ban_tf(CV_SWITCH, "disable_mm_ban", "0", "Disable MM // ban", "Disable matchmaking ban"); -// static CatVar party_bypass(CV_SWITCH, "party_bypass", "0", "Party bypass", -// "Bypass the have to be friended restrictions on party"); -/*void JoinParty(uint32 steamid) +/*static CatVar + party_bypass(CV_SWITCH, "party_bypass", "0", "Party bypass", + "Bypass the have to be friended restrictions on party"); +void JoinParty(uint32 steamid) { CSteamID id(steamid, EUniverse::k_EUniversePublic, EAccountType::k_EAccountTypeIndividual); + re::CTFPartyClient *party = re::CTFPartyClient::GTFPartyClient(); + party->BRequestJoinPlayer(id); } +CatCommand join_party("join_party", + "Join party of target user with this steamid3", + [](const CCommand &args) { + if (args.ArgC() < 1) + return; + unsigned int steamid = atol(args.Arg(1)); + JoinParty(steamid); + }); CatCommand join_party("join_party", "Join this players party (steamid3, no U:1: and no [])", [](const CCommand &args) { if (args.ArgC() < 1) @@ -88,51 +102,91 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_, textures_loaded = true; #endif static bool switcherido = false; - if (switcherido && spamdur && !joinspam.check(spamdur * 1000)) + static int scndwait = 0; + if (scndwait > int(waittime)) { - auto gc = re::CTFGCClientSystem::GTFGCClientSystem(); - if (!gc) - goto label1; - gc->JoinMMMatch(); - } - else if (!joinspam.check(spamdur * 1000) && spamdur) - { - INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo(); - if (!ch) - goto label1; - ch->Shutdown("GET GOOD GET CATHOOK"); - } - label1: - /*static bool replacedparty = false; - if (party_bypass && !replacedparty) - { - static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; - static unsigned char patch2[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; - static unsigned char patch3[] = { 0x90, 0x90}; - static unsigned char patch4[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; - uintptr_t addr = gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 7B ? - 8D 45"); - uintptr_t addr2 = gSignatures.GetClientSignature("0F 8F ? ? ? ? 80 BD ? - ? ? ? ? 0F 84 ? ? ? ? 80 BD"); - uintptr_t addr3 = gSignatures.GetClientSignature("74 ? E8 ? ? ? ? 89 - F1"); - uintptr_t addr4 = gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 45 ? - 8B 70 ? 8B 78 ? 8D 45"); - uintptr_t addr5 = gSignatures.GetClientSignature("89 C6 74 ? 8B 43 ? 85 - C0 74 ? 8B 10"); - if (addr && addr2 && addr3 && addr4 && addr5) + scndwait = 0; + if (switcherido && spamdur && !joinspam.check(spamdur * 1000)) { - logging::Info("Party bypass: 0x%08X, 0x%08X, 0x%08X, 0x%08X", addr, - addr2, addr3, addr4); - Patch((void*) addr, (void *) patch, sizeof(patch)); - Patch((void*) addr2, (void *) patch2, sizeof(patch2)); - Patch((void*) addr3, (void *) patch3, sizeof(patch3)); - Patch((void*) addr4, (void *) patch4, sizeof(patch4)); + auto gc = re::CTFGCClientSystem::GTFGCClientSystem(); + if (!gc) + goto label1; + gc->JoinMMMatch(); + } + else if (!joinspam.check(spamdur * 1000) && spamdur) + { + INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo(); + if (!ch) + goto label1; + ch->Shutdown(""); + } + } +label1: + scndwait++; + switcherido = !switcherido; + /*static bool replacedparty = false; + static int callcnt = 0; + if (party_bypass && !replacedparty && callcnt < 5) + { + callcnt++; + static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; + static unsigned char patch2[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; + static unsigned char patch3[] = { 0x90, 0x90 }; + static unsigned char patch4[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 }; + static unsigned char patch5[] = { 0x89, 0xDE }; + static unsigned char patch6[] = { 0x90, 0xE9 }; + static unsigned char patch7[] = { 0x90, 0x90, 0x90, 0x90, 0x90 }; + uintptr_t addr = + gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 7B ? 8D 45"); + uintptr_t addr2 = gSignatures.GetClientSignature( + "0F 8F ? ? ? ? 80 BD ? ? ? ? ? 0F 84 ? ? ? ? 80 BD"); + uintptr_t addr3 = + gSignatures.GetClientSignature("74 ? E8 ? ? ? ? 89 F1"); + uintptr_t addr4 = gSignatures.GetClientSignature( + "0F 84 ? ? ? ? 8B 45 ? 8B 70 ? 8B 78 ? 8D 45"); + uintptr_t addr5 = gSignatures.GetClientSignature( + "89 C6 74 ? 8B 43 ? 85 C0 74 ? 8B 10"); + uintptr_t addr6 = gSignatures.GetClientSignature( + "0F 85 ? ? ? ? E8 ? ? ? ? C7 04 24 ? ? ? ? 89 44 24 ?"); + uintptr_t addr7 = gSignatures.GetClientSignature( + "E8 ? ? ? ? 83 C3 ? 39 5D ? 0F 8F ? ? ? ? 80 BD ? ? ? ? ?"); + uintptr_t addr8 = gSignatures.GetClientSignature( + "E8 ? ? ? ? C7 44 24 ? ? ? ? ? 89 1C 24 E8 ? ? ? ? E9 ? ? ? ? 8D " + "B6 00 00 00 00"); + uintptr_t addr9 = gSignatures.GetClientSignature( + "E8 ? ? ? ? A1 ? ? ? ? 8B 10 89 04 24 FF 52 ? 89 1C 24"); + uintptr_t addr10 = gSignatures.GetClientSignature( + "74 ? 83 BB ? ? ? ? ? 0F 84 ? ? ? ? E8"); + uintptr_t addr11 = gSignatures.GetClientSignature( + "0F 85 ? ? ? ? 8B 45 ? 8D 75 ? 31 DB"); + uintptr_t addr12 = gSignatures.GetClientSignature( + "E8 ? ? ? ? 83 C3 ? 39 9D ? ? ? ? 0F 8F ? ? ? ? 80 BD"); + if (addr && addr2 && addr3 && addr4 && addr5 && addr6 && addr7 && + addr8 && addr9 && addr10 && addr11 && addr12) + { + logging::Info("Party bypass: 0x%08X, 0x%08X, 0x%08X, 0x%08X, " + "0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, " + "0x%08X, 0x%08X, 0x%08X, 0x%08X", + addr, addr2, addr3, addr4, addr5, addr6, addr7, addr8, + addr9, addr10, addr11, addr12); + Patch((void *) addr, (void *) patch, sizeof(patch)); + Patch((void *) addr2, (void *) patch2, sizeof(patch2)); + Patch((void *) addr3, (void *) patch3, sizeof(patch3)); + Patch((void *) addr4, (void *) patch4, sizeof(patch4)); + Patch((void *) addr5, (void *) patch5, sizeof(patch5)); + Patch((void *) addr6, (void *) patch6, sizeof(patch6)); + Patch((void *) addr7, (void *) patch7, sizeof(patch7)); + Patch((void *) addr8 + 0x49, (void *) patch7, sizeof(patch7)); + Patch((void *) addr9, (void *) patch7, sizeof(patch7)); + Patch((void *) addr10, (void *) patch3, sizeof(patch3)); + Patch((void *) addr11, (void *) patch6, sizeof(patch6)); + Patch((void *) addr12, (void *) patch7, sizeof(patch7)); replacedparty = true; } else logging::Info("No Party bypass Signature"); } + /* static bool replacedban = false; if (disable_ban_tf && !replacedban) { diff --git a/src/reclasses/CTFGCClientSystem.cpp b/src/reclasses/CTFGCClientSystem.cpp index 4d7fd7bc..a44b17b1 100644 --- a/src/reclasses/CTFGCClientSystem.cpp +++ b/src/reclasses/CTFGCClientSystem.cpp @@ -73,8 +73,8 @@ int CTFGCClientSystem::JoinMMMatch() { // TODO typedef int (*JoinMMMatch_t)(CTFGCClientSystem *); - static uintptr_t addr = - gSignatures.GetClientSignature("55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2"); + static uintptr_t addr = gSignatures.GetClientSignature( + "55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2"); if (!addr) { logging::Info("calling NULL!"); diff --git a/src/reclasses/CTFPartyClient.cpp b/src/reclasses/CTFPartyClient.cpp index 5503511a..1bbd9458 100644 --- a/src/reclasses/CTFPartyClient.cpp +++ b/src/reclasses/CTFPartyClient.cpp @@ -11,9 +11,9 @@ re::CTFPartyClient *re::CTFPartyClient::GTFPartyClient() { typedef re::CTFPartyClient *(*GTFPartyClient_t)(void); - uintptr_t addr = gSignatures.GetClientSignature( + static uintptr_t addr = gSignatures.GetClientSignature( "55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ? 85 C0"); - GTFPartyClient_t GTFPartyClient_fn = GTFPartyClient_t(addr); + static GTFPartyClient_t GTFPartyClient_fn = GTFPartyClient_t(addr); return GTFPartyClient_fn(); } @@ -57,11 +57,12 @@ re::CTFPartyClient::MutLocalGroupCriteria(re::CTFPartyClient *client) int re::CTFPartyClient::LoadSavedCasualCriteria() { typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *); - uintptr_t addr = gSignatures.GetClientSignature( - "55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 " - "8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - - 0x40; - LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = + static uintptr_t addr = + gSignatures.GetClientSignature( + "55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 " + "8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - + 0x40; + static LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = LoadSavedCasualCriteria_t(addr); return LoadSavedCasualCriteria_fn(this); @@ -70,9 +71,9 @@ int re::CTFPartyClient::LoadSavedCasualCriteria() char re::CTFPartyClient::RequestQueueForMatch(int type) { typedef char (*RequestQueueForMatch_t)(re::CTFPartyClient *, int); - uintptr_t addr = gSignatures.GetClientSignature( + static uintptr_t addr = gSignatures.GetClientSignature( "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? E8"); - RequestQueueForMatch_t RequestQueueForMatch_fn = + static RequestQueueForMatch_t RequestQueueForMatch_fn = RequestQueueForMatch_t(addr); return RequestQueueForMatch_fn(this, type); @@ -80,11 +81,31 @@ char re::CTFPartyClient::RequestQueueForMatch(int type) char re::CTFPartyClient::RequestLeaveForMatch(int type) { typedef char (*RequestLeaveForMatch_t)(re::CTFPartyClient *, int); - uintptr_t addr = gSignatures.GetClientSignature( + static uintptr_t addr = gSignatures.GetClientSignature( "55 89 E5 57 56 53 83 EC ? 8B 45 ? 89 44 24 ? 8B 45 ? 89 04 24 E8 ? ? " "? ? 84 C0 89 C6 75"); - RequestLeaveForMatch_t RequestLeaveForMatch_fn = + static RequestLeaveForMatch_t RequestLeaveForMatch_fn = RequestLeaveForMatch_t(addr); return RequestLeaveForMatch_fn(this, type); } +int re::CTFPartyClient::BInvitePlayerToParty(CSteamID steamid) +{ + typedef int (*BInvitePlayerToParty_t)(re::CTFPartyClient *, CSteamID, bool); + static uintptr_t addr = gSignatures.GetClientSignature( + "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? 8B 5D ? 8B 55 ? 89 85 ? ? ? ? " + "65 A1 ? ? ? ? 89 45 ? 31 C0 8B 45"); + static BInvitePlayerToParty_t BInvitePlayerToParty_fn = + BInvitePlayerToParty_t(addr); + return BInvitePlayerToParty_fn(this, steamid, false); +} +int re::CTFPartyClient::BRequestJoinPlayer(CSteamID steamid) +{ + typedef int (*BRequestJoinPlayer_t)(re::CTFPartyClient *, CSteamID, bool); + static uintptr_t addr = gSignatures.GetClientSignature( + "55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? 8B 5D ? 8B 55 ? 89 85 ? ? ? ? " + "65 A1 ? ? ? ? 89 45 ? 31 C0 8B 45"); + static BRequestJoinPlayer_t BRequestJoinPlayer_fn = + BRequestJoinPlayer_t(addr); + return BRequestJoinPlayer_fn(this, steamid, false); +} diff --git a/src/sdk/netmessage.cpp b/src/sdk/netmessage.cpp index a9899884..09873729 100644 --- a/src/sdk/netmessage.cpp +++ b/src/sdk/netmessage.cpp @@ -370,7 +370,8 @@ bool CLC_RespondCvarValue::ReadFromBuffer(bf_read &buffer) const char *CLC_RespondCvarValue::ToString(void) const { return strfmt("%s: status: %d, value: %s, cookie: %d", GetName(), - m_eStatusCode, m_szCvarValue, m_iCookie).get(); + m_eStatusCode, m_szCvarValue, m_iCookie) + .get(); } bool NET_NOP::WriteToBuffer(bf_write &buffer) @@ -409,7 +410,8 @@ bool NET_SignonState::ReadFromBuffer(bf_read &buffer) const char *NET_SignonState::ToString(void) const { return strfmt("net_SignonState: state %i, count %i", m_nSignonState, - m_nSpawnCount).get(); + m_nSpawnCount) + .get(); } const char *CLC_VoiceData::ToString(void) const @@ -443,7 +445,8 @@ bool CLC_VoiceData::ReadFromBuffer(bf_read &buffer) const char *CLC_Move::ToString(void) const { return strfmt("%s: backup %i, new %i, bytes %i", GetName(), m_nNewCommands, - m_nBackupCommands, Bits2Bytes(m_nLength)).get(); + m_nBackupCommands, Bits2Bytes(m_nLength)) + .get(); } bool CLC_Move::WriteToBuffer(bf_write &buffer) diff --git a/src/visual/EffectGlow.cpp b/src/visual/EffectGlow.cpp index e9884f18..8c8ae8ad 100644 --- a/src/visual/EffectGlow.cpp +++ b/src/visual/EffectGlow.cpp @@ -112,7 +112,7 @@ ITexture *GetBuffer(int i) TEXTURE_GROUP_RENDER_TARGET); else fullframe = g_IMaterialSystemHL->FindTexture( "_rt_FullFrameFB", TEXTURE_GROUP_RENDER_TARGET); - //char *newname = new char[32]; + // char *newname = new char[32]; std::unique_ptr newname(new char[32]); std::string name = format("_cathook_buff", i); strncpy(newname.get(), name.c_str(), 30);