Some wip changes + ac fix

This commit is contained in:
BenCat07 2018-04-14 13:22:12 +02:00
parent d78495b4c2
commit 04b8bae1af
21 changed files with 1754 additions and 1679 deletions

2
TODO
View File

@ -28,8 +28,6 @@ MAX -> MIN priority // //
// // // //
Hunter Rifle? // // Hunter Rifle? // //
// // // //
AutoDetonator // //
// //
No AutoShoot when disguised // // No AutoShoot when disguised // //
Ambassador bodyshotting // // Ambassador bodyshotting // //
No Trigger Mediguns // // No Trigger Mediguns // //

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
/*
* AutoDeadringer.hpp
*
* Created on: Apr 12, 2018
* Author: bencat07
*/
#pragma once
namespace hacks
{
namespace shared
{
namespace deadringer
{
void CreateMove();
}
}
}

View File

@ -25,6 +25,7 @@
#include "AutoSticky.hpp" #include "AutoSticky.hpp"
#include "AutoDetonator.hpp" #include "AutoDetonator.hpp"
#include "AntiCheat.hpp" #include "AntiCheat.hpp"
#include "AutoDeadringer.hpp"
#include "Bunnyhop.hpp" #include "Bunnyhop.hpp"
#include "LagExploit.hpp" #include "LagExploit.hpp"
#include "Walkbot.hpp" #include "Walkbot.hpp"

View File

@ -62,6 +62,8 @@ public:
offset_t iBuildingHealth; offset_t iBuildingHealth;
offset_t iBuildingMaxHealth; offset_t iBuildingMaxHealth;
offset_t m_iAmmo; offset_t m_iAmmo;
offset_t m_iPrimaryAmmoType;
offset_t m_iSecondaryAmmoType;
offset_t iHitboxSet; offset_t iHitboxSet;
offset_t vVelocity; offset_t vVelocity;
offset_t bGlowEnabled; offset_t bGlowEnabled;
@ -72,8 +74,10 @@ public:
offset_t flNextAttack; offset_t flNextAttack;
offset_t iNextMeleeCrit; offset_t iNextMeleeCrit;
offset_t flNextPrimaryAttack; offset_t flNextPrimaryAttack;
offset_t flNextSecondaryAttack;
offset_t iNextThinkTick; offset_t iNextThinkTick;
offset_t m_iClip1; offset_t m_iClip1;
offset_t m_iClip2;
// offset_t flReloadPriorNextFire; // offset_t flReloadPriorNextFire;
// offset_t flObservedCritChance; // offset_t flObservedCritChance;
offset_t nTickBase; offset_t nTickBase;

View File

@ -18,6 +18,6 @@ public:
static C_MannVsMachineStats *G_MannVsMachineStats(); static C_MannVsMachineStats *G_MannVsMachineStats();
public: public:
int* AddLocalPlayerUpgrade(int id, int &a3); int *AddLocalPlayerUpgrade(int id, int &a3);
}; };
} }

9
include/reclasses/C_TFWeaponBaseMelee.hpp Executable file → Normal file
View File

@ -22,9 +22,12 @@ public:
self, offsets::PlatformOffset(522, offsets::undefined, 522), self, offsets::PlatformOffset(522, offsets::undefined, 522),
0)(self, trace); 0)(self, trace);
} }
inline static int GetSwingRange(IClientEntity* self) { inline static int GetSwingRange(IClientEntity *self)
typedef int (*fn_t)(IClientEntity*); {
return vfunc<fn_t>(self, offsets::PlatformOffset(520, offsets::undefined, 520), 0)(self); typedef int (*fn_t)(IClientEntity *);
return vfunc<fn_t>(
self, offsets::PlatformOffset(520, offsets::undefined, 520),
0)(self);
} }
}; };
} }

File diff suppressed because it is too large Load Diff

View File

@ -253,7 +253,7 @@ bool ShouldAA(CUserCmd *cmd)
if (!enabled) if (!enabled)
return false; return false;
if (hacks::tf2::antibackstab::noaa) if (hacks::tf2::antibackstab::noaa)
return false; return false;
if (cmd->buttons & IN_USE) if (cmd->buttons & IN_USE)
return false; return false;
if ((cmd->buttons & IN_ATTACK) && if ((cmd->buttons & IN_ATTACK) &&

View File

@ -103,7 +103,7 @@ void CreateMove()
spy = ClosestSpy(); spy = ClosestSpy();
if (spy) if (spy)
{ {
noaa = true; noaa = true;
const Vector &A = LOCAL_E->m_vecOrigin; const Vector &A = LOCAL_E->m_vecOrigin;
const Vector &B = spy->m_vecOrigin; const Vector &B = spy->m_vecOrigin;
diff = (A - B); diff = (A - B);
@ -128,7 +128,7 @@ void CreateMove()
SayNope(); SayNope();
} }
else else
noaa = false; noaa = false;
} }
void PaintTraverse() void PaintTraverse()

