// This is an independent project of an individual developer. Dear PVS-Studio, please check it.
// PVS-Studio Static Code Analyzer for C, C++, C#, and Java: http://www.viva64.com
#include "spammers.h"
void spammers::clan_tag()
{
auto apply = [](const char* tag) -> void
{
using Fn = int(__fastcall*)(const char*, const char*);
static auto fn = reinterpret_cast<Fn>(util::FindSignature(crypt_str("engine.dll"), crypt_str("53 56 57 8B DA 8B F9 FF 15")));
fn(tag, tag);
};
static auto removed = false;
if (!g_cfg.misc.clantag_spammer && !removed)
{
removed = true;
apply((""));
return;
}
if (g_cfg.misc.clantag_spammer)
{
auto nci = m_engine()->GetNetChannelInfo();
if (!nci)
return;
static auto time = -1;
auto ticks = TIME_TO_TICKS(nci->GetAvgLatency(FLOW_OUTGOING)) + (float)m_globals()->m_tickcount; //-V807
auto intervals = 0.5f / m_globals()->m_intervalpertick;
if (g_cfg.misc.clantag_spammer && g_cfg.misc.clantags_mode == 0)
{
auto main_time = (int)(ticks / intervals) % 7;
if (main_time != time && !m_clientstate()->iChokedCommands)
{
auto tag = crypt_str("");
switch (main_time)
{
case 0:
tag = crypt_str("jopa lol"); //>V1037
break;
case 1:
tag = crypt_str("hahahaha");
break;
case 2:
tag = crypt_str("afsdf"); //>V1037
break;
case 3:
tag = crypt_str("asdfawer");
break;
case 4:
tag = crypt_str("asdgasg"); //>V1037
break;
case 5:
tag = crypt_str("vasdtaew");
break;
case 6:
tag = crypt_str("adfgadfv"); //>V1037
break;
case 7:
tag = crypt_str("asdfasdvc");
break;
}
apply(tag);
time = main_time;
}
removed = false;
}
if (g_cfg.misc.clantag_spammer && g_cfg.misc.clantags_mode == 1)
{
auto main_time = (int)(ticks / intervals) % 2;
if (main_time != time && !m_clientstate()->iChokedCommands)
{
auto tag = crypt_str("");
switch (main_time)
{
case 0:
tag = crypt_str("cheat name"); //>V1037
break;
case 1:
tag = crypt_str("clantag"); //>V1037
break;
}
apply(tag);
time = main_time;
}
removed = false;
}
}