delete removecond
This commit is contained in:
parent
77a939426f
commit
4b0768cb4a
@ -12,7 +12,6 @@
|
||||
|
||||
#include "ac/aimbot.hpp"
|
||||
#include "ac/antiaim.hpp"
|
||||
#include "ac/removecond.hpp"
|
||||
#include "ac/bhop.hpp"
|
||||
|
||||
namespace hacks { namespace shared { namespace anticheat {
|
||||
|
@ -1,29 +0,0 @@
|
||||
/*
|
||||
* removecond.hpp
|
||||
*
|
||||
* Created on: Jun 5, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
class KeyValues;
|
||||
class CachedEntity;
|
||||
|
||||
namespace ac { namespace removecond {
|
||||
|
||||
struct ac_data {
|
||||
float stime;
|
||||
int detections;
|
||||
unsigned long last_accusation;
|
||||
};
|
||||
|
||||
void ResetEverything();
|
||||
void ResetPlayer(int idx);
|
||||
|
||||
void Init();
|
||||
void Update(CachedEntity* player);
|
||||
void Event(KeyValues* event);
|
||||
|
||||
}}
|
||||
|
@ -39,7 +39,6 @@ void CreateMove() {
|
||||
ac::bhop::Update(ent);
|
||||
}
|
||||
}
|
||||
ac::removecond::Update(ent);
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,14 +46,12 @@ void ResetPlayer(int index) {
|
||||
ac::aimbot::ResetPlayer(index);
|
||||
ac::antiaim::ResetPlayer(index);
|
||||
ac::bhop::ResetPlayer(index);
|
||||
ac::removecond::ResetPlayer(index);
|
||||
}
|
||||
|
||||
void ResetEverything() {
|
||||
ac::aimbot::ResetEverything();
|
||||
ac::antiaim::ResetEverything();
|
||||
ac::bhop::ResetEverything();
|
||||
ac::removecond::ResetEverything();
|
||||
}
|
||||
|
||||
class ACListener : public IGameEventListener {
|
||||
|
@ -9,42 +9,20 @@
|
||||
|
||||
namespace hacks { namespace shared { namespace lagexploit {
|
||||
|
||||
CatVar toggle(CV_SWITCH, "removecond_toggle", "0", "Toggle Lag Exploit", "Toggle lag exploit (RemoveCond)");
|
||||
CatVar key(CV_KEY, "removecond_key", "0", "RemoveCond Key");
|
||||
CatVar lagMasterSwitch(CV_SWITCH, "removecond_master", "1", "Master Lag Exploit Switch", "Master switch for the lag exploit\nDisabling this disables everything else that uses remove conds");
|
||||
CatVar lagValue(CV_INT, "removecond_value", "900", "RemoveCond Value", "Value of user cmds to spam with");
|
||||
CatVar toggle(CV_SWITCH, "se_toggle", "0", "Toggle sequence exploit");
|
||||
CatVar key(CV_KEY, "se_key", "0", "Sequence exploit key");
|
||||
CatVar master_switch(CV_SWITCH, "se_master", "1", "Enable sequence exploit", "Master switch for the sequence exploit\nDisabling this disables everything else that uses it");
|
||||
CatVar value(CV_INT, "se_value", "900", "Sequence exploit value", "Value of user cmds to spam with");
|
||||
|
||||
CatCommand do_lagexploit("removecond", "RemoveCond (for use in scripts)", []() {
|
||||
CatCommand do_lagexploit("se_do", "Sequence exploit (for use in scripts)", []() {
|
||||
AddExploitTicks(6);
|
||||
});
|
||||
|
||||
CatVar clear_fire(CV_SWITCH, "removecond_fire", "0", "Remove Fire");
|
||||
CatVar clear_taunt(CV_SWITCH, "removecond_taunt", "0", "Remove Taunting");
|
||||
CatVar clear_bleeding(CV_SWITCH, "removecond_bleeding", "0", "Remove Bleeding");
|
||||
CatVar clear_stun(CV_SWITCH, "removecond_stun", "0", "Remove Stun");
|
||||
CatVar instant_uncloak(CV_SWITCH, "instant_decloak", "0", "Insta Decloak", "Decloaks you on attack");
|
||||
CatVar instant_rezoom(CV_SWITCH, "instant_rezoom", "0", "Instant rezoom", "Allows you to instantly zoom after you shoot\nGreat for precharging charged shots before you can fire again\nOccasionally fails");
|
||||
|
||||
CatCommand reset_command_number("debug_reset_cmd_number", "", []() {
|
||||
*(int*)((unsigned)g_IBaseClientState + offsets::lastoutgoingcommand()) = 1;
|
||||
INetChannel* ch = (INetChannel*)g_IEngine->GetNetChannelInfo();
|
||||
int& m_nOutSequenceNr = *(int*)((unsigned)ch + offsets::m_nOutSequenceNr());
|
||||
m_nOutSequenceNr = 1;
|
||||
});
|
||||
|
||||
int exticks = 0;
|
||||
void AddExploitTicks(int ticks) {
|
||||
exticks = std::max(ticks, exticks);
|
||||
}
|
||||
|
||||
// Instant re-zoom storage vars
|
||||
bool insRezoomDepressed = false;
|
||||
bool insRezoomMain = false;
|
||||
float instant_rezoom_tick = 0;
|
||||
bool instant_rezoom_timer_active = false;
|
||||
int instant_rezoom_timer_step = 0;
|
||||
|
||||
|
||||
bool ExploitActive() {
|
||||
if (toggle) return true;
|
||||
if (exticks > 0) {
|
||||
@ -56,79 +34,13 @@ bool ExploitActive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
static CatVar mini_lag_exploit(CV_INT, "lagexploit_mini", "0", "Mini Lag Exploit");
|
||||
static CatVar instant_weapon_switch(CV_SWITCH, "instant_weapon_switch", "0", "Instant weapon switch");
|
||||
static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0", "Infinite Pickups", "Activate removecond when standing on pickups while having not full HP/Ammo");
|
||||
static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0", "Infinite Pickups", "Activate sequence exploit when standing on pickups while having not full HP/Ammo");
|
||||
|
||||
void CreateMove() {
|
||||
if (CE_BAD(LOCAL_E)) return;
|
||||
if (exticks > 0) exticks--;
|
||||
|
||||
// Pasted from kathook
|
||||
static int lastweapon = 0;
|
||||
if (instant_weapon_switch && lastweapon != g_pUserCmd->weaponselect) {
|
||||
AddExploitTicks(1);
|
||||
}
|
||||
lastweapon = g_pUserCmd->weaponselect;
|
||||
static bool flag = false;
|
||||
|
||||
if (!exticks) {
|
||||
if (instant_uncloak && HasCondition<TFCond_Cloaked>(LOCAL_E)) {
|
||||
if (g_pUserCmd->buttons & (IN_ATTACK)) {
|
||||
// if (!flag) {
|
||||
AddExploitTicks(1);
|
||||
logging::Info("Uncloaking");
|
||||
flag = true;
|
||||
// }
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
}
|
||||
|
||||
if (clear_fire && HasCondition<TFCond_OnFire>(LOCAL_E)) AddExploitTicks(3);
|
||||
if (clear_bleeding && HasCondition<TFCond_Bleeding>(LOCAL_E)) AddExploitTicks(3);
|
||||
if (clear_taunt && HasCondition<TFCond_Taunting>(LOCAL_E)) AddExploitTicks(3);
|
||||
if (clear_stun && HasCondition<TFCond_Dazed>(LOCAL_E)) AddExploitTicks(3);
|
||||
|
||||
// Check if user settings allow Instant re-zoom
|
||||
if (instant_rezoom) {
|
||||
// Is +attack is being used, set a holder var and wait untill it is depressed
|
||||
if (g_pUserCmd->buttons & IN_ATTACK && g_pLocalPlayer->bZoomed && !insRezoomMain) {
|
||||
insRezoomDepressed = true;
|
||||
// If +attack is not used while the holder var tells us it was depressed, then start running instant re-zoom
|
||||
} else if (!(g_pUserCmd->buttons & IN_ATTACK) && g_pLocalPlayer->bZoomed && insRezoomDepressed) {
|
||||
insRezoomDepressed = false;
|
||||
insRezoomMain = true;
|
||||
// Some instant recoom logic, its based on timers due to the way the lag exploit acts apon it.
|
||||
// If it would have been done better, I would do so but this works fine as is...
|
||||
} else if (insRezoomMain) {
|
||||
if (!instant_rezoom_timer_active) {
|
||||
//Setup
|
||||
instant_rezoom_timer_active = true;
|
||||
instant_rezoom_timer_step = 0;
|
||||
instant_rezoom_tick = 12;
|
||||
} else if (instant_rezoom_tick > 0 && instant_rezoom_timer_step == 0){
|
||||
instant_rezoom_tick--;
|
||||
} else if (instant_rezoom_timer_step == 0) {
|
||||
//Remove zoom cond
|
||||
AddExploitTicks(3);
|
||||
instant_rezoom_tick = 76;
|
||||
instant_rezoom_timer_step = 1;
|
||||
} else if (instant_rezoom_tick > 38 && instant_rezoom_timer_step == 1) {
|
||||
instant_rezoom_tick--;
|
||||
} else if (!g_pLocalPlayer->bZoomed && instant_rezoom_tick > 0) {
|
||||
//Re-Zoom
|
||||
instant_rezoom_timer_step == 2;
|
||||
instant_rezoom_tick--;
|
||||
if (!g_pLocalPlayer->bZoomed) g_pUserCmd->buttons |= IN_ATTACK2;
|
||||
} else {
|
||||
//Stop the function
|
||||
instant_rezoom_timer_active = false;
|
||||
insRezoomMain = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Infinite pickups (health and ammo)
|
||||
if (infinite_packs && CE_GOOD(LOCAL_E)) {
|
||||
ICollideable* p = RAW_ENT(LOCAL_E)->GetCollideable();
|
||||
@ -167,23 +79,14 @@ void CreateMove() {
|
||||
}
|
||||
}
|
||||
}
|
||||
// More paste from kathook
|
||||
if (g_pUserCmd->buttons & (IN_ATTACK | IN_ATTACK2)) {
|
||||
flag = true;
|
||||
} else {
|
||||
flag = false;
|
||||
}
|
||||
|
||||
// Previously was in GetUserCmd
|
||||
// Thanks Blackfire for helping me improve removecond!
|
||||
|
||||
if (!g_pUserCmd) return;
|
||||
if (!g_pUserCmd->command_number) return;
|
||||
if (!lagMasterSwitch) return;
|
||||
int amount = int(lagValue);
|
||||
if (!ExploitActive()) {
|
||||
amount = int(mini_lag_exploit);
|
||||
}
|
||||
if (!master_switch) return;
|
||||
int amount = int(value);
|
||||
|
||||
|
||||
if (!amount) return;
|
||||
|
@ -29,8 +29,6 @@ CatVar nopush_enabled(CV_SWITCH, "nopush_enabled", "0", "No Push", "Prevents oth
|
||||
|
||||
//CatVar no_homo(CV_SWITCH, "no_homo", "1", "No Homo", "read if gay");
|
||||
// Taunting stuff
|
||||
CatEnum spycrab_mode_enum({"DISABLED", "FORCE CRAB", "FORCE NON-CRAB"});
|
||||
CatVar spycrab_mode(spycrab_mode_enum, "spycrab", "0", "Spycrab", "Defines spycrab taunting mode");
|
||||
CatVar tauntslide(CV_SWITCH, "tauntslide", "0", "TF2C tauntslide", "Allows moving and shooting while taunting");
|
||||
CatVar tauntslide_tf2(CV_SWITCH, "tauntslide_tf2", "0", "Tauntslide", "Allows free movement while taunting with movable taunts\nOnly works in tf2");
|
||||
|
||||
@ -49,32 +47,6 @@ bool C_TFPlayer__ShouldDraw_hook(IClientEntity* thisptr) {
|
||||
|
||||
int last_number = 0;
|
||||
|
||||
// SUPER SECRET CODE DONOT STEEL
|
||||
|
||||
int no_taunt_ticks = 0;
|
||||
|
||||
typedef int(*StartSceneEvent_t)(IClientEntity* _this, int, int, void*, void*, IClientEntity*);
|
||||
StartSceneEvent_t StartSceneEvent_original = nullptr;
|
||||
int StartSceneEvent_hooked(IClientEntity* _this, int sceneInfo, int choreoScene, void* choreoEvent, void* choreoActor, IClientEntity* unknown) {
|
||||
const char* str = (const char*)((unsigned)choreoScene + 396);
|
||||
if (_this == g_IEntityList->GetClientEntity(g_IEngine->GetLocalPlayer()) && spycrab_mode && CE_GOOD(LOCAL_W) && LOCAL_W->m_iClassID == CL_CLASS(CTFWeaponPDA_Spy)) {
|
||||
if (!strcmp(str, "scenes/player/spy/low/taunt05.vcd")) {
|
||||
if ((int)spycrab_mode == 2) {
|
||||
RemoveCondition<TFCond_Taunting>(LOCAL_E);
|
||||
no_taunt_ticks = 6;
|
||||
hacks::shared::lagexploit::AddExploitTicks(15);
|
||||
}
|
||||
} else if (strstr(str, "scenes/player/spy/low/taunt")) {
|
||||
if ((int)spycrab_mode == 1) {
|
||||
RemoveCondition<TFCond_Taunting>(LOCAL_E);
|
||||
no_taunt_ticks = 6;
|
||||
hacks::shared::lagexploit::AddExploitTicks(15);
|
||||
}
|
||||
}
|
||||
}
|
||||
return StartSceneEvent_original(_this, sceneInfo, choreoScene, choreoEvent, choreoActor, unknown);
|
||||
}
|
||||
|
||||
float last_bucket = 0;
|
||||
|
||||
static CatCommand test_chat_print("debug_print_chat", "machine broke", [](const CCommand& args) {
|
||||
@ -108,7 +80,6 @@ void CreateMove() {
|
||||
static bool chc;
|
||||
static bool changed = false;
|
||||
|
||||
if (g_pUserCmd->command_number && found_crit_number > g_pUserCmd->command_number + 66 * 20) found_crit_number = 0;
|
||||
if (g_pUserCmd->command_number) last_number = g_pUserCmd->command_number;
|
||||
|
||||
static int last_checked_command_number = 0;
|
||||
@ -178,24 +149,10 @@ void CreateMove() {
|
||||
}*/
|
||||
// Spycrab stuff
|
||||
// TODO FIXME this should be moved out of here
|
||||
if (no_taunt_ticks && CE_GOOD(LOCAL_E)) {
|
||||
RemoveCondition<TFCond_Taunting>(LOCAL_E);
|
||||
no_taunt_ticks--;
|
||||
}
|
||||
IF_GAME (IsTF2()) {
|
||||
PROF_SECTION(CM_misc_hook_checks);
|
||||
static IClientEntity *localplayer = nullptr;
|
||||
localplayer = g_IEntityList->GetClientEntity(g_IEngine->GetLocalPlayer());
|
||||
if (localplayer && spycrab_mode) {
|
||||
void** vtable = *(void***)(localplayer);
|
||||
if (vtable[0x111] != StartSceneEvent_hooked) {
|
||||
StartSceneEvent_original = (StartSceneEvent_t)vtable[0x111];
|
||||
void* page = (void*)((uintptr_t)vtable &~ 0xFFF);
|
||||
mprotect(page, 0xFFF, PROT_READ | PROT_WRITE | PROT_EXEC);
|
||||
vtable[0x111] = (void*)StartSceneEvent_hooked;
|
||||
mprotect(page, 0xFFF, PROT_READ | PROT_EXEC);
|
||||
}
|
||||
}
|
||||
if (render_zoomed && localplayer) {
|
||||
// Patchking local player
|
||||
void** vtable = *(void***)(localplayer);
|
||||
|
@ -1,54 +0,0 @@
|
||||
/*
|
||||
* removecond.cpp
|
||||
*
|
||||
* Created on: Jun 5, 2017
|
||||
* Author: nullifiedcat
|
||||
*/
|
||||
|
||||
#include "common.hpp"
|
||||
|
||||
namespace ac { namespace removecond {
|
||||
|
||||
static CatVar removecond_detect(CV_SWITCH, "ac_removecond", "0", "Detect RemoveCond");
|
||||
static CatVar removecond_timer(CV_FLOAT, "ac_removecond_timer", "1.1", "RemoveCond timer");
|
||||
|
||||
ac_data data_table[32] {};
|
||||
|
||||
void ResetEverything() {
|
||||
memset(data_table, 0, sizeof(ac_data) * 32);
|
||||
}
|
||||
|
||||
void ResetPlayer(int idx) {
|
||||
memset(&data_table[idx - 1], 0, sizeof(ac_data));
|
||||
}
|
||||
|
||||
void Init() {
|
||||
ResetEverything();
|
||||
}
|
||||
|
||||
void Update(CachedEntity* player) {
|
||||
if (!removecond_detect) return;
|
||||
auto& d = data_table[player->m_IDX - 1];
|
||||
if (CE_GOOD(player)) {
|
||||
float simtime = player->var<float>(netvar.m_flSimulationTime);
|
||||
if (player->var<float>(netvar.m_flSimulationTime) != d.stime) {
|
||||
if (d.stime && (simtime - d.stime > float(removecond_timer))) {
|
||||
d.detections++;
|
||||
if (tickcount - d.last_accusation > 60 * 30 || !d.last_accusation) {
|
||||
hacks::shared::anticheat::Accuse(player->m_IDX, "Crithack/Removecond", format("Detections: ", d.detections, " dt: ", simtime - d.stime));
|
||||
d.last_accusation = tickcount;
|
||||
}
|
||||
}
|
||||
}
|
||||
d.stime = simtime;
|
||||
if (CE_BYTE(player, netvar.iLifeState)) d.stime = 0.0f;
|
||||
} else {
|
||||
d.stime = 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
void Event(KeyValues* event) {
|
||||
|
||||
}
|
||||
|
||||
}}
|
Reference in New Issue
Block a user