diff --git a/include/hooks/hookedmethods.hpp b/include/hooks/hookedmethods.hpp old mode 100755 new mode 100644 index 05de9b37..74069865 --- a/include/hooks/hookedmethods.hpp +++ b/include/hooks/hookedmethods.hpp @@ -21,6 +21,7 @@ typedef bool (*DispatchUserMessage_t)(void *, int, bf_read &); typedef void (*FrameStageNotify_t)(void *, int); typedef void (*LevelInit_t)(void *, const char *); typedef void (*LevelShutdown_t)(void *); + typedef void (*BeginFrame_t)(IStudioRender *); typedef bool (*CanInspect_t)(IClientEntity *); typedef void (*DrawModelExecute_t)(IVModelRender *, const DrawModelState_t &, diff --git a/include/reclasses/CTFPartyClient.hpp b/include/reclasses/CTFPartyClient.hpp index f54731a7..ca27ac32 100755 --- a/include/reclasses/CTFPartyClient.hpp +++ b/include/reclasses/CTFPartyClient.hpp @@ -21,6 +21,7 @@ public: static bool BCanQueueForStandby(CTFPartyClient *this_); char RequestQueueForMatch(int type); char RequestLeaveForMatch(int type); + int BInvitePlayerToParty(int steamid); static bool BInQueue(CTFPartyClient *this_); }; } diff --git a/include/reclasses/ITFGroupMatchCriteria.hpp b/include/reclasses/ITFGroupMatchCriteria.hpp old mode 100755 new mode 100644 index fb463afb..68fb39bc --- a/include/reclasses/ITFGroupMatchCriteria.hpp +++ b/include/reclasses/ITFGroupMatchCriteria.hpp @@ -17,15 +17,15 @@ class ITFGroupMatchCriteria public: enum group { - MvmPractice = 0, - MvmMannup = 1, - LadderMatch6v6 = 2, - LadderMatch9v9 = 3, - LadderMatch12v12 = 4, - CasualMatch6v6 = 5, - CasualMatch9v9 = 6, - CasualMatch12v12 = 7, - CompetitiveEventMatch12v12 = 8 + MvmPractice = 0, + MvmMannup = 1, + LadderMatch6v6 = 2, + LadderMatch9v9 = 3, + LadderMatch12v12 = 4, + CasualMatch6v6 = 5, + CasualMatch9v9 = 6, + CasualMatch12v12 = 7, + CompetitiveEventMatch12v12 = 8 }; public: diff --git a/src/fidgetspinner.cpp b/src/fidgetspinner.cpp index 959f826f..d42a2049 100644 --- a/src/fidgetspinner.cpp +++ b/src/fidgetspinner.cpp @@ -14,7 +14,8 @@ CatVar enable_spinner(CV_SWITCH, "fidgetspinner", "0", "Fidget Spinner", "Part of Cathook Autism Awareness program"); -CatVar v9mode(CV_SWITCH, "nullcore_mode", "0", "Nullcore mode", "Part of Cathook Autism Awareness program"); +CatVar v9mode(CV_SWITCH, "nullcore_mode", "0", "Nullcore mode", + "Part of Cathook Autism Awareness program"); float spinning_speed = 0.0f; float angle = 0; @@ -96,7 +97,8 @@ void DrawSpinner() while (!tex) tex = glez_texture_load_png_rgba("/opt/cathook/data/res/atlas.png"); glez_rect_textured(draw::width / 2, draw::height / 2, size, size, color, - tex, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64, angle); + tex, 0 + 64 * state, (3 + (v9mode ? 1 : 0)) * 64, 64, 64, + angle); if (angle > PI * 4) angle -= PI * 4; } diff --git a/src/hack.cpp b/src/hack.cpp index b42fece2..67d4831a 100755 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -211,7 +211,6 @@ free(logname);*/ EndConVars(); #if ENABLE_VISUALS == 1 - draw::Initialize(); #if ENABLE_GUI diff --git a/src/hacks/AutoJoin.cpp b/src/hacks/AutoJoin.cpp old mode 100755 new mode 100644 index bfe4c194..26d9e897 --- a/src/hacks/AutoJoin.cpp +++ b/src/hacks/AutoJoin.cpp @@ -28,6 +28,8 @@ CatVar preferred_class(classes_enum, "autojoin_class", "0", "AutoJoin class", CatVar auto_queue(CV_SWITCH, "autoqueue", "0", "AutoQueue", "Automatically queue in casual matches"); +CatVar party_bypass(CV_SWITCH, "party_bypass", "1", "Party bypass", + "Bypass Join block when not friended"); const std::string classnames[] = { "scout", "sniper", "soldier", "demoman", "medic", "heavyweapons", @@ -53,7 +55,7 @@ void UpdateSearch() return; if (g_pUserCmd) - tfmm::queue_leave(); + tfmm::queue_leave(); if (autoqueue_timer.test_and_set(30000)) { re::CTFGCClientSystem *gc = re::CTFGCClientSystem::GTFGCClientSystem(); @@ -66,7 +68,6 @@ void UpdateSearch() } Timer timer{}; - void Update() { if (timer.test_and_set(500)) diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp old mode 100755 new mode 100644 index 5e0dd239..30efbd1a --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -393,7 +393,7 @@ void _FASTCALL emoji(CachedEntity *ent) float size = emoji_esp_scaling ? fabs(hbm.y - hbx.y) : float(emoji_esp_size); if (v9mode) - size *= 1.4; + size *= 1.4; if (!size || !float(emoji_min_size)) return; if (emoji_esp_scaling && (size < float(emoji_min_size))) @@ -401,7 +401,7 @@ void _FASTCALL emoji(CachedEntity *ent) size = float(emoji_min_size); } glez_rgba_t white = glez_rgba(255, 255, 255, 255); - while (!textur) + while (!textur) textur = glez_texture_load_png_rgba( "/opt/cathook/data/res/atlas.png"); player_info_s info; @@ -432,18 +432,18 @@ void _FASTCALL emoji(CachedEntity *ent) "/opt/cathook/data/res/idspec.png"); if (idspecific) glez_rect_textured(head_scr.x - size / 2, - head_scr.y - size / 2, - size, size, white, - idspecific, i * 64, - 1 * 64, 64, 64, 0); + head_scr.y - size / 2, size, + size, white, idspecific, + i * 64, 1 * 64, 64, 64, 0); hascall = true; } } if (textur && !hascall) - draw_api::draw_rect_textured(head_scr.x - size / 2, - head_scr.y - size / 2, size, - size, colors::white, {textur}, (3 + (v9mode ? 3 : (int)emoji_esp)) * 64, - 3 * 64, 64, 64, 0); + draw_api::draw_rect_textured( + head_scr.x - size / 2, head_scr.y - size / 2, size, + size, colors::white, { textur }, + (3 + (v9mode ? 3 : (int) emoji_esp)) * 64, 3 * 64, + 64, 64, 0); } } } diff --git a/src/hooks.cpp b/src/hooks.cpp index 60b19ca7..36a525d5 100755 --- a/src/hooks.cpp +++ b/src/hooks.cpp @@ -96,6 +96,7 @@ VMTHook baseclientstate8{}; VMTHook clientmode{}; VMTHook panel{}; VMTHook client{}; +VMTHook ctfpartyclient; VMTHook netchannel{}; VMTHook clientdll{}; VMTHook matsurface{}; diff --git a/src/hooks/PaintTraverse.cpp b/src/hooks/PaintTraverse.cpp old mode 100755 new mode 100644 diff --git a/src/hooks/others.cpp b/src/hooks/others.cpp old mode 100755 new mode 100644 index 2532ad38..9464f7c6 --- a/src/hooks/others.cpp +++ b/src/hooks/others.cpp @@ -895,12 +895,83 @@ bool DispatchUserMessage_hook(void *_this, int type, bf_read &buf) votelogger::user_message(buf, type); return original(_this, type, buf); } - +const char *skynum[] = { "sky_tf2_04", + "sky_upward", + "sky_dustbowl_01", + "sky_goldrush_01", + "sky_granary_01", + "sky_well_01", + "sky_gravel_01", + "sky_badlands_01", + "sky_hydro_01", + "sky_night_01", + "sky_nightfall_01", + "sky_trainyard_01", + "sky_stormfront_01", + "sky_morningsnow_01", + "sky_alpinestorm_01", + "sky_harvest_01", + "sky_harvest_night_01", + "sky_halloween", + "sky_halloween_night_01", + "sky_halloween_night2014_01", + "sky_island_01", + "sky_jungle_01", + "sky_invasion2fort_01", + "sky_well_02", + "sky_outpost_01", + "sky_coastal_01", + "sky_rainbow_01", + "sky_badlands_pyroland_01", + "sky_pyroland_01", + "sky_pyroland_02", + "sky_pyroland_03" }; +CatEnum skys({ "sky_tf2_04", + "sky_upward", + "sky_dustbowl_01", + "sky_goldrush_01", + "sky_granary_01", + "sky_well_01", + "sky_gravel_01", + "sky_badlands_01", + "sky_hydro_01", + "sky_night_01", + "sky_nightfall_01", + "sky_trainyard_01", + "sky_stormfront_01", + "sky_morningsnow_01", + "sky_alpinestorm_01", + "sky_harvest_01", + "sky_harvest_night_01", + "sky_halloween", + "sky_halloween_night_01", + "sky_halloween_night2014_01", + "sky_island_01", + "sky_jungle_01", + "sky_invasion2fort_01", + "sky_well_02", + "sky_outpost_01", + "sky_coastal_01", + "sky_rainbow_01", + "sky_badlands_pyroland_01", + "sky_pyroland_01", + "sky_pyroland_02", + "sky_pyroland_03" }); +static CatVar skybox_changer(skys, "skybox_changer", "0", "Change Skybox to this skybox", + "Change Skybox to this skybox, only changes on map load"); void LevelInit_hook(void *_this, const char *newmap) { static const LevelInit_t original = (LevelInit_t) hooks::clientmode.GetMethod(offsets::LevelInit()); playerlist::Save(); + typedef bool *(*LoadNamedSkys_Fn)(const char *); + uintptr_t addr = + gSignatures.GetEngineSignature("55 89 E5 57 31 FF 56 8D B5 ? ? ? ? 53 " + "81 EC ? ? ? ? C7 85 ? ? ? ? ? ? ? ?"); + static LoadNamedSkys_Fn LoadNamedSkys = LoadNamedSkys_Fn(addr); + bool load_success = LoadNamedSkys(skynum[(int)skybox_changer]); + logging::Info("Skybox Loading successful: %s", + load_success ? "true" : "false"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); hacks::shared::aimbot::Reset(); chat_stack::Reset(); diff --git a/src/menu/ncc/Menu.cpp b/src/menu/ncc/Menu.cpp index 7bde180b..5b9e7883 100644 --- a/src/menu/ncc/Menu.cpp +++ b/src/menu/ncc/Menu.cpp @@ -653,6 +653,7 @@ static const std::string list_tf2 = R"( ] "Misc" [ "Misc Menu" + "skybox_changer" "name" "disconnect_reason" "pure_bypass" @@ -725,6 +726,7 @@ static const std::string list_tf2 = R"( "Automated" [ "Automated Menu" "autoqueue" + "autoqueue_mode" "autojoin_team" "autojoin_class" "autotaunt" diff --git a/src/reclasses/CTFGCClientSystem.cpp b/src/reclasses/CTFGCClientSystem.cpp old mode 100755 new mode 100644 index 3ea95a7f..02556add --- a/src/reclasses/CTFGCClientSystem.cpp +++ b/src/reclasses/CTFGCClientSystem.cpp @@ -14,7 +14,8 @@ CTFGCClientSystem *CTFGCClientSystem::GTFGCClientSystem() { typedef CTFGCClientSystem *(*GTFGCClientSystem_t)(); static uintptr_t addr1 = gSignatures.GetClientSignature( - "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 A1 ? ? ? ?"); + "55 B8 ? ? ? ? 89 E5 5D C3 8D B6 00 00 00 00 55 A1 ? ? ? ? 89 E5 5D C3 " + "8D B6 00 00 00 00 A1 ? ? ? ?"); static GTFGCClientSystem_t GTFGCClientSystem_fn = GTFGCClientSystem_t(addr1); @@ -38,8 +39,8 @@ void CTFGCClientSystem::AbandonCurrentMatch() bool CTFGCClientSystem::BConnectedToMatchServer(bool flag) { typedef bool (*BConnectedToMatchServer_t)(CTFGCClientSystem *, bool); - static uintptr_t addr = gSignatures.GetClientSignature( - "55 89 E5 53 80 7D ? ? 8B 55 ? 75 ?"); + static uintptr_t addr = + gSignatures.GetClientSignature("55 89 E5 53 80 7D ? ? 8B 55 ? 75 ?"); static BConnectedToMatchServer_t BConnectedToMatchServer_fn = BConnectedToMatchServer_t(addr); @@ -49,7 +50,8 @@ bool CTFGCClientSystem::BConnectedToMatchServer(bool flag) bool CTFGCClientSystem::BHaveLiveMatch() { typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *); - static uintptr_t addr = gSignatures.GetClientSignature("55 31 C0 89 E5 53 8B 4D ? 0F B6 91 ? ? ? ?"); + static uintptr_t addr = gSignatures.GetClientSignature( + "55 31 C0 89 E5 53 8B 4D ? 0F B6 91 ? ? ? ?"); static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr); if (BHaveLiveMatch_fn == nullptr) { diff --git a/src/reclasses/CTFPartyClient.cpp b/src/reclasses/CTFPartyClient.cpp index 777a09a5..9da525b0 100644 --- a/src/reclasses/CTFPartyClient.cpp +++ b/src/reclasses/CTFPartyClient.cpp @@ -11,10 +11,9 @@ re::CTFPartyClient *re::CTFPartyClient::GTFPartyClient() { typedef re::CTFPartyClient *(*GTFPartyClient_t)(void); - 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); + 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); return GTFPartyClient_fn(); } @@ -59,7 +58,7 @@ int re::CTFPartyClient::LoadSavedCasualCriteria() { typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *); uintptr_t addr = gSignatures.GetClientSignature( - "55 89 E5 83 EC ? 8B 45 ? 8B 50 ? C6 80 ? ? ? ? ?"); + "55 89 E5 83 EC ? 8B 45 ? 8B 50 ? C6 80 ? ? ? ? ?"); LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn = LoadSavedCasualCriteria_t(addr); @@ -80,7 +79,8 @@ char re::CTFPartyClient::RequestLeaveForMatch(int type) { typedef char (*RequestLeaveForMatch_t)(re::CTFPartyClient *, int); 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 ?"); + "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 = RequestLeaveForMatch_t(addr); diff --git a/src/tfmm.cpp b/src/tfmm.cpp old mode 100755 new mode 100644 index 8362d6e5..ec2e87ea --- a/src/tfmm.cpp +++ b/src/tfmm.cpp @@ -12,8 +12,12 @@ CatCommand cmd_queue_start("mm_queue_casual", "Start casual queue", CatCommand cmd_abandon("mm_abandon", "Abandon match", []() { tfmm::abandon(); }); -static CatEnum queue_mode({ "MvmPractice", "MvmMannup", "LadderMatch6v6", "LadderMatch9v9", "LadderMatch12v12", "CasualMatch6v6", "CasualMatch9v9", "CasualMatch12v12", "CompetitiveEventMatch12v12"}); -static CatVar queue(queue_mode, "autoqueue_mode", "7", "Autoqueue for this mode", ""); +static CatEnum queue_mode({ "MvmPractice", "MvmMannup", "LadderMatch6v6", + "LadderMatch9v9", "LadderMatch12v12", + "CasualMatch6v6", "CasualMatch9v9", + "CasualMatch12v12", "CompetitiveEventMatch12v12" }); +static CatVar queue(queue_mode, "autoqueue_mode", "7", + "Autoqueue for this mode", ""); CatCommand get_state("mm_state", "Get party state", []() { re::CTFParty *party = re::CTFParty::GetParty(); @@ -28,20 +32,22 @@ CatCommand get_state("mm_state", "Get party state", []() { namespace tfmm { -void queue_start() { +void queue_start() +{ re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); if (client) { - client->LoadSavedCasualCriteria(); - client->RequestQueueForMatch((int)queue); + client->LoadSavedCasualCriteria(); + client->RequestQueueForMatch((int) queue); } else logging::Info("queue_start: CTFPartyClient == null!"); } -void queue_leave() { +void queue_leave() +{ re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); if (client) - client->RequestLeaveForMatch((int)queue); + client->RequestLeaveForMatch((int) queue); else logging::Info("queue_start: CTFPartyClient == null!"); } diff --git a/src/visual/drawmgr.cpp b/src/visual/drawmgr.cpp old mode 100755 new mode 100644 index a8e9e2c8..847ed50d --- a/src/visual/drawmgr.cpp +++ b/src/visual/drawmgr.cpp @@ -40,7 +40,8 @@ CatVar info_text(CV_SWITCH, "info", "1", "Show info", "Show cathook version in top left corner"); CatVar info_text_min(CV_SWITCH, "info_min", "0", "Show minimal info", "Only show cathook title in top left corner"); -CatVar enable_logo(CV_SWITCH, "nullcore_mode_logo", "1", "Enable Nullcore watermark", ""); +CatVar enable_logo(CV_SWITCH, "nullcore_mode_logo", "1", + "Enable Nullcore watermark", ""); void DrawCheatVisuals() {