From 060a1bc95fa87e5ebdf0ce3919aaa197c2685837 Mon Sep 17 00:00:00 2001 From: BenCat07 Date: Sat, 28 Apr 2018 11:43:31 +0200 Subject: [PATCH] use > voicemenu --- include/hacks/FollowBot.hpp | 2 + include/reclasses/CTFInventoryManager.hpp | 13 ++-- src/hacks/Achievement.cpp | 9 +-- src/hacks/AutoEquip.cpp | 7 +- src/hacks/AutoHeal.cpp | 5 +- src/hacks/AutoJoin.cpp | 5 +- src/hacks/CatBot.cpp | 2 +- src/hacks/FollowBot.cpp | 32 ++++++--- src/hacks/Misc.cpp | 33 +++++---- src/hacks/Walkbot.cpp | 88 ++++------------------- src/hooks/CreateMove.cpp | 27 +++---- src/hooks/others.cpp | 2 +- src/reclasses/CTFInventoryManager.cpp | 58 +++++++++------ src/votelogger.cpp | 13 ++-- 14 files changed, 141 insertions(+), 155 deletions(-) mode change 100755 => 100644 src/hacks/Achievement.cpp mode change 100755 => 100644 src/hacks/AutoHeal.cpp mode change 100755 => 100644 src/hacks/CatBot.cpp diff --git a/include/hacks/FollowBot.hpp b/include/hacks/FollowBot.hpp index 1ec3e0ca..f23cef26 100644 --- a/include/hacks/FollowBot.hpp +++ b/include/hacks/FollowBot.hpp @@ -16,7 +16,9 @@ namespace followbot // Followed entity, externed for highlight color extern int follow_target; +extern bool followcart; extern CatVar followbot; +extern CatVar roambot; extern CatVar follow_steam; void DrawTick(); void WorldTick(); diff --git a/include/reclasses/CTFInventoryManager.hpp b/include/reclasses/CTFInventoryManager.hpp index febf5bdb..8ddbc726 100644 --- a/include/reclasses/CTFInventoryManager.hpp +++ b/include/reclasses/CTFInventoryManager.hpp @@ -7,7 +7,8 @@ #pragma once #include "common.hpp" -namespace re { +namespace re +{ class CTFInventoryManager { public: @@ -22,11 +23,13 @@ class CEconItem public: unsigned long long uniqueid(); }; -class CTFPlayerInventory { +class CTFPlayerInventory +{ public: - CTFPlayerInventory() = delete; - static CTFPlayerInventory *GTFPlayerInventory(); + CTFPlayerInventory() = delete; + static CTFPlayerInventory *GTFPlayerInventory(); + public: - CEconItem *GetFirstItemOfItemDef(int id); + CEconItem *GetFirstItemOfItemDef(int id); }; } diff --git a/src/hacks/Achievement.cpp b/src/hacks/Achievement.cpp old mode 100755 new mode 100644 index a9e01dfc..a3edf8ad --- a/src/hacks/Achievement.cpp +++ b/src/hacks/Achievement.cpp @@ -39,10 +39,11 @@ void Lock() void Unlock() { - /*auto Invmng = re::CTFInventoryManager::GTFInventoryManager(); - auto Inv = re::CTFPlayerInventory::GTFPlayerInventory(); - auto Item = Inv->GetFirstItemOfItemDef(59); - Invmng->EquipItemInLoadout(0, 0, (unsigned long long int)Item->uniqueid());*/ + /*auto Invmng = re::CTFInventoryManager::GTFInventoryManager(); + auto Inv = re::CTFPlayerInventory::GTFPlayerInventory(); + auto Item = Inv->GetFirstItemOfItemDef(59); + Invmng->EquipItemInLoadout(0, 0, (unsigned long long + int)Item->uniqueid());*/ if (safety) { ConColorMsg( diff --git a/src/hacks/AutoEquip.cpp b/src/hacks/AutoEquip.cpp index a94b7bb7..06fd0814 100644 --- a/src/hacks/AutoEquip.cpp +++ b/src/hacks/AutoEquip.cpp @@ -6,7 +6,8 @@ */ #include "common.hpp" -void CreateMove() { - auto preset = g_ICvar->FindCommand("load_itempreset"); - const CCommand cmd; +void CreateMove() +{ + auto preset = g_ICvar->FindCommand("load_itempreset"); + const CCommand cmd; } diff --git a/src/hacks/AutoHeal.cpp b/src/hacks/AutoHeal.cpp old mode 100755 new mode 100644 index f4326464..388623b6 --- a/src/hacks/AutoHeal.cpp +++ b/src/hacks/AutoHeal.cpp @@ -44,7 +44,8 @@ static CatEnum vacc_sniper_enum({ "NEVER", "ZOOM & VISIBLE", "ANY ZOOMED" }); static CatVar vacc_sniper(vacc_sniper_enum, "auto_vacc_sniper_pop", "1", "Pop if Sniper", "Defines Auto-Vacc behaviour with snipers"); -static CatVar ignore(CV_STRING, "autoheal_ignore", "", "Ignore", "Ignore people with this name"); +static CatVar ignore(CV_STRING, "autoheal_ignore", "", "Ignore", + "Ignore people with this name"); int ChargeCount() { @@ -566,7 +567,7 @@ int HealingPriority(int idx) g_IEngine->GetPlayerInfo(idx, &info); info.name[31] = 0; if (strcasestr(info.name, ignore.GetString())) - priority = 0.0f; + priority = 0.0f; return priority; } diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp index e26ec14b..aacd00f9 100644 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -49,7 +49,7 @@ Timer req_timer{}; "Bypass Party restrictions");*/ void UpdateSearch() { - // segfaults for no reason + // segfaults for no reason /*static bool calld = false; if (party_bypass && !calld) { static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90}; @@ -90,7 +90,8 @@ void UpdateSearch() tfmm::queue_start(); } } - if (req_timer.test_and_set(1800000)) { + if (req_timer.test_and_set(1800000)) + { logging::Info("Starting queue"); tfmm::queue_start(); } diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp old mode 100755 new mode 100644 index 84de4218..3150b4fd --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -118,7 +118,7 @@ void update_catbot_list() if (strcasestr(info.name, "cat-bot") || strcasestr(info.name, "just disable vac tf") || strcasestr(info.name, "raul.garcia") || - strcasestr(info.name, "zCat") || + strcasestr(info.name, "zCat") || strcasestr(info.name, "lagger bot")) { if (human_detecting_map.find(info.friendsID) == diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index e2e007b9..d4f64bcc 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -17,8 +17,9 @@ namespace followbot CatVar followbot(CV_SWITCH, "fb", "0", "Followbot Switch", "Set to 1 in followbots' configs"); -static CatVar roambot(CV_SWITCH, "fb_roaming", "1", "Roambot", - "Followbot will roam free, finding targets it can"); +bool followcart = false; +CatVar roambot(CV_SWITCH, "fb_roaming", "1", "Roambot", + "Followbot will roam free, finding targets it can"); static CatVar draw_crumb(CV_SWITCH, "fb_draw", "1", "Draw crumbs", "Self explanitory"); static CatVar follow_distance(CV_INT, "fb_distance", "175", "Follow Distance", @@ -103,25 +104,38 @@ void WorldTick() if ((!follow_target || change) && roambot) { // Try to get a new target - auto ent_count = g_IEngine->GetMaxClients(); - for (int i = 0; i < ent_count; i++) + auto ent_count = HIGHEST_ENTITY; + for (int i = 0; i < HIGHEST_ENTITY; i++) { auto entity = ENTITY(i); if (CE_BAD(entity)) // Exist + dormant continue; - if (entity->m_Type != ENTITY_PLAYER) - continue; + if (!followcart) + if (entity->m_Type != ENTITY_PLAYER) + continue; if (entity == LOCAL_E) // Follow self lol continue; - if (!entity->m_bAlivePlayer || - entity->m_iTeam == - LOCAL_E->m_iTeam) // Dont follow dead players + if (!entity->m_bAlivePlayer) // Dont follow dead players continue; if (follow_activation && entity->m_flDistance > (float) follow_activation) continue; if (!VisCheckEntFromEnt(LOCAL_E, entity)) continue; + const model_t *model = + ENTITY(follow_target)->InternalEntity()->GetModel(); + if (followcart && model && + (lagexploit::pointarr[0] || lagexploit::pointarr[1] || + lagexploit::pointarr[2] || lagexploit::pointarr[3] || + lagexploit::pointarr[4]) && + (model == lagexploit::pointarr[0] || + model == lagexploit::pointarr[1] || + model == lagexploit::pointarr[2] || + model == lagexploit::pointarr[3] || + model == lagexploit::pointarr[4])) + follow_target = entity->m_IDX; + if (entity->m_Type != ENTITY_PLAYER) + continue; if (follow_target && ENTITY(follow_target)->m_flDistance > entity->m_flDistance) // favor closer entitys diff --git a/src/hacks/Misc.cpp b/src/hacks/Misc.cpp index c89c4765..9e67945f 100644 --- a/src/hacks/Misc.cpp +++ b/src/hacks/Misc.cpp @@ -355,12 +355,14 @@ void CreateMove() void DrawText() { - if (god_mode) - for (int i = 0; i < 40000; i++) { - g_ISurface->PlaySound("vo/demoman_cloakedspy03.mp3"); - god_mode = 0; - } - if (!no_homo) { + if (god_mode) + for (int i = 0; i < 40000; i++) + { + g_ISurface->PlaySound("vo/demoman_cloakedspy03.mp3"); + god_mode = 0; + } + if (!no_homo) + { int width, height; g_IEngine->GetScreenSize(width, height); @@ -368,18 +370,23 @@ void DrawText() int step = (height / 7); // Go through steps creating a rainbow screen - for (int i = 1; i < 8; i++) { + for (int i = 1; i < 8; i++) + { // Get Color and set opacity to %50 - colors::rgba_t gaybow = colors::FromHSL(fabs(sin((g_GlobalVars->curtime / 2.0f) + (i / 1.41241))) * 360.0f, 0.85f, 0.9f); + colors::rgba_t gaybow = colors::FromHSL( + fabs(sin((g_GlobalVars->curtime / 2.0f) + (i / 1.41241))) * + 360.0f, + 0.85f, 0.9f); gaybow.a = .5; // Draw next step - draw_api::draw_rect(0, step * (i - 1), width, (step * i) - (step * (i - 1)), gaybow); + draw_api::draw_rect(0, step * (i - 1), width, + (step * i) - (step * (i - 1)), gaybow); } - //int size_x; - //FTGL_StringLength(string.data, fonts::font_main, &size_x); - //FTGL_Draw(string.data, draw_point.x - size_x / 2, draw_point.y,fonts::font_main, color); - + // int size_x; + // FTGL_StringLength(string.data, fonts::font_main, &size_x); + // FTGL_Draw(string.data, draw_point.x - size_x / 2, + // draw_point.y,fonts::font_main, color); } if (show_spectators) { diff --git a/src/hacks/Walkbot.cpp b/src/hacks/Walkbot.cpp index 6b1bfcd7..27be9238 100644 --- a/src/hacks/Walkbot.cpp +++ b/src/hacks/Walkbot.cpp @@ -1191,89 +1191,27 @@ void Move() } } } - if (!prevlvlname) - prevlvlname = g_IEngine->GetLevelName(); + prevlvlname = g_IEngine->GetLevelName(); std::string prvlvlname = format(prevlvlname); - logging::Info("%s", prevlvlname); - if (boost::contains(prvlvlname, "pl_")) + logging::Info("%s %s", prevlvlname, prvlvlname.c_str()); + if (boost::contains(prvlvlname, "pl_") || boost::contains(prvlvlname, "cp_")) { + logging::Info("1"); bool ret = false; if (lagexploit::pointarr[0] || lagexploit::pointarr[1] || lagexploit::pointarr[2] || lagexploit::pointarr[3] || lagexploit::pointarr[4]) - for (int i = 0; i < MAX_ENTITIES; i++) - { - if (!ret) - { - CachedEntity *ent = ENTITY(i); - if (!CE_GOOD(ent)) - continue; - if (ent->m_iTeam == LOCAL_E->m_iTeam) - continue; - const model_t *model = RAW_ENT(ent)->GetModel(); - if (model) - { - if ((model == lagexploit::pointarr[1] || - model == lagexploit::pointarr[2] || - model == lagexploit::pointarr[3] || - model == lagexploit::pointarr[4]) && - ent->m_flDistance < 400.0f && - IsVectorVisible(g_pLocalPlayer->v_Eye, - ent->m_vecOrigin)) - { - index_t node = CreateNode(ent->m_vecOrigin); - auto &n = state::nodes[node]; - if (g_pUserCmd->buttons & IN_DUCK) - n.flags |= NF_DUCK; - if (g_pUserCmd->buttons & IN_JUMP) - n.flags |= NF_JUMP; - if (state::node_good(state::active_node)) - { - auto &c = state::nodes[state::active_node]; - n.link(state::active_node); - c.link(node); - logging::Info("[wb] Node %u auto-linked to " - "node %u at (%.2f %.2f %.2f)", - node, state::active_node, c.x, - c.y, c.z); - } - state::last_node_buttons = g_pUserCmd->buttons; - state::active_node = node; - ret = true; - } - } - else if (ent->m_flDistance < 500.0f && - IsVectorVisible(g_pLocalPlayer->v_Eye, - ent->m_vecOrigin)) - { - index_t node = CreateNode(ent->m_vecOrigin); - auto &n = state::nodes[node]; - if (g_pUserCmd->buttons & IN_DUCK) - n.flags |= NF_DUCK; - if (g_pUserCmd->buttons & IN_JUMP) - n.flags |= NF_JUMP; - if (state::node_good(state::active_node)) - { - auto &c = state::nodes[state::active_node]; - n.link(state::active_node); - c.link(node); - logging::Info("[wb] Node %u auto-linked to " - "node %u at (%.2f %.2f %.2f)", - node, state::active_node, c.x, - c.y, c.z); - } - state::last_node_buttons = g_pUserCmd->buttons; - state::active_node = node; - ret = true; - } - } - } - if (erasedelay > 6 && nodes.size() > 0) { - nodes.erase(nodes.begin()); - erasedelay = 0; + hacks::shared::followbot::followbot = 1; + hacks::shared::followbot::roambot = 1; + hacks::shared::followbot::followcart = true; + } + else + { + hacks::shared::followbot::followbot = 0; + hacks::shared::followbot::roambot = 0; + hacks::shared::followbot::followcart = false; } - erasedelay++; } if (nodes.size() == 0) return; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 08e5f248..beee24d0 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -112,10 +112,11 @@ static CatVar debug_projectiles(CV_SWITCH, "debug_projectiles", "0", static CatVar fakelag_amount(CV_INT, "fakelag", "0", "Bad Fakelag"); static CatVar serverlag_amount( - CV_INT, "serverlag", "0", - "serverlag", "Lag the server by spamming this many voicecommands per tick"); + CV_INT, "serverlag", "0", "serverlag", + "Lag the server by spamming this many voicecommands per tick"); CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto"); -CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", "Crash servers by spamming signon net messages"); +CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers", + "Crash servers by spamming signon net messages"); bool *bSendPackets; bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd) { @@ -519,15 +520,17 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd) if (cmd) g_Settings.last_angles = cmd->viewangles; } - if (serverlag_amount || votelogger::antikick_ticks) { - if (votelogger::antikick_ticks) { - votelogger::antikick_ticks--; - for (int i = 0; i < (int) 70; i++) - g_IEngine->ServerCmd("voicemenu 0 0", false); - } - else - for (int i = 0; i < (int) serverlag_amount; i++) - g_IEngine->ServerCmd("voicemenu 0 0", false); + if (serverlag_amount || votelogger::antikick_ticks) + { + if (votelogger::antikick_ticks) + { + votelogger::antikick_ticks--; + for (int i = 0; i < (int) 70; i++) + g_IEngine->ServerCmd("voicemenu 0 0", false); + } + else + for (int i = 0; i < (int) serverlag_amount; i++) + g_IEngine->ServerCmd("use", false); } // PROF_END("CreateMove"); diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp index df9fb98d..0719dd9b 100644 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -1039,7 +1039,7 @@ void LevelInit_hook(void *_this, const char *newmap) static const LevelInit_t original = (LevelInit_t) hooks::clientmode.GetMethod(offsets::LevelInit()); playerlist::Save(); - votelogger::antikick_ticks = 0; + votelogger::antikick_ticks = 0; hacks::shared::lagexploit::bcalled = false; typedef bool *(*LoadNamedSkys_Fn)(const char *); uintptr_t addr = diff --git a/src/reclasses/CTFInventoryManager.cpp b/src/reclasses/CTFInventoryManager.cpp index 1b9f906a..bb8a2ca6 100644 --- a/src/reclasses/CTFInventoryManager.cpp +++ b/src/reclasses/CTFInventoryManager.cpp @@ -7,31 +7,43 @@ #include "common.hpp" using namespace re; -CTFInventoryManager *CTFInventoryManager::GTFInventoryManager() { - typedef CTFInventoryManager *(*GTFInventoryManager_t)(); - uintptr_t address = gSignatures.GetClientSignature("55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 89 E5 56 53 83 EC ? 8B 5D ? C7 44 24 ? ? ? ? ?"); - GTFInventoryManager_t GTFInventoryManager_fn = GTFInventoryManager_t(address); - return GTFInventoryManager_fn(); +CTFInventoryManager *CTFInventoryManager::GTFInventoryManager() +{ + typedef CTFInventoryManager *(*GTFInventoryManager_t)(); + uintptr_t address = gSignatures.GetClientSignature( + "55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 89 E5 56 53 83 EC ? 8B " + "5D ? C7 44 24 ? ? ? ? ?"); + GTFInventoryManager_t GTFInventoryManager_fn = + GTFInventoryManager_t(address); + return GTFInventoryManager_fn(); } -bool CTFInventoryManager::EquipItemInLoadout(int slot, int classid, unsigned long long uniqueid) { - typedef bool (*fn_t)(void*, int, int, unsigned long long); - return vfunc( - this, offsets::PlatformOffset(19, offsets::undefined, 19), - 0)(this, slot, classid, uniqueid); +bool CTFInventoryManager::EquipItemInLoadout(int slot, int classid, + unsigned long long uniqueid) +{ + typedef bool (*fn_t)(void *, int, int, unsigned long long); + return vfunc(this, + offsets::PlatformOffset(19, offsets::undefined, 19), + 0)(this, slot, classid, uniqueid); } -unsigned long long int CEconItem::uniqueid() { - return *((unsigned long long int*) this + 36); +unsigned long long int CEconItem::uniqueid() +{ + return *((unsigned long long int *) this + 36); } -CTFPlayerInventory *CTFPlayerInventory::GTFPlayerInventory() { - typedef CTFPlayerInventory *(*GTFPlayerInventory_t)(); - uintptr_t address = gSignatures.GetClientSignature("55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 89 E5 57 56 53 83 EC ? 8B 45 ? 8B 5D ?"); - GTFPlayerInventory_t GTFPlayerInventory_fn = GTFPlayerInventory_t(address); - return GTFPlayerInventory_fn(); +CTFPlayerInventory *CTFPlayerInventory::GTFPlayerInventory() +{ + typedef CTFPlayerInventory *(*GTFPlayerInventory_t)(); + uintptr_t address = gSignatures.GetClientSignature( + "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 B8 ? ? ? ? 89 E5 5D C3 " + "8D B6 00 00 00 00 55 89 E5 57 56 53 83 EC ? 8B 45 ? 8B 5D ?"); + GTFPlayerInventory_t GTFPlayerInventory_fn = GTFPlayerInventory_t(address); + return GTFPlayerInventory_fn(); } -CEconItem *CTFPlayerInventory::GetFirstItemOfItemDef(int id) { - typedef CEconItem *(*GetFirstItemOfItemDef_t)(CTFPlayerInventory*, int); - uintptr_t address = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 4D ? 0F B7 45 ?"); - GetFirstItemOfItemDef_t GetFirstItemOfItemDef_fn = GetFirstItemOfItemDef_t(address); - return GetFirstItemOfItemDef_fn(this, id); +CEconItem *CTFPlayerInventory::GetFirstItemOfItemDef(int id) +{ + typedef CEconItem *(*GetFirstItemOfItemDef_t)(CTFPlayerInventory *, int); + uintptr_t address = gSignatures.GetClientSignature( + "55 89 E5 57 56 53 83 EC ? 8B 4D ? 0F B7 45 ?"); + GetFirstItemOfItemDef_t GetFirstItemOfItemDef_fn = + GetFirstItemOfItemDef_t(address); + return GetFirstItemOfItemDef_fn(this, id); } - diff --git a/src/votelogger.cpp b/src/votelogger.cpp index 6e793d6e..852d3d13 100644 --- a/src/votelogger.cpp +++ b/src/votelogger.cpp @@ -13,7 +13,9 @@ namespace votelogger static CatVar enabled(CV_SWITCH, "votelog", "0", "Log votes"); static CatVar requeue(CV_SWITCH, "votelog_requeue", "1", "Auto requeue on vote kick", "Auto requeue on vote kick"); -static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "requires votelog", "Prevent votekicks by lagging the server in a way that every vote comes in delayed"); +static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "requires votelog", + "Prevent votekicks by lagging the server in a way " + "that every vote comes in delayed"); int antikick_ticks = 0; void user_message(bf_read &buffer, int type) { @@ -45,16 +47,17 @@ void user_message(bf_read &buffer, int type) { steamID = info.friendsID; } - if (eid == LOCAL_E->m_IDX) { + if (eid == LOCAL_E->m_IDX) + { islocalplayer = true; - if (anti_votekick) { - antikick_ticks = 600; + if (anti_votekick) + { + antikick_ticks = 600; for (int i = 0; i < (int) 70; i++) g_IEngine->ServerCmd("voicemenu 0 0", false); } } - logging::Info("Vote called to kick %s [U:1:%u] for %s", name, steamID, reason); break;