View File

@ -0,0 +1,50 @@
/*
* AutoDeadringer.cpp
*
* Created on: Apr 12, 2018
* Author: bencat07
*/
#include "common.hpp"
namespace hacks
{
namespace shared
{
namespace deadringer
{
CatVar enabled(CV_SWITCH, "deadringer_auto", "0", "Auto deadringer",
"automatically pull out DR on low health or projectile nearby");
bool IsProjectile(CachedEntity *ent)
{
return (ent->m_iClassID == CL_CLASS(CTFProjectile_Rocket) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_Flare) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_EnergyBall) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_HealingBolt) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_Arrow) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_SentryRocket) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_Cleaver) ||
ent->m_iClassID == CL_CLASS(CTFGrenadePipebombProjectile) ||
ent->m_iClassID == CL_CLASS(CTFProjectile_EnergyRing));
}
void CreateMove()
{
if (CE_BAD(LOCAL_E))
return;
if (!HasWeapon(LOCAL_E, 59) || CE_INT(LOCAL_E, netvar.m_bFeignDeathReady) == 1)
return;
if (CE_INT(LOCAL_E, netvar.iHealth) < 30)
g_pUserCmd->buttons |= IN_ATTACK2;
for (int i = 0; i < HIGHEST_ENTITY; i++)
{
CachedEntity *ent = ENTITY(i);
if (CE_BAD(ent))
continue;
if (!IsProjectile(ent))
continue;
if (ent->m_flDistance < 100.0f)
g_pUserCmd->buttons |= IN_ATTACK2;
}
}
}
}
}

View File

