Merge remote-tracking branch 'nullworks/master'
This commit is contained in:
commit
d15dd1741f
@ -36,7 +36,7 @@ and a lot of useful features, including
|
||||
|
||||
# INSTALLATION
|
||||
|
||||
## Automatic: (Ubuntu/Arch based only)
|
||||
## Automatic: (Ubuntu 17.10+/Arch based only)
|
||||
Run in terminal:
|
||||
|
||||
* `wget https://raw.githubusercontent.com/nullworks/One-in-all-cathook-install/master/install-all && bash install-all`
|
||||
|
@ -9,6 +9,8 @@
|
||||
|
||||
// This is a temporary file to put code that needs moving/refactoring in.
|
||||
extern bool *bSendPackets;
|
||||
extern std::array<int, 32> bruteint;
|
||||
extern std::array<Timer, 32> timers;
|
||||
extern CatVar no_zoom;
|
||||
extern CatVar clean_screenshots;
|
||||
extern CatVar disable_visuals;
|
||||
@ -23,6 +25,7 @@ extern CatVar serverlag_amount;
|
||||
extern CatVar servercrash;
|
||||
extern CatVar debug_projectiles;
|
||||
extern CatVar semiauto;
|
||||
extern CatVar resolver;
|
||||
extern CatVar engine_pred;
|
||||
extern Timer DelayTimer;
|
||||
extern bool firstcm;
|
||||
|
2
include/helpers.hpp
Executable file → Normal file
2
include/helpers.hpp
Executable file → Normal file
@ -81,7 +81,7 @@ Vector VischeckWall(CachedEntity *player, CachedEntity *target, float maxdist,
|
||||
bool checkWalkable);
|
||||
float vectorMax(Vector i);
|
||||
Vector vectorAbs(Vector i);
|
||||
bool canReachVector(Vector loc, Vector dest = {0,0,0});
|
||||
bool canReachVector(Vector loc, Vector dest = { 0, 0, 0 });
|
||||
|
||||
bool LineIntersectsBox(Vector &bmin, Vector &bmax, Vector &lmin, Vector &lmax);
|
||||
|
||||
|
@ -21,7 +21,8 @@ public:
|
||||
static bool BCanQueueForStandby(CTFPartyClient *this_);
|
||||
char RequestQueueForMatch(int type);
|
||||
char RequestLeaveForMatch(int type);
|
||||
int BInvitePlayerToParty(int steamid);
|
||||
int BInvitePlayerToParty(CSteamID steamid);
|
||||
int BRequestJoinPlayer(CSteamID steamid);
|
||||
static bool BInQueue(CTFPartyClient *this_);
|
||||
};
|
||||
}
|
||||
|
@ -4,6 +4,8 @@
|
||||
*/
|
||||
|
||||
#include "MiscTemporary.hpp"
|
||||
std::array<Timer, 32> timers{};
|
||||
std::array<int, 32> bruteint{};
|
||||
CatVar minigun_jump(CV_SWITCH, "minigun_jump", "0", "TF2C minigun jump",
|
||||
"Allows jumping while shooting with minigun");
|
||||
|
||||
@ -25,7 +27,8 @@ CatVar serverlag_amount(
|
||||
CatVar servercrash(CV_SWITCH, "servercrash", "0", "crash servers",
|
||||
"Crash servers by spamming signon net messages");
|
||||
CatVar semiauto(CV_INT, "semiauto", "0", "Semiauto");
|
||||
bool *bSendPackets;
|
||||
bool *bSendPackets = nullptr;
|
||||
CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
||||
|
||||
CatVar crypt_chat(
|
||||
CV_SWITCH, "chat_crypto", "1", "Crypto chat",
|
||||
|
@ -3,12 +3,6 @@
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
#define INRANGE(x, a, b) (x >= a && x <= b)
|
||||
#define getBits(x) \
|
||||
(INRANGE((x & (~0x20)), 'A', 'F') ? ((x & (~0x20)) - 'A' + 0xa) \
|
||||
: (INRANGE(x, '0', '9') ? x - '0' : 0))
|
||||
#define getByte(x) (getBits(x[0]) << 4 | getBits(x[1]))
|
||||
|
||||
// module should be a pointer to the base of an elf32 module
|
||||
// this is not the value returned by dlopen (which returns an opaque handle to
|
||||
// the module) the best method to get this address is with fopen() and mmap()
|
||||
@ -51,9 +45,83 @@ Elf32_Shdr *getSectionHeader(void *module, const char *sectionName)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
bool InRange(char x, char a, char b)
|
||||
{
|
||||
return x >= a && x <= b;
|
||||
}
|
||||
|
||||
int GetBits(char x)
|
||||
{
|
||||
if (InRange((char) (x & (~0x20)), 'A', 'F'))
|
||||
{
|
||||
return (x & (~0x20)) - 'A' + 0xa;
|
||||
}
|
||||
else if (InRange(x, '0', '9'))
|
||||
{
|
||||
return x - '0';
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
int GetBytes(const char *x)
|
||||
{
|
||||
return GetBits(x[0]) << 4 | GetBits(x[1]);
|
||||
}
|
||||
|
||||
/* Shoutouts
|
||||
* To
|
||||
* Marc3842h
|
||||
* for
|
||||
* the
|
||||
* way
|
||||
* better
|
||||
* sigscan
|
||||
*/
|
||||
uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength,
|
||||
const char *szPattern)
|
||||
{
|
||||
const char *pattern = szPattern;
|
||||
uintptr_t firstMatch = 0;
|
||||
|
||||
uintptr_t start = dwAddress;
|
||||
uintptr_t end = dwLength;
|
||||
|
||||
for (uintptr_t pos = start; pos < end; pos++)
|
||||
{
|
||||
if (*pattern == 0)
|
||||
return firstMatch;
|
||||
|
||||
const uint8_t currentPattern =
|
||||
*reinterpret_cast<const uint8_t *>(pattern);
|
||||
const uint8_t currentMemory = *reinterpret_cast<const uint8_t *>(pos);
|
||||
|
||||
if (currentPattern == '\?' || currentMemory == GetBytes(pattern))
|
||||
{
|
||||
if (firstMatch == 0)
|
||||
firstMatch = pos;
|
||||
|
||||
if (pattern[2] == 0)
|
||||
{
|
||||
logging::Info("Found pattern \"%s\" at 0x%08X.", szPattern,
|
||||
firstMatch);
|
||||
return firstMatch;
|
||||
}
|
||||
|
||||
pattern += currentPattern != '\?' ? 3 : 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
pattern = szPattern;
|
||||
firstMatch = 0;
|
||||
}
|
||||
}
|
||||
logging::Info("THIS IS SERIOUS: Could not locate signature: "
|
||||
"\n============\n\"%s\"\n============",
|
||||
szPattern);
|
||||
return 0;
|
||||
}
|
||||
/*uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength,
|
||||
const char *szPattern)
|
||||
{
|
||||
const char *pat = szPattern;
|
||||
uintptr_t firstMatch = NULL;
|
||||
@ -84,7 +152,7 @@ uintptr_t CSignature::dwFindPattern(uintptr_t dwAddress, uintptr_t dwLength,
|
||||
szPattern);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
}*/
|
||||
//===================================================================================
|
||||
void *CSignature::GetModuleHandleSafe(const char *pszModuleName)
|
||||
{
|
||||
|
4
src/core/logging.cpp
Executable file → Normal file
4
src/core/logging.cpp
Executable file → Normal file
@ -18,8 +18,8 @@ void logging::Initialize()
|
||||
{
|
||||
// FIXME other method of naming the file?
|
||||
passwd *pwd = getpwuid(getuid());
|
||||
logging::handle =
|
||||
fopen(strfmt("/tmp/cathook-%s-%d.log", pwd->pw_name, getpid()).get(), "w");
|
||||
logging::handle = fopen(
|
||||
strfmt("/tmp/cathook-%s-%d.log", pwd->pw_name, getpid()).get(), "w");
|
||||
}
|
||||
|
||||
void logging::Info(const char *fmt, ...)
|
||||
|
@ -279,7 +279,8 @@ void crit_err_hdlr(int sig_num, siginfo_t *info, void *ucontext)
|
||||
// just fprintf to stderr (or do both).
|
||||
passwd *pwd = getpwuid(getuid());
|
||||
backtraceFile = fopen(
|
||||
strfmt("/tmp/cathook-%s-%d-segfault.log", pwd->pw_name, getpid()).get(), "w");
|
||||
strfmt("/tmp/cathook-%s-%d-segfault.log", pwd->pw_name, getpid()).get(),
|
||||
"w");
|
||||
|
||||
if (sig_num == SIGSEGV)
|
||||
fprintf(backtraceFile, "signal %d (%s), address is %p from %p\n",
|
||||
|
@ -158,8 +158,8 @@ static CatVar auto_zoom(
|
||||
"Automatically zoom in if you can see target, useful for followbots");
|
||||
static CatVar auto_unzoom(CV_SWITCH, "aimbot_auto_unzoom", "0", "Auto Un-zoom",
|
||||
"Automatically unzoom");
|
||||
static CatVar backtrackAimbot(CV_SWITCH, "backtrack_aimbot", "0", "Backtrack Aimbot",
|
||||
"Enable Backtrack Aimbot");
|
||||
static CatVar backtrackAimbot(CV_SWITCH, "backtrack_aimbot", "0",
|
||||
"Backtrack Aimbot", "Enable Backtrack Aimbot");
|
||||
|
||||
// Current Entity
|
||||
int target_eid{ 0 };
|
||||
@ -219,6 +219,7 @@ bool BacktrackAimbot()
|
||||
// ok just in case
|
||||
if (CE_BAD(tar))
|
||||
continue;
|
||||
// target_eid = tar->m_IDX;
|
||||
Vector &angles = NET_VECTOR(tar, netvar.m_angEyeAngles);
|
||||
float &simtime = NET_FLOAT(tar, netvar.m_flSimulationTime);
|
||||
angles.y = i.viewangles;
|
||||
@ -289,8 +290,6 @@ void CreateMove()
|
||||
g_pLocalPlayer->weapon_mode == weapon_throwable))
|
||||
projectileAimbotRequired = true;
|
||||
|
||||
|
||||
|
||||
// Local player check + Aimkey
|
||||
if (!aimkey_status || !ShouldAim())
|
||||
return;
|
||||
@ -325,6 +324,7 @@ void CreateMove()
|
||||
// Attemt to auto-shoot
|
||||
|
||||
// flNextPrimaryAttack meme
|
||||
// target_eid = target_entity->m_IDX;
|
||||
if (only_can_shoot)
|
||||
{
|
||||
|
||||
|
@ -6,16 +6,19 @@
|
||||
*/
|
||||
|
||||
#include <hacks/hacklist.hpp>
|
||||
#include <glez/draw.hpp>
|
||||
#include "common.hpp"
|
||||
|
||||
namespace hacks::shared::antiaim
|
||||
{
|
||||
|
||||
CatVar communicate(CV_SWITCH, "identify", "0", "identify",
|
||||
"Auto identify for other cathook users");
|
||||
CatVar enabled(CV_SWITCH, "aa_enabled", "0", "Anti-Aim",
|
||||
"Master AntiAim switch");
|
||||
static CatVar crouch(CV_SWITCH, "aa_fakecrouch", "0", "Fake Crouch", "Fake crouch");
|
||||
CatVar draw_fakes(CV_SWITCH, "aa_drawfakes", "1", "Draw Fakes",
|
||||
"Draw a nice box around the head hitboxes");
|
||||
static CatVar crouch(CV_SWITCH, "aa_fakecrouch", "0", "Fake Crouch",
|
||||
"Fake crouch");
|
||||
static CatVar yaw(CV_FLOAT, "aa_yaw", "0.0", "Yaw", "Static yaw (left/right)",
|
||||
360.0);
|
||||
static CatVar pitch(CV_FLOAT, "aa_pitch", "-89.0", "Pitch",
|
||||
@ -25,8 +28,9 @@ static CatEnum yaw_mode_enum({ "KEEP", "STATIC", "JITTER",
|
||||
"OFFSETKEEP", "EDGE", "HECK",
|
||||
"FAKEKEEP", "FAKESTATIC", "FAKEJITTER",
|
||||
"FAKEBIGRANDOM", "FAKERANDOM", "FAKESPIN",
|
||||
"FAKEOFFSETKEEP", "FAKEEDGE", "FAKEHECK", "FAKESIDEWAYS", "FAKELEFT",
|
||||
"FAKERIGHT", "FAKEREVERSEEDGE"});
|
||||
"FAKEOFFSETKEEP", "FAKEEDGE", "FAKEHECK",
|
||||
"FAKESIDEWAYS", "FAKELEFT", "FAKERIGHT",
|
||||
"FAKEREVERSEEDGE" });
|
||||
static CatEnum pitch_mode_enum({ "KEEP", "STATIC", "JITTER", "RANDOM", "FLIP",
|
||||
"FAKEFLIP", "FAKEUP", "FAKEDOWN", "FAKECENTER",
|
||||
"UP", "DOWN", "HECK" });
|
||||
@ -388,7 +392,7 @@ float useEdge(float edgeViewAngle)
|
||||
Timer delay{};
|
||||
int val = 0;
|
||||
int value[32] = { 0 };
|
||||
void FakeCrouch(CUserCmd * cmd)
|
||||
void FakeCrouch(CUserCmd *cmd)
|
||||
{
|
||||
if (!crouch)
|
||||
return;
|
||||
@ -414,7 +418,8 @@ void FakeCrouch(CUserCmd * cmd)
|
||||
*bSendPackets = false;
|
||||
waittime = 15;
|
||||
}
|
||||
else{
|
||||
else
|
||||
{
|
||||
cmd->buttons &= ~IN_DUCK;
|
||||
*bSendPackets = true;
|
||||
}
|
||||
@ -422,24 +427,18 @@ void FakeCrouch(CUserCmd * cmd)
|
||||
void ProcessUserCmd(CUserCmd *cmd)
|
||||
{
|
||||
if (!enabled)
|
||||
{
|
||||
*bSendPackets = true;
|
||||
return;
|
||||
}
|
||||
if (!ShouldAA(cmd))
|
||||
return;
|
||||
static bool angstate = true;
|
||||
static bool keepmode = true;
|
||||
keepmode = !keepmode;
|
||||
if ((int) yaw_mode >= 8)
|
||||
angstate = !angstate;
|
||||
else
|
||||
angstate = true;
|
||||
if (!LOCAL_E->m_bAlivePlayer())
|
||||
angstate = true;
|
||||
if (g_pUserCmd->buttons & IN_ATTACK || g_pUserCmd->buttons & IN_ATTACK2)
|
||||
angstate = true;
|
||||
*bSendPackets = angstate;
|
||||
float &p = cmd->viewangles.x;
|
||||
float &y = cmd->viewangles.y;
|
||||
static bool flip = false;
|
||||
static bool bsendflip = true;
|
||||
bool clamp = !no_clamping;
|
||||
if (test)
|
||||
{
|
||||
@ -503,7 +502,6 @@ void ProcessUserCmd(CUserCmd *cmd)
|
||||
else
|
||||
y -= 90;
|
||||
break;
|
||||
flip = !flip;
|
||||
}
|
||||
clamp = false;
|
||||
break;
|
||||
|
@ -52,7 +52,9 @@ void CreateMove()
|
||||
{
|
||||
bool good_tick = false;
|
||||
for (int j = 0; j < 12; ++j)
|
||||
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
|
||||
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick &&
|
||||
hacks::shared::backtrack::sorted_ticks[j].tickcount !=
|
||||
INT_MAX)
|
||||
good_tick = true;
|
||||
tickcnt++;
|
||||
if (!good_tick)
|
||||
|
@ -578,7 +578,7 @@ int HealingPriority(int idx)
|
||||
int overheal = maxoverheal - (maxbuffedhealth - health);
|
||||
float overhealp = ((float) overheal / (float) maxoverheal);
|
||||
float healthp = ((float) health / (float) maxhealth);
|
||||
priority += hacks::shared::followbot::ClassPriority(ent) * 10;
|
||||
priority += hacks::shared::followbot::ClassPriority(ent) * 1.3;
|
||||
switch (playerlist::AccessData(ent).state)
|
||||
{
|
||||
case playerlist::k_EState::FRIEND:
|
||||
|
@ -97,7 +97,8 @@ void UpdateSearch()
|
||||
if (!gc->BConnectedToMatchServer(false) &&
|
||||
queuetime.test_and_set(10 * 1000 * 60) && !gc->BHaveLiveMatch())
|
||||
tfmm::queue_leave();
|
||||
if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch())
|
||||
if (gc && !gc->BConnectedToMatchServer(false) && !gc->BHaveLiveMatch() &&
|
||||
autoqueue_timer.test_and_set(1000 * 30))
|
||||
{
|
||||
logging::Info("Starting queue");
|
||||
tfmm::queue_start();
|
||||
|
@ -161,7 +161,7 @@ void Run()
|
||||
float distance, prev_distance_ticks = 9999;
|
||||
|
||||
for (int i = 0; i < 12; ++i)
|
||||
sorted_ticks[i] = BestTickData{INT_MAX, i};
|
||||
sorted_ticks[i] = BestTickData{ INT_MAX, i };
|
||||
for (int t = 0; t < ticks; ++t)
|
||||
{
|
||||
if (headPositions[iBestTarget][t].tickcount)
|
||||
@ -174,7 +174,8 @@ void Run()
|
||||
bool good_tick = false;
|
||||
for (int i = 0; i < 12; ++i)
|
||||
if (t == sorted_ticks[i].tick &&
|
||||
sorted_ticks[i].tickcount != INT_MAX && sorted_ticks[i].tickcount)
|
||||
sorted_ticks[i].tickcount != INT_MAX &&
|
||||
sorted_ticks[i].tickcount)
|
||||
good_tick = true;
|
||||
if (!good_tick)
|
||||
continue;
|
||||
|
@ -29,6 +29,7 @@ static CatVar micspam_on(CV_INT, "cbu_micspam_on_interval", "3",
|
||||
"+voicerecord interval");
|
||||
static CatVar micspam_off(CV_INT, "cbu_micspam_off_interval", "60",
|
||||
"-voicerecord interval");
|
||||
static CatVar auto_crouch(CV_SWITCH, "cbu_autocrouch", "1", "Auto crouch");
|
||||
|
||||
struct catbot_user_state
|
||||
{
|
||||
@ -215,6 +216,49 @@ void reportall()
|
||||
}
|
||||
}
|
||||
CatCommand report("report_debug", "debug", []() { reportall(); });
|
||||
Timer crouchcdr{};
|
||||
void smart_crouch()
|
||||
{
|
||||
bool foundtar = false;
|
||||
static bool crouch = false;
|
||||
if (crouchcdr.test_and_set(1000))
|
||||
{
|
||||
for (int i = 0; i < g_IEngine->GetMaxClients(); i++)
|
||||
{
|
||||
auto ent = ENTITY(i);
|
||||
if (CE_BAD(ent) || ent->m_iTeam() == LOCAL_E->m_iTeam() ||
|
||||
!(ent->hitboxes.GetHitbox(0)) || !(ent->m_bAlivePlayer()) ||
|
||||
playerlist::AccessData(ent).state ==
|
||||
playerlist::k_EState::FRIEND ||
|
||||
playerlist::AccessData(ent).state ==
|
||||
playerlist::k_EState::IPC ||
|
||||
should_ignore_player(ent))
|
||||
continue;
|
||||
bool failedvis = false;
|
||||
for (int j = -1; j < 18; j++)
|
||||
if (IsEntityVisible(ent, j))
|
||||
failedvis = true;
|
||||
if (failedvis)
|
||||
continue;
|
||||
for (int j = 0; j < 18; j++)
|
||||
{
|
||||
if (!LOCAL_E->hitboxes.GetHitbox(j))
|
||||
continue;
|
||||
if (!IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->center) && !IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->min) && !IsVectorVisible(ent->hitboxes.GetHitbox(0)->center, LOCAL_E->hitboxes.GetHitbox(j)->max))
|
||||
continue;
|
||||
else
|
||||
{
|
||||
foundtar = true;
|
||||
crouch = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!foundtar && crouch)
|
||||
crouch = false;
|
||||
}
|
||||
if (crouch)
|
||||
g_pUserCmd->buttons |= IN_DUCK;
|
||||
}
|
||||
void update()
|
||||
{
|
||||
if (!enabled)
|
||||
@ -239,6 +283,8 @@ void update()
|
||||
do_random_votekick();
|
||||
if (timer_catbot_list.test_and_set(3000))
|
||||
update_catbot_list();
|
||||
if (auto_crouch)
|
||||
smart_crouch();
|
||||
if (timer_abandon.test_and_set(2000) && level_init_timer.check(13000))
|
||||
{
|
||||
count_bots = 0;
|
||||
|
@ -308,7 +308,6 @@ struct bonelist_s
|
||||
};
|
||||
|
||||
std::unordered_map<studiohdr_t *, bonelist_s> bonelist_map{};
|
||||
|
||||
// Function called on draw
|
||||
void Draw()
|
||||
{
|
||||
@ -505,17 +504,6 @@ void _FASTCALL ProcessEntityPT(CachedEntity *ent)
|
||||
// Get if ent should be transparent
|
||||
bool transparent = vischeck && ent_data.transparent;
|
||||
|
||||
// Bone esp
|
||||
if (draw_bones && type == ENTITY_PLAYER)
|
||||
{
|
||||
const model_t *model = RAW_ENT(ent)->GetModel();
|
||||
if (model)
|
||||
{
|
||||
auto hdr = g_IModelInfo->GetStudiomodel(model);
|
||||
bonelist_map[hdr].Draw(ent, fg);
|
||||
}
|
||||
}
|
||||
|
||||
// Tracers
|
||||
if (tracers && type == ENTITY_PLAYER)
|
||||
{
|
||||
|
@ -54,7 +54,8 @@ static CatVar afk(CV_SWITCH, "fb_afk", "1", "Switch target if AFK",
|
||||
static CatVar afktime(
|
||||
CV_INT, "fb_afk_time", "15000", "Max AFK Time",
|
||||
"Max time in ms spent standing still before player gets declared afk");
|
||||
static CatVar corneractivate(CV_SWITCH, "fb_activation_corners", "1", "Activate arround corners",
|
||||
static CatVar corneractivate(
|
||||
CV_SWITCH, "fb_activation_corners", "1", "Activate arround corners",
|
||||
"Try to find an activation path to an entity behind a corner.");
|
||||
|
||||
// Something to store breadcrumbs created by followed players
|
||||
@ -103,7 +104,9 @@ void addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin)
|
||||
int maxiterations = floor(corner.DistTo(g_pLocalPlayer->v_Origin)) / 40;
|
||||
for (int i = 0; i < maxiterations; i++)
|
||||
{
|
||||
breadcrumbs.push_back(g_pLocalPlayer->v_Origin + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1));
|
||||
breadcrumbs.push_back(g_pLocalPlayer->v_Origin +
|
||||
dist / vectorMax(vectorAbs(dist)) * 40.0f *
|
||||
(i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@ -111,10 +114,11 @@ void addCrumbs(CachedEntity *target, Vector corner = g_pLocalPlayer->v_Origin)
|
||||
int maxiterations = floor(corner.DistTo(target->m_vecOrigin())) / 40;
|
||||
for (int i = 0; i < maxiterations; i++)
|
||||
{
|
||||
breadcrumbs.push_back(corner + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1));
|
||||
breadcrumbs.push_back(
|
||||
corner + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1));
|
||||
}
|
||||
}
|
||||
int ClassPriority(CachedEntity* ent)
|
||||
int ClassPriority(CachedEntity *ent)
|
||||
{
|
||||
switch (g_pPlayerResource->GetClass(ent))
|
||||
{
|
||||
@ -184,7 +188,7 @@ void WorldTick()
|
||||
if (CE_BAD(entity)) // Exist + dormant
|
||||
continue;
|
||||
if (i == follow_target)
|
||||
continue;
|
||||
break;
|
||||
if (entity->m_Type() != ENTITY_PLAYER)
|
||||
continue;
|
||||
if (steamid != entity->player_info.friendsID) // steamid check
|
||||
@ -194,8 +198,11 @@ void WorldTick()
|
||||
continue;
|
||||
if (corneractivate)
|
||||
{
|
||||
Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250, true); //get the corner location that the future target is visible from
|
||||
if (!indirectOrigin.z) //if we couldn't find it, exit
|
||||
Vector indirectOrigin =
|
||||
VischeckWall(LOCAL_E, entity, 250,
|
||||
true); // get the corner location that the
|
||||
// future target is visible from
|
||||
if (!indirectOrigin.z) // if we couldn't find it, exit
|
||||
continue;
|
||||
addCrumbs(entity, indirectOrigin);
|
||||
}
|
||||
@ -210,10 +217,14 @@ void WorldTick()
|
||||
}
|
||||
// If we dont have a follow target from that, we look again for someone
|
||||
// else who is suitable
|
||||
if ((!follow_target || change || (ClassPriority(ENTITY(follow_target)) < 6 && ENTITY(follow_target)->player_info.friendsID != steamid)) && roambot)
|
||||
if ((!follow_target || change ||
|
||||
(ClassPriority(ENTITY(follow_target)) < 6 &&
|
||||
ENTITY(follow_target)->player_info.friendsID != steamid)) &&
|
||||
roambot)
|
||||
{
|
||||
// Try to get a new target
|
||||
auto ent_count = followcart ? HIGHEST_ENTITY : g_IEngine->GetMaxClients();
|
||||
auto ent_count =
|
||||
followcart ? HIGHEST_ENTITY : g_IEngine->GetMaxClients();
|
||||
for (int i = 0; i < ent_count; i++)
|
||||
{
|
||||
auto entity = ENTITY(i);
|
||||
@ -259,13 +270,17 @@ void WorldTick()
|
||||
continue;
|
||||
}
|
||||
// check if new target has a higher priority than current target
|
||||
if (ClassPriority(ENTITY(follow_target)) >= ClassPriority(ENTITY(i)))
|
||||
if (ClassPriority(ENTITY(follow_target)) >=
|
||||
ClassPriority(ENTITY(i)))
|
||||
continue;
|
||||
|
||||
if (corneractivate)
|
||||
{
|
||||
Vector indirectOrigin = VischeckWall(LOCAL_E, entity, 250, true); //get the corner location that the future target is visible from
|
||||
if (!indirectOrigin.z) //if we couldn't find it, exit
|
||||
Vector indirectOrigin =
|
||||
VischeckWall(LOCAL_E, entity, 250,
|
||||
true); // get the corner location that the
|
||||
// future target is visible from
|
||||
if (!indirectOrigin.z) // if we couldn't find it, exit
|
||||
continue;
|
||||
addCrumbs(entity, indirectOrigin);
|
||||
}
|
||||
|
@ -53,14 +53,16 @@ void draw()
|
||||
CachedEntity *pEntity = ENTITY(i);
|
||||
if (CE_BAD(pEntity) || !pEntity->m_bAlivePlayer())
|
||||
continue;
|
||||
if (pEntity == LOCAL_E)
|
||||
continue;
|
||||
Vector out;
|
||||
if (draw::WorldToScreen(hitp[i], out))
|
||||
{
|
||||
float size;
|
||||
if (abs(maxp[i].x - minp[i].x) > abs(maxp[i].y - minp[i].y))
|
||||
size = abs(maxp[i].x - minp[i].x);
|
||||
else
|
||||
size = abs(maxp[i].y - minp[i].y);
|
||||
Vector pout, pout2;
|
||||
if (draw::WorldToScreen(minp[i], pout) &&
|
||||
draw::WorldToScreen(maxp[i], pout2))
|
||||
size = fmaxf(fabsf(pout2.x - pout.x), fabsf(pout2.y - pout.y));
|
||||
|
||||
glez::draw::rect(out.x, out.y, size / 4, size / 4,
|
||||
hacks::shared::lightesp::LightESPColor(pEntity));
|
||||
|
@ -22,12 +22,12 @@ static CatVar sound_alerts(CV_SWITCH, "spyalert_sound", "1", "Sound Alerts",
|
||||
"Demoman yells spy when a spy is within distance");
|
||||
static CatVar sound_alert_interval(CV_FLOAT, "spyalert_interval", "3",
|
||||
"Alert Interval", "Sound alert interval");
|
||||
static CatVar voicemenu(CV_SWITCH, "spyalert_voice", "0",
|
||||
"Voicemenu", "Inform other Players of a nearby Spy using the Voicemenu.");
|
||||
static CatVar
|
||||
voicemenu(CV_SWITCH, "spyalert_voice", "0", "Voicemenu",
|
||||
"Inform other Players of a nearby Spy using the Voicemenu.");
|
||||
static CatVar invisible(CV_SWITCH, "spyalert_invisible", "0",
|
||||
"Detect Invisible", "Detect invisible Spies.");
|
||||
|
||||
|
||||
bool warning_triggered = false;
|
||||
bool backstab_triggered = false;
|
||||
float last_say = 0.0f;
|
||||
|
@ -86,7 +86,8 @@ bool CanBacktrack()
|
||||
{
|
||||
bool good_tick = false;
|
||||
for (int j = 0; j < 12; ++j)
|
||||
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick && hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
|
||||
if (tickcnt == hacks::shared::backtrack::sorted_ticks[j].tick &&
|
||||
hacks::shared::backtrack::sorted_ticks[j].tickcount != INT_MAX)
|
||||
good_tick = true;
|
||||
tickcnt++;
|
||||
if (!good_tick)
|
||||
|
@ -1261,8 +1261,7 @@ void Move()
|
||||
}
|
||||
}
|
||||
prevlvlname = g_IEngine->GetLevelName();
|
||||
std::string prvlvlname = format(prevlvlname);
|
||||
logging::Info("%s %s", prevlvlname, prvlvlname.c_str());
|
||||
std::string prvlvlname(prevlvlname);
|
||||
if (boost::contains(prvlvlname, "pl_") ||
|
||||
boost::contains(prvlvlname, "cp_"))
|
||||
{
|
||||
|
@ -193,7 +193,8 @@ bool canReachVector(Vector loc, Vector dest)
|
||||
for (int i = 0; i < maxiterations; i++)
|
||||
{
|
||||
// math to get the next vector 40.0f in the direction of dest
|
||||
Vector vec = loc + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1);
|
||||
Vector vec =
|
||||
loc + dist / vectorMax(vectorAbs(dist)) * 40.0f * (i + 1);
|
||||
|
||||
if (DistanceToGround({vec.x,vec.y,vec.z + 5}) >= 40)
|
||||
return false;
|
||||
@ -1225,7 +1226,7 @@ void PrintChat(const char *fmt, ...)
|
||||
// does it on its own
|
||||
std::unique_ptr<char[]> strfmt(const char *fmt, ...)
|
||||
{
|
||||
//char *buf = new char[1024];
|
||||
// char *buf = new char[1024];
|
||||
auto buf = std::make_unique<char[]>(1024);
|
||||
va_list list;
|
||||
va_start(list, fmt);
|
||||
|
49
src/hitrate.cpp
Executable file → Normal file
49
src/hitrate.cpp
Executable file → Normal file
@ -6,6 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "common.hpp"
|
||||
#include <hacks/Aimbot.hpp>
|
||||
#include "MiscTemporary.hpp"
|
||||
#include "init.hpp"
|
||||
|
||||
namespace hitrate
|
||||
@ -58,7 +60,7 @@ CatCommand debug_ammo("debug_ammo", "Debug ammo", []() {
|
||||
logging::Info("%d %d", i, CE_INT(LOCAL_E, netvar.m_iAmmo + i * 4));
|
||||
}
|
||||
});
|
||||
|
||||
std::deque<int> entstocheck{};
|
||||
void Update()
|
||||
{
|
||||
CachedEntity *weapon = LOCAL_W;
|
||||
@ -67,14 +69,52 @@ void Update()
|
||||
if (LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) ||
|
||||
LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap))
|
||||
{
|
||||
/*INetChannel *ch = (INetChannel *)g_IEngine->GetNetChannelInfo();
|
||||
static int prevhits = count_hits;
|
||||
int latency = ch->GetAvgLatency(MAX_FLOWS) * 1000 + 0.5f;
|
||||
if (hacks::shared::aimbot::target_eid != -1 &&
|
||||
!timers[hacks::shared::aimbot::target_eid].check(latency))
|
||||
{
|
||||
if (count_hits > prevhits)
|
||||
{
|
||||
prevhits = count_hits;
|
||||
timers[hacks::shared::aimbot::target_eid].update();
|
||||
}
|
||||
}*/
|
||||
// ONLY tracks primary ammo
|
||||
int ammo = CE_INT(LOCAL_E, netvar.m_iAmmo + 4);
|
||||
|
||||
if (lastweapon)
|
||||
{
|
||||
if (ammo < lastammo)
|
||||
{
|
||||
// for (auto i : entstocheck)
|
||||
//{
|
||||
OnShot();
|
||||
/*static int prevent = 0;
|
||||
|
||||
if (hacks::shared::aimbot::target_eid != prevent)
|
||||
{
|
||||
entstocheck.push_back(hacks::shared::aimbot::target_eid);
|
||||
prevent = hacks::shared::aimbot::target_eid;
|
||||
timers[hacks::shared::aimbot::target_eid].update();
|
||||
}
|
||||
if (i != -1)
|
||||
{
|
||||
if (timers[i].test_and_set(latency))
|
||||
{
|
||||
bruteint[i]++;
|
||||
entstocheck[];
|
||||
}
|
||||
}
|
||||
}
|
||||
}*/
|
||||
}
|
||||
/*else if
|
||||
(timers[hacks::shared::aimbot::target_eid].check(latency / 2))
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
||||
lastweapon = weapon->m_IDX;
|
||||
lastammo = ammo;
|
||||
@ -91,7 +131,8 @@ class HurtListener : public IGameEventListener
|
||||
public:
|
||||
virtual void FireGameEvent(KeyValues *event)
|
||||
{
|
||||
if (strcmp("player_hurt", event->GetName()))
|
||||
if (strcmp("player_hurt", event->GetName()) ||
|
||||
strcmp("player_death", event->GetName()))
|
||||
return;
|
||||
if (g_IEngine->GetPlayerForUserID(event->GetInt("attacker")) ==
|
||||
g_IEngine->GetLocalPlayer())
|
||||
@ -99,7 +140,9 @@ public:
|
||||
if (CE_GOOD(LOCAL_W) &&
|
||||
(LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifle) ||
|
||||
LOCAL_W->m_iClassID() == CL_CLASS(CTFSniperRifleDecap)))
|
||||
OnHit(event->GetBool("crit"));
|
||||
OnHit(strcmp("player_death", event->GetName())
|
||||
? event->GetBool("crit")
|
||||
: false);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -304,7 +304,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
*bSendPackets = true;
|
||||
if (!g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->weapon()))
|
||||
{
|
||||
#if not LAGBOT_MODE
|
||||
@ -347,25 +346,23 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
PROF_SECTION(CM_aimbot);
|
||||
hacks::shared::aimbot::CreateMove();
|
||||
}
|
||||
IF_GAME(IsTF2())
|
||||
{
|
||||
PROF_SECTION(CM_antibackstab);
|
||||
hacks::tf2::antibackstab::CreateMove();
|
||||
}
|
||||
static int attackticks = 0;
|
||||
if (g_pUserCmd->buttons & IN_ATTACK)
|
||||
++attackticks;
|
||||
else
|
||||
attackticks = 0;
|
||||
if (semiauto)
|
||||
{
|
||||
if (g_pUserCmd->buttons & IN_ATTACK)
|
||||
{
|
||||
if (attackticks % int(semiauto) < int(semiauto) - 1)
|
||||
{
|
||||
g_pUserCmd->buttons &= ~IN_ATTACK;
|
||||
}
|
||||
}
|
||||
static int fakelag_queue = 0;
|
||||
if (CE_GOOD(LOCAL_E))
|
||||
if (fakelag_amount)
|
||||
{
|
||||
*bSendPackets = int(fakelag_amount) == fakelag_queue;
|
||||
fakelag_queue++;
|
||||
if (fakelag_queue > int(fakelag_amount))
|
||||
fakelag_queue = 0;
|
||||
}
|
||||
{
|
||||
PROF_SECTION(CM_antiaim);
|
||||
@ -396,6 +393,11 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
hacks::tf::autoheal::CreateMove();
|
||||
}
|
||||
IF_GAME(IsTF2())
|
||||
{
|
||||
PROF_SECTION(CM_antibackstab);
|
||||
hacks::tf2::antibackstab::CreateMove();
|
||||
}
|
||||
IF_GAME(IsTF2())
|
||||
{
|
||||
PROF_SECTION(CM_autobackstab);
|
||||
hacks::tf2::autobackstab::CreateMove();
|
||||
@ -466,24 +468,6 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
hacks::shared::backtrack::UpdateIncomingSequences();
|
||||
if (CE_GOOD(g_pLocalPlayer->entity))
|
||||
{
|
||||
static int fakelag_queue = 0;
|
||||
if (fakelag_amount)
|
||||
{
|
||||
if (fakelag_queue == int(fakelag_amount) ||
|
||||
(g_pUserCmd->buttons & IN_ATTACK))
|
||||
{
|
||||
*bSendPackets = true;
|
||||
}
|
||||
else if (fakelag_queue < int(fakelag_amount))
|
||||
{
|
||||
*bSendPackets = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
fakelag_queue = 0;
|
||||
}
|
||||
fakelag_queue++;
|
||||
}
|
||||
speedapplied = false;
|
||||
if (roll_speedhack &&
|
||||
g_IInputSystem->IsButtonDown(
|
||||
@ -524,7 +508,10 @@ DEFINE_HOOKED_METHOD(CreateMove, bool, void *this_, float input_sample_time,
|
||||
|
||||
ret = false;
|
||||
}
|
||||
if (cmd)
|
||||
if (cmd &&
|
||||
(cmd->buttons & IN_ATTACK ||
|
||||
!(hacks::shared::antiaim::enabled &&
|
||||
float(hacks::shared::antiaim::yaw_mode) >= 9 && !*bSendPackets)))
|
||||
g_Settings.last_angles = cmd->viewangles;
|
||||
}
|
||||
#endif
|
||||
|
@ -22,7 +22,11 @@ static CatVar chat_filter(CV_STRING, "chat_censor", "", "Censor words",
|
||||
"said, seperate with commas");
|
||||
static CatVar chat_filter_enabled(CV_SWITCH, "chat_censor_enabled", "0",
|
||||
"Enable censor", "Censor Words in chat");
|
||||
const std::string clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
|
||||
const std::string clear = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n"
|
||||
"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
|
||||
std::string lastfilter{};
|
||||
std::string lastname{};
|
||||
|
||||
|
@ -9,18 +9,16 @@
|
||||
#if not LAGBOT_MODE
|
||||
#include "hacks/Backtrack.hpp"
|
||||
#endif
|
||||
static CatVar resolver(CV_SWITCH, "resolver", "0", "Resolve angles");
|
||||
static CatVar nightmode(CV_SWITCH, "nightmode", "0", "Enable nightmode", "");
|
||||
|
||||
static CatVar nightmode(CV_FLOAT, "nightmode", "0", "Enable nightmode", "");
|
||||
namespace hooked_methods
|
||||
{
|
||||
|
||||
DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_,
|
||||
ClientFrameStage_t stage)
|
||||
{
|
||||
if (nightmode)
|
||||
{
|
||||
static int OldNightmode = 0;
|
||||
if (OldNightmode != (int) nightmode)
|
||||
static float OldNightmode = 0.0f;
|
||||
if (OldNightmode != (float) nightmode)
|
||||
{
|
||||
|
||||
static ConVar *r_DrawSpecificStaticProp =
|
||||
@ -44,13 +42,18 @@ DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_,
|
||||
if (strstr(pMaterial->GetTextureGroupName(), "World") ||
|
||||
strstr(pMaterial->GetTextureGroupName(), "StaticProp"))
|
||||
{
|
||||
if (nightmode)
|
||||
if (float(nightmode) > 0.0f)
|
||||
{
|
||||
if (strstr(pMaterial->GetTextureGroupName(),
|
||||
"StaticProp"))
|
||||
pMaterial->ColorModulate(0.3f, 0.3f, 0.3f);
|
||||
if (strstr(pMaterial->GetTextureGroupName(), "StaticProp"))
|
||||
pMaterial->ColorModulate(
|
||||
1.0f - float(nightmode) / 100.0f,
|
||||
1.0f - float(nightmode) / 100.0f,
|
||||
1.0f - float(nightmode) / 100.0f);
|
||||
else
|
||||
pMaterial->ColorModulate(0.05f, 0.05f, 0.05f);
|
||||
pMaterial->ColorModulate(
|
||||
(1.0f - float(nightmode) / 100.0f) / 6.0f,
|
||||
(1.0f - float(nightmode) / 100.0f) / 6.0f,
|
||||
(1.0f - float(nightmode) / 100.0f) / 6.0f);
|
||||
}
|
||||
else
|
||||
pMaterial->ColorModulate(1.0f, 1.0f, 1.0f);
|
||||
@ -58,7 +61,6 @@ DEFINE_HOOKED_METHOD(FrameStageNotify, void, void *this_,
|
||||
}
|
||||
OldNightmode = nightmode;
|
||||
}
|
||||
}
|
||||
static IClientEntity *ent;
|
||||
|
||||
PROF_SECTION(FrameStageNotify_TOTAL);
|
||||
|
@ -15,6 +15,20 @@ CatVar no_zoom(CV_SWITCH, "no_zoom", "0", "Disable scope",
|
||||
"Disables black scope overlay");
|
||||
static CatVar pure_bypass(CV_SWITCH, "pure_bypass", "0", "Pure Bypass",
|
||||
"Bypass sv_pure");
|
||||
int spamdur = 0;
|
||||
Timer joinspam{};
|
||||
CatCommand join_spam("join_spam", "Spam joins server for X seconds",
|
||||
[](const CCommand &args) {
|
||||
if (args.ArgC() < 1)
|
||||
return;
|
||||
int id = atoi(args.Arg(1));
|
||||
joinspam.update();
|
||||
spamdur = id;
|
||||
});
|
||||
|
||||
CatVar waittime(CV_INT, "join_debug_time", "2500", "wait time",
|
||||
"Wait this many Paint Traverse Calls between each join (~2500 "
|
||||
"recommended, higher if slower internet)");
|
||||
void *pure_orig = nullptr;
|
||||
void **pure_addr = nullptr;
|
||||
|
||||
@ -27,6 +41,45 @@ static CatVar
|
||||
static CatVar no_reportlimit(CV_SWITCH, "no_reportlimit", "0",
|
||||
"no report limit",
|
||||
"Remove playerlist report time limit");
|
||||
// static CatVar disable_ban_tf(CV_SWITCH, "disable_mm_ban", "0", "Disable MM
|
||||
// ban", "Disable matchmaking ban");
|
||||
/*static CatVar
|
||||
party_bypass(CV_SWITCH, "party_bypass", "0", "Party bypass",
|
||||
"Bypass the have to be friended restrictions on party");
|
||||
void JoinParty(uint32 steamid)
|
||||
{
|
||||
CSteamID id(steamid, EUniverse::k_EUniversePublic,
|
||||
EAccountType::k_EAccountTypeIndividual);
|
||||
re::CTFPartyClient *party = re::CTFPartyClient::GTFPartyClient();
|
||||
party->BRequestJoinPlayer(id);
|
||||
}
|
||||
CatCommand join_party("join_party",
|
||||
"Join party of target user with this steamid3",
|
||||
[](const CCommand &args) {
|
||||
if (args.ArgC() < 1)
|
||||
return;
|
||||
unsigned int steamid = atol(args.Arg(1));
|
||||
JoinParty(steamid);
|
||||
});
|
||||
CatCommand join_party("join_party", "Join this players party (steamid3, no U:1:
|
||||
and no [])", [](const CCommand &args) {
|
||||
if (args.ArgC() < 1)
|
||||
{
|
||||
g_ICvar->ConsolePrintf("Please give a steamid3, thanks.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string tofind(args.Arg(1));
|
||||
if (tofind.find("[U:1:") || tofind.find("]"))
|
||||
g_ICvar->ConsolePrintf("Invalid steamid3. Please remove the [U:1 and the
|
||||
].\n");
|
||||
unsigned int id = atol(args.Arg(1));
|
||||
if (!id)
|
||||
g_ICvar->ConsolePrintf("Invalid steamid3.\n");
|
||||
else
|
||||
JoinParty(id);
|
||||
});*/
|
||||
|
||||
bool replaced = false;
|
||||
namespace hooked_methods
|
||||
{
|
||||
@ -46,10 +99,114 @@ DEFINE_HOOKED_METHOD(PaintTraverse, void, vgui::IPanel *this_,
|
||||
|
||||
#if ENABLE_VISUALS
|
||||
if (!textures_loaded)
|
||||
{
|
||||
textures_loaded = true;
|
||||
}
|
||||
#endif
|
||||
static bool switcherido = false;
|
||||
static int scndwait = 0;
|
||||
if (scndwait > int(waittime))
|
||||
{
|
||||
scndwait = 0;
|
||||
if (switcherido && spamdur && !joinspam.check(spamdur * 1000))
|
||||
{
|
||||
auto gc = re::CTFGCClientSystem::GTFGCClientSystem();
|
||||
if (!gc)
|
||||
goto label1;
|
||||
gc->JoinMMMatch();
|
||||
}
|
||||
else if (!joinspam.check(spamdur * 1000) && spamdur)
|
||||
{
|
||||
INetChannel *ch = (INetChannel *) g_IEngine->GetNetChannelInfo();
|
||||
if (!ch)
|
||||
goto label1;
|
||||
ch->Shutdown("");
|
||||
}
|
||||
}
|
||||
label1:
|
||||
scndwait++;
|
||||
switcherido = !switcherido;
|
||||
/*static bool replacedparty = false;
|
||||
static int callcnt = 0;
|
||||
if (party_bypass && !replacedparty && callcnt < 5)
|
||||
{
|
||||
callcnt++;
|
||||
static unsigned char patch[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||
static unsigned char patch2[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||
static unsigned char patch3[] = { 0x90, 0x90 };
|
||||
static unsigned char patch4[] = { 0x90, 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||
static unsigned char patch5[] = { 0x89, 0xDE };
|
||||
static unsigned char patch6[] = { 0x90, 0xE9 };
|
||||
static unsigned char patch7[] = { 0x90, 0x90, 0x90, 0x90, 0x90 };
|
||||
uintptr_t addr =
|
||||
gSignatures.GetClientSignature("0F 84 ? ? ? ? 8B 7B ? 8D 45");
|
||||
uintptr_t addr2 = gSignatures.GetClientSignature(
|
||||
"0F 8F ? ? ? ? 80 BD ? ? ? ? ? 0F 84 ? ? ? ? 80 BD");
|
||||
uintptr_t addr3 =
|
||||
gSignatures.GetClientSignature("74 ? E8 ? ? ? ? 89 F1");
|
||||
uintptr_t addr4 = gSignatures.GetClientSignature(
|
||||
"0F 84 ? ? ? ? 8B 45 ? 8B 70 ? 8B 78 ? 8D 45");
|
||||
uintptr_t addr5 = gSignatures.GetClientSignature(
|
||||
"89 C6 74 ? 8B 43 ? 85 C0 74 ? 8B 10");
|
||||
uintptr_t addr6 = gSignatures.GetClientSignature(
|
||||
"0F 85 ? ? ? ? E8 ? ? ? ? C7 04 24 ? ? ? ? 89 44 24 ?");
|
||||
uintptr_t addr7 = gSignatures.GetClientSignature(
|
||||
"E8 ? ? ? ? 83 C3 ? 39 5D ? 0F 8F ? ? ? ? 80 BD ? ? ? ? ?");
|
||||
uintptr_t addr8 = gSignatures.GetClientSignature(
|
||||
"E8 ? ? ? ? C7 44 24 ? ? ? ? ? 89 1C 24 E8 ? ? ? ? E9 ? ? ? ? 8D "
|
||||
"B6 00 00 00 00");
|
||||
uintptr_t addr9 = gSignatures.GetClientSignature(
|
||||
"E8 ? ? ? ? A1 ? ? ? ? 8B 10 89 04 24 FF 52 ? 89 1C 24");
|
||||
uintptr_t addr10 = gSignatures.GetClientSignature(
|
||||
"74 ? 83 BB ? ? ? ? ? 0F 84 ? ? ? ? E8");
|
||||
uintptr_t addr11 = gSignatures.GetClientSignature(
|
||||
"0F 85 ? ? ? ? 8B 45 ? 8D 75 ? 31 DB");
|
||||
uintptr_t addr12 = gSignatures.GetClientSignature(
|
||||
"E8 ? ? ? ? 83 C3 ? 39 9D ? ? ? ? 0F 8F ? ? ? ? 80 BD");
|
||||
if (addr && addr2 && addr3 && addr4 && addr5 && addr6 && addr7 &&
|
||||
addr8 && addr9 && addr10 && addr11 && addr12)
|
||||
{
|
||||
logging::Info("Party bypass: 0x%08X, 0x%08X, 0x%08X, 0x%08X, "
|
||||
"0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, "
|
||||
"0x%08X, 0x%08X, 0x%08X, 0x%08X",
|
||||
addr, addr2, addr3, addr4, addr5, addr6, addr7, addr8,
|
||||
addr9, addr10, addr11, addr12);
|
||||
Patch((void *) addr, (void *) patch, sizeof(patch));
|
||||
Patch((void *) addr2, (void *) patch2, sizeof(patch2));
|
||||
Patch((void *) addr3, (void *) patch3, sizeof(patch3));
|
||||
Patch((void *) addr4, (void *) patch4, sizeof(patch4));
|
||||
Patch((void *) addr5, (void *) patch5, sizeof(patch5));
|
||||
Patch((void *) addr6, (void *) patch6, sizeof(patch6));
|
||||
Patch((void *) addr7, (void *) patch7, sizeof(patch7));
|
||||
Patch((void *) addr8 + 0x49, (void *) patch7, sizeof(patch7));
|
||||
Patch((void *) addr9, (void *) patch7, sizeof(patch7));
|
||||
Patch((void *) addr10, (void *) patch3, sizeof(patch3));
|
||||
Patch((void *) addr11, (void *) patch6, sizeof(patch6));
|
||||
Patch((void *) addr12, (void *) patch7, sizeof(patch7));
|
||||
replacedparty = true;
|
||||
}
|
||||
else
|
||||
logging::Info("No Party bypass Signature");
|
||||
}
|
||||
/*
|
||||
static bool replacedban = false;
|
||||
if (disable_ban_tf && !replacedban)
|
||||
{
|
||||
static unsigned char patch[] = { 0x31, 0xe0 };
|
||||
static unsigned char patch2[] = { 0xb0, 0x01, 0x90 };
|
||||
uintptr_t addr = gSignatures.GetClientSignature("31 C0 5B 5E 5F 5D C3 8D
|
||||
B6 00 00 00 00 BA");
|
||||
uintptr_t addr2 = gSignatures.GetClientSignature("0F 92 C0 83 C4 ? 5B 5E
|
||||
5F 5D C3 8D B4 26 00 00 00 00 83 C4");
|
||||
if (addr && addr2)
|
||||
{
|
||||
logging::Info("MM Banned: 0x%08x, 0x%08x", addr, addr2);
|
||||
Patch((void*) addr, (void *) patch, sizeof(patch));
|
||||
Patch((void*) addr2, (void *) patch2, sizeof(patch2));
|
||||
replacedban = true;
|
||||
}
|
||||
else
|
||||
logging::Info("No disable ban Signature");
|
||||
|
||||
}*/
|
||||
if (no_reportlimit && !replaced)
|
||||
{
|
||||
static unsigned char patch[] = { 0xB8, 0x01, 0x00, 0x00, 0x00 };
|
||||
|
@ -7,8 +7,8 @@
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
CatCommand printfov(
|
||||
"fov_print", "Dump achievements to file (development)", []() {
|
||||
CatCommand printfov("fov_print", "Dump achievements to file (development)",
|
||||
[]() {
|
||||
if (CE_GOOD(LOCAL_E))
|
||||
logging::Info("%d", CE_INT(LOCAL_E, netvar.iFOV));
|
||||
});
|
||||
|
@ -1,7 +1,7 @@
|
||||
target_sources(cathook PRIVATE
|
||||
"${CMAKE_CURRENT_LIST_DIR}/C_MannVsMachineStats.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CTFInventoryManager.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CTFPartyClient.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CTFParty.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/CTFGCClientSystem.cpp"
|
||||
"${CMAKE_CURRENT_LIST_DIR}/ITFGroupMatchCriteria.cpp")
|
@ -72,5 +72,16 @@ CTFParty *CTFGCClientSystem::GetParty()
|
||||
int CTFGCClientSystem::JoinMMMatch()
|
||||
{
|
||||
// TODO
|
||||
return 0;
|
||||
typedef int (*JoinMMMatch_t)(CTFGCClientSystem *);
|
||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2");
|
||||
if (!addr)
|
||||
{
|
||||
logging::Info("calling NULL!");
|
||||
addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 56 53 83 EC ? 8B 5D ? 0F B6 83 ? ? ? ? 89 C2");
|
||||
return true;
|
||||
}
|
||||
static JoinMMMatch_t JoinMMMatch_fn = JoinMMMatch_t(addr);
|
||||
return JoinMMMatch_fn(this);
|
||||
}
|
||||
|
@ -11,9 +11,9 @@
|
||||
re::CTFPartyClient *re::CTFPartyClient::GTFPartyClient()
|
||||
{
|
||||
typedef re::CTFPartyClient *(*GTFPartyClient_t)(void);
|
||||
uintptr_t addr = gSignatures.GetClientSignature(
|
||||
static 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);
|
||||
static GTFPartyClient_t GTFPartyClient_fn = GTFPartyClient_t(addr);
|
||||
|
||||
return GTFPartyClient_fn();
|
||||
}
|
||||
@ -57,9 +57,12 @@ re::CTFPartyClient::MutLocalGroupCriteria(re::CTFPartyClient *client)
|
||||
int re::CTFPartyClient::LoadSavedCasualCriteria()
|
||||
{
|
||||
typedef int (*LoadSavedCasualCriteria_t)(re::CTFPartyClient *);
|
||||
uintptr_t addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") - 0x40;
|
||||
LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn =
|
||||
static uintptr_t addr =
|
||||
gSignatures.GetClientSignature(
|
||||
"55 89 E5 8B 45 ? 5D 8B 80 ? ? ? ? C3 66 90 55 89 E5 "
|
||||
"8B 45 ? 5D 0F B6 80 ? ? ? ? C3 90 55 89 E5 56") -
|
||||
0x40;
|
||||
static LoadSavedCasualCriteria_t LoadSavedCasualCriteria_fn =
|
||||
LoadSavedCasualCriteria_t(addr);
|
||||
|
||||
return LoadSavedCasualCriteria_fn(this);
|
||||
@ -68,9 +71,9 @@ int re::CTFPartyClient::LoadSavedCasualCriteria()
|
||||
char re::CTFPartyClient::RequestQueueForMatch(int type)
|
||||
{
|
||||
typedef char (*RequestQueueForMatch_t)(re::CTFPartyClient *, int);
|
||||
uintptr_t addr = gSignatures.GetClientSignature(
|
||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? E8");
|
||||
RequestQueueForMatch_t RequestQueueForMatch_fn =
|
||||
static RequestQueueForMatch_t RequestQueueForMatch_fn =
|
||||
RequestQueueForMatch_t(addr);
|
||||
|
||||
return RequestQueueForMatch_fn(this, type);
|
||||
@ -78,11 +81,31 @@ char re::CTFPartyClient::RequestQueueForMatch(int type)
|
||||
char re::CTFPartyClient::RequestLeaveForMatch(int type)
|
||||
{
|
||||
typedef char (*RequestLeaveForMatch_t)(re::CTFPartyClient *, int);
|
||||
uintptr_t addr = gSignatures.GetClientSignature(
|
||||
static 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");
|
||||
RequestLeaveForMatch_t RequestLeaveForMatch_fn =
|
||||
static RequestLeaveForMatch_t RequestLeaveForMatch_fn =
|
||||
RequestLeaveForMatch_t(addr);
|
||||
|
||||
return RequestLeaveForMatch_fn(this, type);
|
||||
}
|
||||
int re::CTFPartyClient::BInvitePlayerToParty(CSteamID steamid)
|
||||
{
|
||||
typedef int (*BInvitePlayerToParty_t)(re::CTFPartyClient *, CSteamID, bool);
|
||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? 8B 5D ? 8B 55 ? 89 85 ? ? ? ? "
|
||||
"65 A1 ? ? ? ? 89 45 ? 31 C0 8B 45");
|
||||
static BInvitePlayerToParty_t BInvitePlayerToParty_fn =
|
||||
BInvitePlayerToParty_t(addr);
|
||||
return BInvitePlayerToParty_fn(this, steamid, false);
|
||||
}
|
||||
int re::CTFPartyClient::BRequestJoinPlayer(CSteamID steamid)
|
||||
{
|
||||
typedef int (*BRequestJoinPlayer_t)(re::CTFPartyClient *, CSteamID, bool);
|
||||
static uintptr_t addr = gSignatures.GetClientSignature(
|
||||
"55 89 E5 57 56 53 81 EC ? ? ? ? 8B 45 ? 8B 5D ? 8B 55 ? 89 85 ? ? ? ? "
|
||||
"65 A1 ? ? ? ? 89 45 ? 31 C0 8B 45");
|
||||
static BRequestJoinPlayer_t BRequestJoinPlayer_fn =
|
||||
BRequestJoinPlayer_t(addr);
|
||||
return BRequestJoinPlayer_fn(this, steamid, false);
|
||||
}
|
||||
|
@ -370,7 +370,8 @@ bool CLC_RespondCvarValue::ReadFromBuffer(bf_read &buffer)
|
||||
const char *CLC_RespondCvarValue::ToString(void) const
|
||||
{
|
||||
return strfmt("%s: status: %d, value: %s, cookie: %d", GetName(),
|
||||
m_eStatusCode, m_szCvarValue, m_iCookie).get();
|
||||
m_eStatusCode, m_szCvarValue, m_iCookie)
|
||||
.get();
|
||||
}
|
||||
|
||||
bool NET_NOP::WriteToBuffer(bf_write &buffer)
|
||||
@ -409,7 +410,8 @@ 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).get();
|
||||
m_nSpawnCount)
|
||||
.get();
|
||||
}
|
||||
|
||||
const char *CLC_VoiceData::ToString(void) const
|
||||
@ -443,7 +445,8 @@ bool CLC_VoiceData::ReadFromBuffer(bf_read &buffer)
|
||||
const char *CLC_Move::ToString(void) const
|
||||
{
|
||||
return strfmt("%s: backup %i, new %i, bytes %i", GetName(), m_nNewCommands,
|
||||
m_nBackupCommands, Bits2Bytes(m_nLength)).get();
|
||||
m_nBackupCommands, Bits2Bytes(m_nLength))
|
||||
.get();
|
||||
}
|
||||
|
||||
bool CLC_Move::WriteToBuffer(bf_write &buffer)
|
||||
|
0
src/trace.cpp
Executable file → Normal file
0
src/trace.cpp
Executable file → Normal file
@ -112,7 +112,7 @@ ITexture *GetBuffer(int i)
|
||||
TEXTURE_GROUP_RENDER_TARGET);
|
||||
else fullframe = g_IMaterialSystemHL->FindTexture(
|
||||
"_rt_FullFrameFB", TEXTURE_GROUP_RENDER_TARGET);
|
||||
//char *newname = new char[32];
|
||||
// char *newname = new char[32];
|
||||
std::unique_ptr<char[]> newname(new char[32]);
|
||||
std::string name = format("_cathook_buff", i);
|
||||
strncpy(newname.get(), name.c_str(), 30);
|
||||
|
Reference in New Issue
Block a user