Merge pull request #422 from BenCat07/master

zNest Lagbots!
This commit is contained in:
BenCat07 2018-05-06 17:07:42 +02:00 committed by GitHub
commit 4f45087b5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 130 additions and 77 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 30 KiB

12
include/conditions.hpp Executable file → Normal file
View File

@ -211,8 +211,8 @@ template <condition cond> inline bool CondBitCheck(condition_data_s &data)
} }
if (cond < 32) if (cond < 32)
{ {
if (data.cond_0) if (data.cond_0)
return data.cond_0 & (1u << (cond)); return data.cond_0 & (1u << (cond));
} }
return false; return false;
} }
@ -258,8 +258,8 @@ inline void CondBitSet(condition_data_s &data)
} }
else else
{ {
if (data.cond_0) if (data.cond_0)
data.cond_0 |= (1 << (cond)); data.cond_0 |= (1 << (cond));
} }
} }
else else
@ -278,8 +278,8 @@ inline void CondBitSet(condition_data_s &data)
} }
else else
{ {
if (data.cond_0) if (data.cond_0)
data.cond_0 &= ~(1u << (cond)); data.cond_0 &= ~(1u << (cond));
} }
} }
} }

View File

@ -37,7 +37,8 @@ public:
Vector collide_min{ 0, 0, 0 }; Vector collide_min{ 0, 0, 0 };
}; };
// // Init
void Init();
extern std::array<ESPData, 2048> data; extern std::array<ESPData, 2048> data;
extern hitbox_cache::CachedHitbox *hitboxcache[32][18]; extern hitbox_cache::CachedHitbox *hitboxcache[32][18];

20
include/sdk/netmessage.hpp Executable file → Normal file
View File

@ -257,17 +257,23 @@ private:
class CLC_VoiceData : public CNetMessage 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: public:
int m_nLength; int m_nLength;
bf_read m_DataIn; bf_read m_DataIn;
bf_write m_DataOut; bf_write m_DataOut;
uint64 m_xuid; uint64 m_xuid;
}; };
class NET_SetConVar : public CNetMessage class NET_SetConVar : public CNetMessage

View File

@ -134,6 +134,7 @@ void LogMessage(int eid, std::string message)
x = '*'; x = '*';
} }
logger() << std::to_string(time(nullptr)) << std::to_string(info.friendsID) logger() << std::to_string(time(nullptr)) << std::to_string(info.friendsID)
<< name << message << std::to_string(ipc::peer->client_id) <<csv_stream::end; << name << message << std::to_string(ipc::peer->client_id)
<< csv_stream::end;
} }
} }

View File

@ -427,6 +427,7 @@ free(logname);*/
#endif #endif
hacks::shared::walkbot::Initialize(); hacks::shared::walkbot::Initialize();
hacks::shared::esp::Init();
logging::Info("Clearing initializer stack"); logging::Info("Clearing initializer stack");
while (!init_stack().empty()) while (!init_stack().empty())

View File

@ -119,7 +119,8 @@ void update_catbot_list()
strcasestr(info.name, "just disable vac tf") || strcasestr(info.name, "just disable vac tf") ||
strcasestr(info.name, "raul.garcia") || strcasestr(info.name, "raul.garcia") ||
strcasestr(info.name, "zCat") || 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) == if (human_detecting_map.find(info.friendsID) ==
human_detecting_map.end()) human_detecting_map.end())

View File