@ -80,7 +80,7 @@ static CatVar infinite_packs(CV_SWITCH, "infinite_packs", "0",
"Infinite Pickups", "Infinite Pickups",
"Activate sequence exploit when standing on " "Activate sequence exploit when standing on "
"pickups while having not full HP/Ammo"); "pickups while having not full HP/Ammo");
float servertime, nextattack; float servertime, nextattack, nextattack2;
static int lastwep = 0; static int lastwep = 0;
void CreateMove() void CreateMove()
{ {
@ -430,6 +430,7 @@ void CreateMove()
if (doom || razorback) if (doom || razorback)
{ {
static int i = 0; static int i = 0;
static int i2 = 0;
servertime = servertime =
(float) (CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) * (float) (CE_INT(g_pLocalPlayer->entity, netvar.nTickBase)) *
g_GlobalVars->interval_per_tick; g_GlobalVars->interval_per_tick;
@ -437,22 +438,31 @@ void CreateMove()
g_pLocalPlayer->weapon()->m_iClassID != lastwep) g_pLocalPlayer->weapon()->m_iClassID != lastwep)
nextattack = nextattack =
CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack); CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextPrimaryAttack);
if (!nextattack2 || !i ||
g_pLocalPlayer->weapon()->m_iClassID != lastwep)
nextattack2 =
CE_FLOAT(g_pLocalPlayer->weapon(), netvar.flNextSecondaryAttack);
if (servertime - nextattack > 75.0f) if (servertime - nextattack > 75.0f)
nextattack = servertime - 75.0f; nextattack = servertime - 75.0f;
if (doom && servertime - nextattack > 0.0f && if (servertime - nextattack2 > 75.0f)
(g_pUserCmd->buttons & IN_ATTACK || nextattack2 = servertime - 75.0f;
g_pUserCmd->buttons & IN_ATTACK2)) if (doom && servertime - nextattack > 0.0f && g_pUserCmd->buttons & IN_ATTACK)
{ {
if (!i) if (!i)
i = ((int) servertime - (int) nextattack); i = ((int) servertime - (int) nextattack);
amount = i * 66; amount = i * 66;
if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1) == 0) if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip1) == 0)
{ g_pUserCmd->buttons &= ~IN_ATTACK;
g_pUserCmd->buttons &= ~IN_ATTACK;
g_pUserCmd->buttons &= ~IN_ATTACK2;
}
} }
else if (razorback && servertime - nextattack > 3.0f && if (doom && servertime - nextattack2 > 0.0f && g_pUserCmd->buttons & IN_ATTACK2) {
if (!i2)
i2 = ((int) servertime - (int) nextattack2);
amount = i2 * 66;
if (CE_INT(g_pLocalPlayer->weapon(), netvar.m_iClip2) == 0)
g_pUserCmd->buttons &= ~IN_ATTACK2;
}
if (razorback && servertime - nextattack > 3.0f &&
(g_pUserCmd->buttons & IN_ATTACK || (g_pUserCmd->buttons & IN_ATTACK ||
g_pUserCmd->buttons & IN_ATTACK2)) g_pUserCmd->buttons & IN_ATTACK2))
{ {
@ -484,10 +494,14 @@ void CreateMove()
void Draw() void Draw()
{ {
#if ENABLE_VISUALS == 1 #if ENABLE_VISUALS == 1
if (doom && servertime - nextattack > 0.0f) if (doom && (servertime - nextattack > 0.0f || servertime - nextattack2))
{ {
auto amount = (int) servertime - (int) nextattack; auto amount = (int) servertime - (int) nextattack;
AddCenterString(format("Fireable amount: ", amount), colors::orange); auto amount2 = (int) servertime - (int) nextattack2;
if (amount > 0.0f)
AddCenterString(format("Fireable Primary amount: ", amount), colors::orange);
if (amount2 > 0.0f)
AddCenterString(format("Fireable Secondary amount: ", amount2), colors::orange);
} }
if (razorback) if (razorback)
if (servertime - nextattack > 3.0f) if (servertime - nextattack > 3.0f)

View File

@ -487,39 +487,36 @@ void DrawText()
void Schema_Reload() void Schema_Reload()
{ {
logging::Info("Custom schema loading is not supported right now."); logging::Info("Custom schema loading is not supported right now.");
/*
static uintptr_t InitSchema_s = gSignatures.GetClientSignature("55 89 E5 57 static uintptr_t InitSchema_s = gSignatures.GetClientSignature("55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 7D ? 8B 03 89 1C 24 FF 50 ? C7 04 24 ? ? ? ?");
56 53 83 EC 4C 0F B6 7D 14 C7 04 ? ? ? ? 01 8B 5D 18 8B 75 0C 89 5C 24 04 E8 typedef bool(*InitSchema_t)(void*, CUtlBuffer &, int);
? ? ? ? 89 F8 C7 45 C8 00 00 00 00 8D 7D C8 84 C0 8B 45 10 C7 45 CC"); static InitSchema_t InitSchema =
typedef void(*InitSchema_t)(void*, void*, CUtlBuffer& buffer, bool byte,
unsigned version); static InitSchema_t InitSchema =
(InitSchema_t)InitSchema_s; static uintptr_t GetItemSchema_s = (InitSchema_t)InitSchema_s; static uintptr_t GetItemSchema_s =
gSignatures.GetClientSignature("55 89 E5 83 EC 18 89 5D F8 8B 1D ? ? ? ? 89 gSignatures.GetClientSignature("55 89 E5 83 EC ? E8 ? ? ? ? C9 83 C0 ? C3 55 89 E5 8B 45 ?");
7D FC 85 DB 74 12 89 D8 8B 7D FC 8B 5D F8 89 EC 5D C3 8D B6 00 00 00 00 C7 typedef void*(*GetItemSchema_t)(void);
04 24 A8 06 00 00 E8 ? ? ? ? B9 AA 01 00 00 89 C3 31 C0 89 DF"); typedef static GetItemSchema_t GetItemSchema = (GetItemSchema_t)GetItemSchema_s; //(*(uintptr_t*)GetItemSchema_s +GetItemSchema_s + 4);
void*(*GetItemSchema_t)(void); static GetItemSchema_t GetItemSchema =
(GetItemSchema_t)GetItemSchema_s;//(*(uintptr_t*)GetItemSchema_s +
GetItemSchema_s + 4);
logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema); logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema);
void* itemschema = (void*)((unsigned)GetItemSchema() + 4); void* itemschema = (void*)((unsigned)GetItemSchema() + 4);
void* data; void* data;
passwd* pwd = getpwuid(getuid()); char* path = strfmt("/opt/cathook/data/items_game.txt");
char* user = pwd->pw_name;
char* path = strfmt("/home/%s/.cathook/items_game.txt", user);
FILE* file = fopen(path, "r"); FILE* file = fopen(path, "r");
delete [] path; delete [] path;
fseek(file, 0L, SEEK_END); fseek(file, 0L, SEEK_END);
char buffer[4 * 1000 * 1000]; char buffer[5 * 1000 * 1000];
size_t len = ftell(file); size_t len = ftell(file);
rewind(file); rewind(file);
buffer[len + 1] = 0; buffer[len + 1] = 0;
fread(&buffer, sizeof(char), len, file); fread(&buffer, sizeof(char), len, file);
fclose(file); fclose(file);
CUtlBuffer buf(&buffer, 4 * 1000 * 1000, 9); CUtlBuffer buf(&buffer, 5 * 1000 * 1000, 9);
if (ferror(file) != 0) {
logging::Info("Error loading file");
return;
}
logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema); logging::Info("0x%08x 0x%08x", InitSchema, GetItemSchema);
InitSchema(0, itemschema, buf, false, 0xDEADCA7); bool ret = InitSchema(GetItemSchema(), buf, 133769);
*/ logging::Info("Loading %s", ret ? "Successful" : "Unsuccessful");
} }
CatCommand schema("schema", "Load custom schema", Schema_Reload); CatCommand schema("schema", "Load custom schema", Schema_Reload);

View File

@ -49,8 +49,12 @@ void Update(CachedEntity *player)
{ {
auto &angles = angles::data(player); auto &angles = angles::data(player);
float deviation = angles.deviation(2); float deviation = angles.deviation(2);
int widx = CE_INT(player, netvar.hActiveWeapon) & 0xFFF;
CachedEntity* wep = ENTITY(widx);
if (!CE_GOOD(wep))
return;
if (deviation > float(detect_angle) && if (deviation > float(detect_angle) &&
player->m_iClassID != CL_CLASS(CTFFlameThrower)) wep->m_iClassID != CL_CLASS(CTFFlameThrower))
{ {
am++; am++;
// logging::Info("[ac] %d deviation %.2f #%d", player->m_IDX, // logging::Info("[ac] %d deviation %.2f #%d", player->m_IDX,

4
src/hooks/CreateMove.cpp Executable file → Normal file
View File

@ -357,6 +357,10 @@ bool CreateMove_hook(void *thisptr, float inputSample, CUserCmd *cmd)
PROF_SECTION(CM_noisemaker); PROF_SECTION(CM_noisemaker);
hacks::tf2::noisemaker::CreateMove(); hacks::tf2::noisemaker::CreateMove();
} }
{
PROF_SECTION(CM_deadringer);
hacks::shared::deadringer::CreateMove();
}
{ {
PROF_SECTION(CM_bunnyhop); PROF_SECTION(CM_bunnyhop);
hacks::shared::bunnyhop::CreateMove(); hacks::shared::bunnyhop::CreateMove();

View File

@ -1011,7 +1011,9 @@ CatEnum skys({ "sky_tf2_04",
static CatVar static CatVar
skybox_changer(skys, "skybox_changer", "0", "Change Skybox to this skybox", skybox_changer(skys, "skybox_changer", "0", "Change Skybox to this skybox",
"Change Skybox to this skybox, only changes on map load"); "Change Skybox to this skybox, only changes on map load");
static CatVar halloween_mode(CV_SWITCH, "halloween_mode", "Forced Halloween mode", "forced tf_forced_holiday 2"); static CatVar halloween_mode(CV_SWITCH, "halloween_mode", "0",
"Forced Halloween mode",
"forced tf_forced_holiday 2");
void LevelInit_hook(void *_this, const char *newmap) void LevelInit_hook(void *_this, const char *newmap)
{ {
static const LevelInit_t original = static const LevelInit_t original =
@ -1025,12 +1027,11 @@ void LevelInit_hook(void *_this, const char *newmap)
bool load_success = LoadNamedSkys(skynum[(int) skybox_changer]); bool load_success = LoadNamedSkys(skynum[(int) skybox_changer]);
logging::Info("Skybox Loading successful: %s", logging::Info("Skybox Loading successful: %s",
load_success ? "true" : "false"); load_success ? "true" : "false");
ConVar* holiday = g_ICvar->FindVar("tf_forced_holiday"); ConVar *holiday = g_ICvar->FindVar("tf_forced_holiday");
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(2);
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec"); g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
hacks::shared::aimbot::Reset(); hacks::shared::aimbot::Reset();
chat_stack::Reset(); chat_stack::Reset();

View File

@ -655,6 +655,7 @@ static const std::string list_tf2 = R"(
] ]
"Misc" [ "Misc" [
"Misc Menu" "Misc Menu"
"deadringer_auto"
"halloween_mode" "halloween_mode"
"name" "name"
"disconnect_reason" "disconnect_reason"

View File

@ -28,8 +28,14 @@ void NetVars::Init()
this->movetype = gNetvars.get_offset("DT_BaseEntity", "movetype"); this->movetype = gNetvars.get_offset("DT_BaseEntity", "movetype");
this->m_iAmmo = this->m_iAmmo =
gNetvars.get_offset("DT_BasePlayer", "localdata", "m_iAmmo"); gNetvars.get_offset("DT_BasePlayer", "localdata", "m_iAmmo");
this->m_iPrimaryAmmoType =
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iPrimaryAmmoType");
this->m_iSecondaryAmmoType =
gNetvars.get_offset("DT_LocalWeaponData", "localdata", "m_iSecondaryAmmoType");
this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon", this->m_iClip1 = gNetvars.get_offset("DT_BaseCombatWeapon",
"LocalWeaponData", "m_iClip1"); "LocalWeaponData", "m_iClip1");
this->m_iClip2 = gNetvars.get_offset("DT_BaseCombatWeapon",
"LocalWeaponData", "m_iClip2");
this->m_Collision = gNetvars.get_offset("DT_BaseEntity", "m_Collision"); this->m_Collision = gNetvars.get_offset("DT_BaseEntity", "m_Collision");
m_flSimulationTime = m_flSimulationTime =
gNetvars.get_offset("DT_BaseEntity", "m_flSimulationTime"); gNetvars.get_offset("DT_BaseEntity", "m_flSimulationTime");
@ -156,6 +162,9 @@ void NetVars::Init()
this->flNextPrimaryAttack = this->flNextPrimaryAttack =
gNetvars.get_offset("DT_BaseCombatWeapon", "LocalActiveWeaponData", gNetvars.get_offset("DT_BaseCombatWeapon", "LocalActiveWeaponData",
"m_flNextPrimaryAttack"); "m_flNextPrimaryAttack");
this->flNextSecondaryAttack =
gNetvars.get_offset("DT_BaseCombatWeapon", "LocalActiveWeaponData",
"m_flNextSecondaryAttack");
this->iNextThinkTick = gNetvars.get_offset( this->iNextThinkTick = gNetvars.get_offset(
"DT_BaseCombatWeapon", "LocalActiveWeaponData", "m_nNextThinkTick"); "DT_BaseCombatWeapon", "LocalActiveWeaponData", "m_nNextThinkTick");
this->nTickBase = this->nTickBase =

View File

@ -19,10 +19,9 @@ C_MannVsMachineStats *C_MannVsMachineStats::G_MannVsMachineStats()
return G_MannVsMachineStats_fn(); return G_MannVsMachineStats_fn();
} }
int* C_MannVsMachineStats::AddLocalPlayerUpgrade(int id, int &a3) int *C_MannVsMachineStats::AddLocalPlayerUpgrade(int id, int &a3)
{ {
typedef int *(*AddLocalPlayerUpgrade_t)(C_MannVsMachineStats *, int, typedef int *(*AddLocalPlayerUpgrade_t)(C_MannVsMachineStats *, int, int);
int);
static uintptr_t addr = gSignatures.GetClientSignature( static uintptr_t addr = gSignatures.GetClientSignature(
"55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 75 ? 8B 7D ? 8B 43 ? 8B 53 ? 83 " "55 89 E5 57 56 53 83 EC ? 8B 5D ? 8B 75 ? 8B 7D ? 8B 43 ? 8B 53 ? 83 "
"C0 ? 39 D0 7E ? 29 D0 89 1C 24 89 44 24 ? E8 ? ? ? ? 8B 43 ? 83 C0 ? " "C0 ? 39 D0 7E ? 29 D0 89 1C 24 89 44 24 ? E8 ? ? ? ? 8B 43 ? 83 C0 ? "

View File

@ -37,8 +37,8 @@ void queue_start()
re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient(); re::CTFPartyClient *client = re::CTFPartyClient::GTFPartyClient();
if (client) if (client)
{ {
if (queue == 7) if (queue == 7)
client->LoadSavedCasualCriteria(); client->LoadSavedCasualCriteria();
client->RequestQueueForMatch((int) queue); client->RequestQueueForMatch((int) queue);
} }
else else