diff --git a/data/textures/idspec.png b/data/textures/idspec.png index c536fd7f..85c10215 100755 Binary files a/data/textures/idspec.png and b/data/textures/idspec.png differ diff --git a/include/conditions.hpp b/include/conditions.hpp old mode 100755 new mode 100644 index 65975fe2..6ce9e27d --- a/include/conditions.hpp +++ b/include/conditions.hpp @@ -211,8 +211,8 @@ template inline bool CondBitCheck(condition_data_s &data) } if (cond < 32) { - if (data.cond_0) - return data.cond_0 & (1u << (cond)); + if (data.cond_0) + return data.cond_0 & (1u << (cond)); } return false; } @@ -258,8 +258,8 @@ inline void CondBitSet(condition_data_s &data) } else { - if (data.cond_0) - data.cond_0 |= (1 << (cond)); + if (data.cond_0) + data.cond_0 |= (1 << (cond)); } } else @@ -278,8 +278,8 @@ inline void CondBitSet(condition_data_s &data) } else { - if (data.cond_0) - data.cond_0 &= ~(1u << (cond)); + if (data.cond_0) + data.cond_0 &= ~(1u << (cond)); } } } diff --git a/include/hacks/ESP.hpp b/include/hacks/ESP.hpp index 319265fd..b3bc2975 100755 --- a/include/hacks/ESP.hpp +++ b/include/hacks/ESP.hpp @@ -37,7 +37,8 @@ public: Vector collide_min{ 0, 0, 0 }; }; -// +// Init +void Init(); extern std::array data; extern hitbox_cache::CachedHitbox *hitboxcache[32][18]; diff --git a/include/sdk/netmessage.hpp b/include/sdk/netmessage.hpp old mode 100755 new mode 100644 index 9c41745c..fc024df9 --- a/include/sdk/netmessage.hpp +++ b/include/sdk/netmessage.hpp @@ -257,17 +257,23 @@ private: class CLC_VoiceData : public CNetMessage { - DECLARE_CLC_MESSAGE( VoiceData ); + DECLARE_CLC_MESSAGE(VoiceData); - int GetGroup() const { return INetChannelInfo::VOICE; } + int GetGroup() const + { + return INetChannelInfo::VOICE; + } - CLC_VoiceData() { m_bReliable = false; }; + CLC_VoiceData() + { + m_bReliable = false; + }; public: - int m_nLength; - bf_read m_DataIn; - bf_write m_DataOut; - uint64 m_xuid; + int m_nLength; + bf_read m_DataIn; + bf_write m_DataOut; + uint64 m_xuid; }; class NET_SetConVar : public CNetMessage diff --git a/src/chatlog.cpp b/src/chatlog.cpp index 26ebb3ff..4a6506bd 100644 --- a/src/chatlog.cpp +++ b/src/chatlog.cpp @@ -134,6 +134,7 @@ void LogMessage(int eid, std::string message) x = '*'; } logger() << std::to_string(time(nullptr)) << std::to_string(info.friendsID) - << name << message << std::to_string(ipc::peer->client_id) <client_id) + << csv_stream::end; } } diff --git a/src/hack.cpp b/src/hack.cpp index 91096b31..2665d0bd 100644 --- a/src/hack.cpp +++ b/src/hack.cpp @@ -427,6 +427,7 @@ free(logname);*/ #endif hacks::shared::walkbot::Initialize(); + hacks::shared::esp::Init(); logging::Info("Clearing initializer stack"); while (!init_stack().empty()) diff --git a/src/hacks/CatBot.cpp b/src/hacks/CatBot.cpp index 23bbc073..4e1f1b1d 100644 --- a/src/hacks/CatBot.cpp +++ b/src/hacks/CatBot.cpp @@ -119,7 +119,8 @@ void update_catbot_list() strcasestr(info.name, "just disable vac tf") || strcasestr(info.name, "raul.garcia") || strcasestr(info.name, "zCat") || - strcasestr(info.name, "lagger bot")) + strcasestr(info.name, "lagger bot") || + strcasestr(info.name, "zLag-bot")) { if (human_detecting_map.find(info.friendsID) == human_detecting_map.end()) diff --git a/src/hacks/ESP.cpp b/src/hacks/ESP.cpp index f2b1b973..5e630a4e 100644 --- a/src/hacks/ESP.cpp +++ b/src/hacks/ESP.cpp @@ -382,20 +382,57 @@ void CreateMove() } } } - +static glez_texture_t idspecific; +static glez_texture_t textur; +Timer retry{}; +void Init() +{ + textur = glez_texture_load_png_rgba(DATA_PATH "/textures/atlas.png"); + idspecific = glez_texture_load_png_rgba(DATA_PATH "/textures/idspec.png"); + if (textur == GLEZ_TEXTURE_INVALID) + { + logging::Info("Invalid atlas, retrying in 10 seconds...."); + while (1) + { + if (retry.test_and_set(10000)) + { + textur = + glez_texture_load_png_rgba(DATA_PATH "/textures/atlas.png"); + if (textur != GLEZ_TEXTURE_INVALID) + break; + logging::Info("Invalid atlas, retrying in 10 seconds...."); + } + } + } + if (idspecific == GLEZ_TEXTURE_INVALID) + { + logging::Info("Invalid idspecific, retrying in 10 seconds...."); + while (1) + { + if (retry.test_and_set(10000)) + { + idspecific = glez_texture_load_png_rgba(DATA_PATH + "/textures/idspec.png"); + if (idspecific != GLEZ_TEXTURE_INVALID) + break; + logging::Info("Invalid idspecific, retrying in 10 seconds...."); + } + } + } +} void _FASTCALL emoji(CachedEntity *ent) { // Check to prevent crashes if (CE_BAD(ent)) return; + if (textur == GLEZ_TEXTURE_INVALID) + return; // Emoji esp if (emoji_esp) { if (ent->m_Type == ENTITY_PLAYER) { - static glez_texture_t textur = - glez_texture_load_png_rgba(DATA_PATH "/textures/atlas.png"); - static glez_texture_t idspecific; + if (emoji_ok) auto hit = hitboxcache[ent->m_IDX][0]; auto hit = hitboxcache[ent->m_IDX][0]; @@ -417,9 +454,6 @@ void _FASTCALL emoji(CachedEntity *ent) size = float(emoji_min_size); } glez_rgba_t white = glez_rgba(255, 255, 255, 255); - while (!textur || textur == 4294967295) - textur = glez_texture_load_png_rgba( - DATA_PATH "/textures/atlas.png"); player_info_s info; unsigned int steamID; unsigned int steamidarray[32]{}; @@ -428,32 +462,33 @@ void _FASTCALL emoji(CachedEntity *ent) steamidarray[1] = 263966176; steamidarray[2] = 840255344; steamidarray[3] = 147831332; + steamidarray[4] = 854198748; if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info)) steamID = info.friendsID; - if (!idspecific) - idspecific = glez_texture_load_png_rgba( - DATA_PATH "/textures/idspec.png"); - if (idspecific && + if (idspecific != GLEZ_TEXTURE_INVALID && playerlist::AccessData(steamID).state == playerlist::k_EState::CAT) glez_rect_textured( head_scr.x - size / 2, head_scr.y - size / 2, size, size, white, idspecific, 2 * 64, 1 * 64, 64, 64, 0); - for (int i = 0; i < 4; i++) - { - if (steamID == steamidarray[i]) + if (idspecific != GLEZ_TEXTURE_INVALID) + for (int i = 0; i < 4; i++) { - while (!idspecific) - idspecific = glez_texture_load_png_rgba( - DATA_PATH "/textures/idspec.png"); - if (idspecific) + if (steamID == steamidarray[i]) + { + static int ii = 1; + while (i > 3) + { + ii++; + i -= 4; + } glez_rect_textured(head_scr.x - size / 2, head_scr.y - size / 2, size, size, white, idspecific, - i * 64, 1 * 64, 64, 64, 0); - hascall = true; + i * 64, ii * 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, diff --git a/src/hacks/FollowBot.cpp b/src/hacks/FollowBot.cpp index 7760259a..e4feb9a8 100644 --- a/src/hacks/FollowBot.cpp +++ b/src/hacks/FollowBot.cpp @@ -91,7 +91,7 @@ void WorldTick() continue; player_info_s info; g_IEngine->GetPlayerInfo(entity->m_IDX, &info); - if ((int) follow_steam != info.friendsID) // steamid check + if ((int) follow_steam != (int) info.friendsID) // steamid check continue; if (!entity->m_bAlivePlayer) // Dont follow dead players continue; diff --git a/src/hooks/CreateMove.cpp b/src/hooks/CreateMove.cpp index 45b65dd0..73ec0fd3 100644 --- a/src/hooks/CreateMove.cpp +++ b/src/hooks/CreateMove.cpp @@ -479,13 +479,13 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, } if (serverlag_amount || votelogger::antikick_ticks) { - NET_StringCmd senddata("voicemenu 0 0"); - INetChannel *ch2 = (INetChannel *) g_IEngine->GetNetChannelInfo(); + NET_StringCmd senddata("voicemenu 0 0"); + INetChannel *ch2 = (INetChannel *) g_IEngine->GetNetChannelInfo(); senddata.SetNetChannel(ch2); senddata.SetReliable(false); if (votelogger::antikick_ticks) - votelogger::antikick_ticks--; - if (votelogger::antikick_ticks > 10) + votelogger::antikick_ticks--; + if (votelogger::antikick_ticks) { for (int i = 0; i < (int) 500; i++) ch2->SendNetMsg(senddata, false); @@ -494,7 +494,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time, else if (!votelogger::antikick_ticks) { for (int i = 0; i < (int) serverlag_amount; i++) - ch2->SendNetMsg(senddata, false); + ch2->SendNetMsg(senddata, false); ch2->Transmit(); } } diff --git a/src/hooks/LevelInit.cpp b/src/hooks/LevelInit.cpp index 6eaa1be3..6232c2e3 100644 --- a/src/hooks/LevelInit.cpp +++ b/src/hooks/LevelInit.cpp @@ -104,7 +104,7 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) if (halloween_mode) holiday->SetValue(2); else if (holiday->m_nValue == 2) - holiday->SetValue(2); + holiday->SetValue(0); #endif g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); @@ -121,4 +121,4 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name) } #endif } -} \ No newline at end of file +} diff --git a/src/hooks/SendNetMsg.cpp b/src/hooks/SendNetMsg.cpp index 4cca2205..d0116910 100644 --- a/src/hooks/SendNetMsg.cpp +++ b/src/hooks/SendNetMsg.cpp @@ -12,7 +12,8 @@ static CatVar newlines_msg(CV_INT, "chat_newlines", "0", "Prefix newlines", static CatVar log_sent(CV_SWITCH, "debug_log_sent_messages", "0", "Log sent messages"); -static CatVar airstuck(CV_KEY, "airstuck", "0", "Airstuck", "");namespace hooked_methods +static CatVar airstuck(CV_KEY, "airstuck", "0", "Airstuck", ""); +namespace hooked_methods { DEFINE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *this_, INetMessage &msg, bool force_reliable, bool voice) diff --git a/src/ipc.cpp b/src/ipc.cpp index 5715ca95..929a1dcd 100644 --- a/src/ipc.cpp +++ b/src/ipc.cpp @@ -23,9 +23,8 @@ CatCommand fix_deadlock("ipc_fix_deadlock", "Fix deadlock", []() { pthread_mutex_unlock(&peer->memory->mutex); } }); -CatCommand id("ipc_id", "Echo ipc id", []() { - logging::Info("%d",ipc::peer->client_id); -}); +CatCommand id("ipc_id", "Echo ipc id", + []() { logging::Info("%d", ipc::peer->client_id); }); CatCommand connect("ipc_connect", "Connect to IPC server", []() { if (peer) { diff --git a/src/reclasses/CTFGCClientSystem.cpp b/src/reclasses/CTFGCClientSystem.cpp index 326fd145..542dd3a6 100644 --- a/src/reclasses/CTFGCClientSystem.cpp +++ b/src/reclasses/CTFGCClientSystem.cpp @@ -50,8 +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/sdk/netmessage.cpp b/src/sdk/netmessage.cpp old mode 100755 new mode 100644 index 4d2e60a5..fd93d96f --- a/src/sdk/netmessage.cpp +++ b/src/sdk/netmessage.cpp @@ -408,31 +408,32 @@ 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); + return strfmt("net_SignonState: state %i, count %i", m_nSignonState, + m_nSpawnCount); } const char *CLC_VoiceData::ToString(void) const { - return strfmt("%s: %i bytes", GetName(), m_nLength ); + return strfmt("%s: %i bytes", GetName(), m_nLength); } -bool CLC_VoiceData::WriteToBuffer( bf_write &buffer ) +bool CLC_VoiceData::WriteToBuffer(bf_write &buffer) { - buffer.WriteUBitLong( GetType(), NETMSG_TYPE_BITS ); + buffer.WriteUBitLong(GetType(), NETMSG_TYPE_BITS); - m_nLength = m_DataOut.GetNumBitsWritten(); + m_nLength = m_DataOut.GetNumBitsWritten(); - buffer.WriteWord( m_nLength ); // length in bits + buffer.WriteWord(m_nLength); // length in bits - return buffer.WriteBits( m_DataOut.GetBasePointer(), m_nLength ); + return buffer.WriteBits(m_DataOut.GetBasePointer(), m_nLength); } -bool CLC_VoiceData::ReadFromBuffer( bf_read &buffer ) +bool CLC_VoiceData::ReadFromBuffer(bf_read &buffer) { - m_nLength = buffer.ReadWord(); // length in bits - m_DataIn = buffer; + m_nLength = buffer.ReadWord(); // length in bits + m_DataIn = buffer; - return buffer.SeekRelative( m_nLength ); + return buffer.SeekRelative(m_nLength); } bool NET_SetConVar::WriteToBuffer(bf_write &buffer) diff --git a/src/tfmm.cpp b/src/tfmm.cpp index 8749b567..e58ad999 100644 --- a/src/tfmm.cpp +++ b/src/tfmm.cpp @@ -54,18 +54,21 @@ void queue_leave() } Timer abandont{}; CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon", []() { - re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); - if (client) { - abandon(); - while (1) { - if (abandont.test_and_set(4000)) { - queue_leave(); - break; - } - } - } - else - logging::Info("your party client is gay!"); + re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); + if (client) + { + abandon(); + while (1) + { + if (abandont.test_and_set(4000)) + { + queue_leave(); + break; + } + } + } + else + logging::Info("your party client is gay!"); }); void abandon() { diff --git a/src/visual/EffectChams.cpp b/src/visual/EffectChams.cpp index 411770cf..888dfb3d 100644 --- a/src/visual/EffectChams.cpp +++ b/src/visual/EffectChams.cpp @@ -129,7 +129,8 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity) switch (ent->m_Type) { case ENTITY_BUILDING: - if (!ent->m_bEnemy && !(teammates || teammate_buildings) && (!(chamsR || chamsB || chamsG) && ent != LOCAL_E)) + if (!ent->m_bEnemy && !(teammates || teammate_buildings) && + (!(chamsR || chamsB || chamsG) && ent != LOCAL_E)) { return colors::empty; } diff --git a/src/votelogger.cpp b/src/votelogger.cpp index 73bdaa2c..3a340e6e 100644 --- a/src/votelogger.cpp +++ b/src/votelogger.cpp @@ -15,7 +15,10 @@ 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", "anti-votekick", "Prevent votekicks by lagging the server in a way " - "that every vote comes is delayed.\ndo not forget to enable votelog and that this\nmakes the server be down for about 30 seconds\ncl_timeout 60 is a must"); + "that every vote comes is delayed.\ndo not forget " + "to enable votelog and that this\nmakes the server " + "be down for about 30 seconds\ncl_timeout 60 is a " + "must"); int antikick_ticks = 0; void user_message(bf_read &buffer, int type) { @@ -52,7 +55,7 @@ void user_message(bf_read &buffer, int type) islocalplayer = true; if (anti_votekick && !antikick_ticks) { - antikick_ticks = 66 * 100; + antikick_ticks = 66 * 60; for (int i = 0; i < (int) 70; i++) g_IEngine->ServerCmd("voicemenu 0 0", false); }