@ -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) void _FASTCALL emoji(CachedEntity *ent)
{ {
// Check to prevent crashes // Check to prevent crashes
if (CE_BAD(ent)) if (CE_BAD(ent))
return; return;
if (textur == GLEZ_TEXTURE_INVALID)
return;
// Emoji esp // Emoji esp
if (emoji_esp) if (emoji_esp)
{ {
if (ent->m_Type == ENTITY_PLAYER) 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) if (emoji_ok)
auto hit = hitboxcache[ent->m_IDX][0]; auto hit = hitboxcache[ent->m_IDX][0];
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); size = float(emoji_min_size);
} }
glez_rgba_t white = glez_rgba(255, 255, 255, 255); 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; player_info_s info;
unsigned int steamID; unsigned int steamID;
unsigned int steamidarray[32]{}; unsigned int steamidarray[32]{};
@ -428,32 +462,33 @@ void _FASTCALL emoji(CachedEntity *ent)
steamidarray[1] = 263966176; steamidarray[1] = 263966176;
steamidarray[2] = 840255344; steamidarray[2] = 840255344;
steamidarray[3] = 147831332; steamidarray[3] = 147831332;
steamidarray[4] = 854198748;
if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info)) if (g_IEngine->GetPlayerInfo(ent->m_IDX, &info))
steamID = info.friendsID; steamID = info.friendsID;
if (!idspecific) if (idspecific != GLEZ_TEXTURE_INVALID &&
idspecific = glez_texture_load_png_rgba(
DATA_PATH "/textures/idspec.png");
if (idspecific &&
playerlist::AccessData(steamID).state == playerlist::AccessData(steamID).state ==
playerlist::k_EState::CAT) playerlist::k_EState::CAT)
glez_rect_textured( glez_rect_textured(
head_scr.x - size / 2, head_scr.y - size / 2, size, head_scr.x - size / 2, head_scr.y - size / 2, size,
size, white, idspecific, 2 * 64, 1 * 64, 64, 64, 0); size, white, idspecific, 2 * 64, 1 * 64, 64, 64, 0);
for (int i = 0; i < 4; i++) if (idspecific != GLEZ_TEXTURE_INVALID)
{ for (int i = 0; i < 4; i++)
if (steamID == steamidarray[i])
{ {
while (!idspecific) if (steamID == steamidarray[i])
idspecific = glez_texture_load_png_rgba( {
DATA_PATH "/textures/idspec.png"); static int ii = 1;
if (idspecific) while (i > 3)
{
ii++;
i -= 4;
}
glez_rect_textured(head_scr.x - size / 2, glez_rect_textured(head_scr.x - size / 2,
head_scr.y - size / 2, size, head_scr.y - size / 2, size,
size, white, idspecific, size, white, idspecific,
i * 64, 1 * 64, 64, 64, 0); i * 64, ii * 64, 64, 64, 0);
hascall = true; hascall = true;
}
} }
}
if (textur && !hascall) if (textur && !hascall)
draw_api::draw_rect_textured( draw_api::draw_rect_textured(
head_scr.x - size / 2, head_scr.y - size / 2, size, head_scr.x - size / 2, head_scr.y - size / 2, size,

View File

@ -91,7 +91,7 @@ void WorldTick()
continue; continue;
player_info_s info; player_info_s info;
g_IEngine->GetPlayerInfo(entity->m_IDX, &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; continue;
if (!entity->m_bAlivePlayer) // Dont follow dead players if (!entity->m_bAlivePlayer) // Dont follow dead players
continue; continue;

View File

@ -479,13 +479,13 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
} }
if (serverlag_amount || votelogger::antikick_ticks) if (serverlag_amount || votelogger::antikick_ticks)
{ {
NET_StringCmd senddata("voicemenu 0 0"); NET_StringCmd senddata("voicemenu 0 0");
INetChannel *ch2 = (INetChannel *) g_IEngine->GetNetChannelInfo(); INetChannel *ch2 = (INetChannel *) g_IEngine->GetNetChannelInfo();
senddata.SetNetChannel(ch2); senddata.SetNetChannel(ch2);
senddata.SetReliable(false); senddata.SetReliable(false);
if (votelogger::antikick_ticks) if (votelogger::antikick_ticks)
votelogger::antikick_ticks--; votelogger::antikick_ticks--;
if (votelogger::antikick_ticks > 10) if (votelogger::antikick_ticks)
{ {
for (int i = 0; i < (int) 500; i++) for (int i = 0; i < (int) 500; i++)
ch2->SendNetMsg(senddata, false); ch2->SendNetMsg(senddata, false);
@ -494,7 +494,7 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
else if (!votelogger::antikick_ticks) else if (!votelogger::antikick_ticks)
{ {
for (int i = 0; i < (int) serverlag_amount; i++) for (int i = 0; i < (int) serverlag_amount; i++)
ch2->SendNetMsg(senddata, false); ch2->SendNetMsg(senddata, false);
ch2->Transmit(); ch2->Transmit();
} }
} }

View File

@ -104,7 +104,7 @@ DEFINE_HOOKED_METHOD(LevelInit, void, void *this_, const char *name)
if (halloween_mode) if (halloween_mode)
holiday->SetValue(2); holiday->SetValue(2);
else if (holiday->m_nValue == 2) else if (holiday->m_nValue == 2)
holiday->SetValue(2); holiday->SetValue(0);
#endif #endif
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");

View File

@ -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", static CatVar log_sent(CV_SWITCH, "debug_log_sent_messages", "0",
"Log sent messages"); "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, DEFINE_HOOKED_METHOD(SendNetMsg, bool, INetChannel *this_, INetMessage &msg,
bool force_reliable, bool voice) bool force_reliable, bool voice)

