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 (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));
}
}
}

View File

@ -37,7 +37,8 @@ public:
Vector collide_min{ 0, 0, 0 };
};
//
// Init
void Init();
extern std::array<ESPData, 2048> data;
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
{
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

View File

@ -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) <<csv_stream::end;
<< name << message << std::to_string(ipc::peer->client_id)
<< csv_stream::end;
}
}

View File

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

View File

@ -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())

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)
{
// 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,

View File

@ -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;

View File

@ -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();
}
}

View File

@ -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
}
}
}

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",
"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)

View File

@ -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)
{

View File

@ -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)
{

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
{
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)

View File

@ -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()
{

View File

@ -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;
}

View File

@ -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);
}