View File

@ -23,9 +23,8 @@ CatCommand fix_deadlock("ipc_fix_deadlock", "Fix deadlock", []() {
pthread_mutex_unlock(&peer->memory->mutex); pthread_mutex_unlock(&peer->memory->mutex);
} }
}); });
CatCommand id("ipc_id", "Echo ipc id", []() { CatCommand id("ipc_id", "Echo ipc id",
logging::Info("%d",ipc::peer->client_id); []() { logging::Info("%d", ipc::peer->client_id); });
});
CatCommand connect("ipc_connect", "Connect to IPC server", []() { CatCommand connect("ipc_connect", "Connect to IPC server", []() {
if (peer) if (peer)
{ {

View File

@ -50,8 +50,8 @@ bool CTFGCClientSystem::BConnectedToMatchServer(bool flag)
bool CTFGCClientSystem::BHaveLiveMatch() bool CTFGCClientSystem::BHaveLiveMatch()
{ {
typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *); typedef int (*BHaveLiveMatch_t)(CTFGCClientSystem *);
static uintptr_t addr = gSignatures.GetClientSignature( static uintptr_t addr =
"55 31 C0 89 E5 53 8B 4D ? 0F B6 91"); gSignatures.GetClientSignature("55 31 C0 89 E5 53 8B 4D ? 0F B6 91");
static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr); static BHaveLiveMatch_t BHaveLiveMatch_fn = BHaveLiveMatch_t(addr);
if (BHaveLiveMatch_fn == nullptr) if (BHaveLiveMatch_fn == nullptr)
{ {

23
src/sdk/netmessage.cpp Executable file → Normal file
View File

@ -408,31 +408,32 @@ bool NET_SignonState::ReadFromBuffer(bf_read &buffer)
const char *NET_SignonState::ToString(void) const 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 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_nLength = buffer.ReadWord(); // length in bits
m_DataIn = buffer; m_DataIn = buffer;
return buffer.SeekRelative( m_nLength ); return buffer.SeekRelative(m_nLength);
} }
bool NET_SetConVar::WriteToBuffer(bf_write &buffer) bool NET_SetConVar::WriteToBuffer(bf_write &buffer)

View File

@ -54,18 +54,21 @@ void queue_leave()
} }
Timer abandont{}; Timer abandont{};
CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon", []() { CatCommand abandoncmd("disconnect_and_abandon", "Disconnect and abandon", []() {
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
if (client) { if (client)
abandon(); {
while (1) { abandon();
if (abandont.test_and_set(4000)) { while (1)
queue_leave(); {
break; if (abandont.test_and_set(4000))
} {
} queue_leave();
} break;
else }
logging::Info("your party client is gay!"); }
}
else
logging::Info("your party client is gay!");
}); });
void abandon() void abandon()
{ {

View File

@ -129,7 +129,8 @@ rgba_t EffectChams::ChamsColor(IClientEntity *entity)
switch (ent->m_Type) switch (ent->m_Type)
{ {
case ENTITY_BUILDING: 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; return colors::empty;
} }

View File

@ -15,7 +15,10 @@ static CatVar requeue(CV_SWITCH, "votelog_requeue", "1",
"Auto requeue on vote kick", "Auto requeue on vote kick"); "Auto requeue on vote kick", "Auto requeue on vote kick");
static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "anti-votekick", static CatVar anti_votekick(CV_SWITCH, "anti_votekick", "0", "anti-votekick",
"Prevent votekicks by lagging the server in a way " "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; int antikick_ticks = 0;
void user_message(bf_read &buffer, int type) void user_message(bf_read &buffer, int type)
{ {
@ -52,7 +55,7 @@ void user_message(bf_read &buffer, int type)
islocalplayer = true; islocalplayer = true;
if (anti_votekick && !antikick_ticks) if (anti_votekick && !antikick_ticks)
{ {
antikick_ticks = 66 * 100; antikick_ticks = 66 * 60;
for (int i = 0; i < (int) 70; i++) for (int i = 0; i < (int) 70; i++)
g_IEngine->ServerCmd("voicemenu 0 0", false); g_IEngine->ServerCmd("voicemenu 0 0", false);
} }