Before mov

This commit is contained in:
nullifiedcat 2016-11-26 20:55:57 +03:00
parent d0e6715182
commit da6c50ce51
24 changed files with 114 additions and 41 deletions

View File

@ -7,13 +7,14 @@ OPTIMIZE
proper player struct proper player struct
optimize optimize
buildings aim
no autoshoot consumable no autoshoot consumable
no autoshoot disg no autoshoot disg
amby body amby body
AutoHB amby AutoHB amby
Bot Pathfinding
CRIT BODYSHOT CRIT BODYSHOT
NoZoom FIX !!! NoZoom FIX !!!

View File

@ -13,6 +13,7 @@ void GlobalSettings::Init() {
this->bHackEnabled = CreateConVar("u_enabled", "1", "Hack enabled (GLOBAL)"); this->bHackEnabled = CreateConVar("u_enabled", "1", "Hack enabled (GLOBAL)");
this->bIgnoreTaunting = CreateConVar("u_ignore_taunting", "1", "Ignore taunting players"); this->bIgnoreTaunting = CreateConVar("u_ignore_taunting", "1", "Ignore taunting players");
this->flForceFOV = CreateConVar("u_fov", "90", "Forces FOV"); this->flForceFOV = CreateConVar("u_fov", "90", "Forces FOV");
this->bProfiler = CreateConVar("u_profiler", "0", "Profiler output enabled");
} }
GlobalSettings g_Settings; GlobalSettings g_Settings;

View File

@ -17,6 +17,7 @@ public:
ConVar* flForceFOV; ConVar* flForceFOV;
ConVar* bHackEnabled; ConVar* bHackEnabled;
ConVar* bIgnoreTaunting; ConVar* bIgnoreTaunting;
ConVar* bProfiler;
}; };
extern GlobalSettings g_Settings; extern GlobalSettings g_Settings;

View File

@ -77,7 +77,6 @@ typedef void(OverrideView_t)(void*, CViewSetup*);
bool hack::invalidated = true; bool hack::invalidated = true;
void hack::Hk_OverrideView(void* thisptr, CViewSetup* setup) { void hack::Hk_OverrideView(void* thisptr, CViewSetup* setup) {
PROF_BEGIN("OverrideView Hook");
((OverrideView_t*)hooks::hkCreateMove->GetMethod(hooks::offOverrideView))(thisptr, setup); ((OverrideView_t*)hooks::hkCreateMove->GetMethod(hooks::offOverrideView))(thisptr, setup);
if (g_Settings.flForceFOV && g_Settings.flForceFOV->GetBool()) { if (g_Settings.flForceFOV && g_Settings.flForceFOV->GetBool()) {
setup->fov = g_Settings.flForceFOV->GetFloat(); setup->fov = g_Settings.flForceFOV->GetFloat();
@ -110,7 +109,9 @@ void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
if (draw::panel_top == vp) { if (draw::panel_top == vp) {
ResetStrings(); ResetStrings();
for (IHack* i_hack : hack::hacks) { for (IHack* i_hack : hack::hacks) {
//PROF_BEGIN();
i_hack->PaintTraverse(p, vp, fr, ar); i_hack->PaintTraverse(p, vp, fr, ar);
//PROF_END(strfmt("%s PaintTraverse", i_hack->GetName()));
} }
Vector screen; Vector screen;
for (int i = 0; i < gEntityCache.m_nMax && i < interfaces::entityList->GetHighestEntityIndex(); i++) { for (int i = 0; i < gEntityCache.m_nMax && i < interfaces::entityList->GetHighestEntityIndex(); i++) {
@ -122,7 +123,6 @@ void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
ESPStringCompound str = ce->GetESPString(j); ESPStringCompound str = ce->GetESPString(j);
//logging::Info("drawing [idx=%i][ns=%i] %s", i, ce->m_nESPStrings, str.m_String); //logging::Info("drawing [idx=%i][ns=%i] %s", i, ce->m_nESPStrings, str.m_String);
if (!ce->m_ESPOrigin.IsZero(1.0)) { if (!ce->m_ESPOrigin.IsZero(1.0)) {
int sw, sh;
draw::DrawString(ce->m_ESPOrigin.x, ce->m_ESPOrigin.y, str.m_Color, str.m_Background, false, str.m_String); draw::DrawString(ce->m_ESPOrigin.x, ce->m_ESPOrigin.y, str.m_Color, str.m_Background, false, str.m_String);
ce->m_ESPOrigin.y += 12; ce->m_ESPOrigin.y += 12;
} else { } else {
@ -153,10 +153,12 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
//g_pLocalPlayer->bUseSilentAngles = false; //g_pLocalPlayer->bUseSilentAngles = false;
//logging::Info("Inside CreateMove #1"); //logging::Info("Inside CreateMove #1");
for (IHack* i_hack : hack::hacks) { for (IHack* i_hack : hack::hacks) {
//PROF_BEGIN();
if (!i_hack->CreateMove(thisptr, inputSample, cmd)) { if (!i_hack->CreateMove(thisptr, inputSample, cmd)) {
ret = false; ret = false;
//g_pLocalPlayer->bUseSilentAngles = true; //g_pLocalPlayer->bUseSilentAngles = true;
} }
//PROF_END(strfmt("%s CreateMove", i_hack->GetName()));
} }
hack::invalidated = false; hack::invalidated = false;
//logging::Info("Inside CreateMove #2"); //logging::Info("Inside CreateMove #2");

15
uran/src/hacks/Airstuck.h Normal file
View File

@ -0,0 +1,15 @@
/*
* Airstuck.h
*
* Created on: Nov 26, 2016
* Author: nullifiedcat
*/
#ifndef HACKS_AIRSTUCK_H_
#define HACKS_AIRSTUCK_H_
class Airstuck : public IHack {
};
#endif /* HACKS_AIRSTUCK_H_ */

View File

@ -11,6 +11,10 @@
#include "../helpers.h" #include "../helpers.h"
#include "../sdk/in_buttons.h" #include "../sdk/in_buttons.h"
const char* AntiAim::GetName() {
return "ANTI-AIM";
}
void AntiAim::Create() { void AntiAim::Create() {
this->v_bEnabled = CreateConVar("u_aa_enabled", "0", "Enable AntiAim"); this->v_bEnabled = CreateConVar("u_aa_enabled", "0", "Enable AntiAim");
this->v_flPitch = CreateConVar("u_aa_pitch", "-89.0", "Pitch"); this->v_flPitch = CreateConVar("u_aa_pitch", "-89.0", "Pitch");

View File

@ -15,6 +15,10 @@
#include <client_class.h> #include <client_class.h>
#include <icliententity.h> #include <icliententity.h>
const char* AntiDisguise::GetName() {
return "ANTI-DISGUISE";
}
void AntiDisguise::Create() { void AntiDisguise::Create() {
v_bEnabled = CreateConVar("u_antidisguise", "1", "Disables spy disguise"); v_bEnabled = CreateConVar("u_antidisguise", "1", "Disables spy disguise");
} }

View File

@ -21,6 +21,10 @@
#include <convar.h> #include <convar.h>
#include <client_class.h> #include <client_class.h>
const char* AutoReflect::GetName() {
return "AUTO-REFLECT";
}
bool IsReflectableProjectile(IClientEntity* ent) { bool IsReflectableProjectile(IClientEntity* ent) {
if (!ent) return false; if (!ent) return false;
switch (ent->GetClientClass()->m_ClassID) { switch (ent->GetClientClass()->m_ClassID) {

View File

@ -28,6 +28,10 @@
unsigned long g_nTick = 0; unsigned long g_nTick = 0;
const char* FollowBot::GetName() {
return "FOLLOWBOT";
}
// TODO // TODO
bool FollowBot::ShouldPopUber(bool force) { bool FollowBot::ShouldPopUber(bool force) {
int health_my = g_pLocalPlayer->health; int health_my = g_pLocalPlayer->health;

View File

@ -26,10 +26,7 @@ enum botpackage {
class FollowBot : public IHack { class FollowBot : public IHack {
public: public:
void Create(); DECLARE_HACK();
bool CreateMove(void*, float, CUserCmd*);
void Destroy();
void PaintTraverse(void*, unsigned int, bool, bool);
void ProcessEntity(IClientEntity* entity, bool enemy); void ProcessEntity(IClientEntity* entity, bool enemy);
void Tick(CUserCmd*); void Tick(CUserCmd*);
int ShouldNotTarget(IClientEntity* ent, bool notrace); int ShouldNotTarget(IClientEntity* ent, bool notrace);

View File

@ -26,6 +26,7 @@
#include <cdll_int.h> #include <cdll_int.h>
#include <gametrace.h> #include <gametrace.h>
#include <engine/IEngineTrace.h> #include <engine/IEngineTrace.h>
#include <inputsystem/iinputsystem.h>
#include "../sdk/in_buttons.h" #include "../sdk/in_buttons.h"
Vector viewangles_old; Vector viewangles_old;
@ -33,6 +34,10 @@ bool fix_silent;
int target_lock; int target_lock;
const char* HAimbot::GetName() {
return "AIMBOT";
}
/* null-safe */ /* null-safe */
void HAimbot::Create() { void HAimbot::Create() {
this->v_bEnabled = CreateConVar("u_aimbot_enabled", "0", "Enables aimbot. EXPERIMENTAL AND TOTALLY NOT LEGIT"); this->v_bEnabled = CreateConVar("u_aimbot_enabled", "0", "Enables aimbot. EXPERIMENTAL AND TOTALLY NOT LEGIT");
@ -54,12 +59,23 @@ void HAimbot::Create() {
this->v_bDebug = CreateConVar("u_aimbot_debug", "0", "Aimbot debug"); this->v_bDebug = CreateConVar("u_aimbot_debug", "0", "Aimbot debug");
this->v_iFOV = CreateConVar("u_aimbot_fov", "0", "FOV aimbot (experimental)"); this->v_iFOV = CreateConVar("u_aimbot_fov", "0", "FOV aimbot (experimental)");
this->v_bMachinaPenetration = CreateConVar("u_aimbot_machina", "0", "Machina penetration aimbot (just for fun)"); this->v_bMachinaPenetration = CreateConVar("u_aimbot_machina", "0", "Machina penetration aimbot (just for fun)");
this->v_bSmooth = CreateConVar("u_aimbot_smooth", "0", "Smooth aimbot");
this->v_fSmoothValue = CreateConVar("u_aimbot_smooth_value", "5.0", "Smooth value");
this->v_iAimKey = CreateConVar("u_aimbot_aimkey", "0", "Aim Key");
fix_silent = false; fix_silent = false;
} }
bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) {
if (!this->v_bEnabled->GetBool()) return true; if (!this->v_bEnabled->GetBool()) return true;
this->m_iLastTarget = -1; this->m_iLastTarget = -1;
if (this->v_iAimKey->GetBool()) {
//bool down = false;
//interfaces::baseClient->IN_IsKeyDown(this->v_iAimKey->GetString(), down);
if (!interfaces::input->IsButtonDown((ButtonCode_t)this->v_iAimKey->GetInt())) {
return true;
}
}
if (this->v_bEnabledAttacking->GetBool() && !(cmd->buttons & IN_ATTACK)) { if (this->v_bEnabledAttacking->GetBool() && !(cmd->buttons & IN_ATTACK)) {
return true; return true;
} }
@ -274,11 +290,22 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
Vector tr = (hit - g_pLocalPlayer->v_Eye); Vector tr = (hit - g_pLocalPlayer->v_Eye);
fVectorAngles(tr, angles); fVectorAngles(tr, angles);
fClampAngle(angles); fClampAngle(angles);
bool smoothed = false;
if (this->v_bSmooth->GetBool()) {
Vector da = (angles - g_pLocalPlayer->v_OrigViewangles);
float fact = sqrt(da.x * da.x + da.y * da.y);
if (fact > this->v_fSmoothValue->GetFloat()) {
da.x = da.x / fact;
da.y = da.y / fact;
}
angles = g_pLocalPlayer->v_OrigViewangles + da;
smoothed = true;
}
cmd->viewangles = angles; cmd->viewangles = angles;
if (this->v_bSilent->GetBool()) { if (this->v_bSilent->GetBool()) {
g_pLocalPlayer->bUseSilentAngles = true; g_pLocalPlayer->bUseSilentAngles = true;
} }
if (this->v_bAutoShoot->GetBool()) { if (!smoothed && this->v_bAutoShoot->GetBool()) {
if (g_pLocalPlayer->clazz == tf_class::tf_sniper) { if (g_pLocalPlayer->clazz == tf_class::tf_sniper) {
if (g_pLocalPlayer->cond_0 & cond::zoomed) { if (g_pLocalPlayer->cond_0 & cond::zoomed) {
if (this->v_iAutoShootCharge->GetBool()) { if (this->v_iAutoShootCharge->GetBool()) {

View File

@ -15,10 +15,7 @@ class IClientEntity;
class HAimbot : public IHack { class HAimbot : public IHack {
public: public:
void Create(); DECLARE_HACK();
void Destroy();
bool CreateMove(void*, float, CUserCmd*);
void PaintTraverse(void*, unsigned int, bool, bool);
bool ShouldTarget(IClientEntity* entity); bool ShouldTarget(IClientEntity* entity);
bool Aim(IClientEntity* entity, CUserCmd* cmd); bool Aim(IClientEntity* entity, CUserCmd* cmd);
bool m_bProjectileMode; bool m_bProjectileMode;
@ -26,6 +23,9 @@ public:
bool m_bProjArc; bool m_bProjArc;
int m_iLastTarget; int m_iLastTarget;
int m_iHitbox; int m_iHitbox;
ConVar* v_iAimKey;
ConVar* v_bSmooth;
ConVar* v_fSmoothValue;
ConVar* v_bDebug; ConVar* v_bDebug;
ConVar* v_bEnabled; ConVar* v_bEnabled;
ConVar* v_iFOV; ConVar* v_iFOV;

View File

@ -20,6 +20,10 @@
#include <icliententity.h> #include <icliententity.h>
#include <tier1/convar.h> #include <tier1/convar.h>
const char* HBunnyhop::GetName() {
return "BUNNYHOP";
}
void HBunnyhop::Create() { void HBunnyhop::Create() {
this->v_bEnabled = CreateConVar("u_bhop_enabled", "1", "Enable/Disable BunnyHop"); this->v_bEnabled = CreateConVar("u_bhop_enabled", "1", "Enable/Disable BunnyHop");
} }

View File

@ -14,10 +14,7 @@ class ConVar;
class HBunnyhop : public IHack { class HBunnyhop : public IHack {
public: public:
bool CreateMove(void*, float, CUserCmd*); DECLARE_HACK();
void PaintTraverse(void*, unsigned int, bool, bool);
void Create();
void Destroy();
ConVar* v_bEnabled; ConVar* v_bEnabled;
}; };

View File

@ -24,6 +24,10 @@
#include <tier1/convar.h> #include <tier1/convar.h>
#include <cmodel.h> #include <cmodel.h>
const char* HEsp::GetName() {
return "ESP";
}
const char* classes[] = { const char* classes[] = {
"Scout", "Scout",
"Sniper", "Sniper",
@ -90,10 +94,11 @@ void HEsp::DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHei
//draw::DrawString(min(smin.x, smax.x), min(smin.y, smax.y), clr, false, "min"); //draw::DrawString(min(smin.x, smax.x), min(smin.y, smax.y), clr, false, "min");
//draw::DrawString(max(smin.x, smax.x), max(smin.y, smax.y), clr, false, "max"); //draw::DrawString(max(smin.x, smax.x), max(smin.y, smax.y), clr, false, "max");
//draw::DrawString((int)so.x, (int)so.y, draw::white, false, "origin"); //draw::DrawString((int)so.x, (int)so.y, draw::white, false, "origin");
ent->m_ESPOrigin.x = so.x + width / 2 + 3; ent->m_ESPOrigin.x = so.x + width / 2 + 1;
ent->m_ESPOrigin.y = so.y - height; ent->m_ESPOrigin.y = so.y - height;
draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, draw::black); draw::OutlineRect(so.x - width / 2 - 1, so.y - 1 - height, width + 2, height + 2, draw::black);
draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr); draw::OutlineRect(so.x - width / 2, so.y - height, width, height, clr);
draw::OutlineRect(so.x - width / 2 + 1, so.y + 1 - height, width - 2, height - 2, draw::black);
if (healthbar) { if (healthbar) {
Color hp = colors::GetHealthColor(health, healthmax); Color hp = colors::GetHealthColor(health, healthmax);
int hbh = (height) * min((float)health / (float)healthmax, 1.0f); int hbh = (height) * min((float)health / (float)healthmax, 1.0f);

View File

@ -16,10 +16,7 @@ class CachedEntity;
class HEsp : public IHack { class HEsp : public IHack {
public: public:
bool CreateMove(void*, float, CUserCmd*); DECLARE_HACK();
void PaintTraverse(void*, unsigned int, bool, bool);
void Create();
void Destroy();
void DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax); void DrawBox(CachedEntity* ent, Color clr, float widthFactor, float addHeight, bool healthbar, int health, int healthmax);
void ProcessEntity(CachedEntity* ent); void ProcessEntity(CachedEntity* ent);
void ProcessEntityPT(CachedEntity* ent); void ProcessEntityPT(CachedEntity* ent);

View File

@ -29,6 +29,10 @@
#include <client_class.h> #include <client_class.h>
#include <tier1/convar.h> #include <tier1/convar.h>
const char* HTrigger::GetName() {
return "TRIGGER";
}
Vector eye; Vector eye;
trace_t* enemy_trace; trace_t* enemy_trace;
trace::FilterDefault* filter; trace::FilterDefault* filter;

View File

@ -14,10 +14,7 @@ class ConVar;
class HTrigger : public IHack { class HTrigger : public IHack {
public: public:
bool CreateMove(void*, float, CUserCmd*); DECLARE_HACK();
void PaintTraverse(void*, unsigned int, bool, bool);
void Create();
void Destroy();
ConVar* v_bEnabled; ConVar* v_bEnabled;
ConVar* v_bIgnoreCloak; ConVar* v_bIgnoreCloak;
ConVar* v_bZoomedOnly; ConVar* v_bZoomedOnly;

View File

@ -16,6 +16,7 @@ class CCommand;
typedef unsigned int uint32; typedef unsigned int uint32;
#define DECLARE_HACK() \ #define DECLARE_HACK() \
virtual const char* GetName(); \
void Create(); \ void Create(); \
bool CreateMove(void*, float, CUserCmd*); \ bool CreateMove(void*, float, CUserCmd*); \
void Destroy(); \ void Destroy(); \
@ -24,6 +25,7 @@ typedef unsigned int uint32;
class IHack { class IHack {
public: public:
inline virtual ~IHack() {}; inline virtual ~IHack() {};
virtual const char* GetName() = 0;
inline virtual void PaintTraverse(void*, unsigned int, bool, bool) {}; inline virtual void PaintTraverse(void*, unsigned int, bool, bool) {};
inline virtual bool CreateMove(void*, float, CUserCmd*) { return true; }; inline virtual bool CreateMove(void*, float, CUserCmd*) { return true; };
inline virtual void Create() {}; inline virtual void Create() {};

View File

@ -29,6 +29,10 @@
#include <dt_common.h> #include <dt_common.h>
#include <inputsystem/iinputsystem.h> #include <inputsystem/iinputsystem.h>
const char* Misc::GetName() {
return "MISC";
}
void CC_SayLines(const CCommand& args) { void CC_SayLines(const CCommand& args) {
char cmd[256]; char cmd[256];
sprintf(cmd, "say %s", args.ArgS()); sprintf(cmd, "say %s", args.ArgS());

View File

@ -15,10 +15,7 @@ class ConCommand;
class Misc : public IHack { class Misc : public IHack {
public: public:
void Create(); DECLARE_HACK();
bool CreateMove(void*, float, CUserCmd*);
void Destroy();
void PaintTraverse(void*, unsigned int, bool, bool);
ConVar* v_bNoFlinch; ConVar* v_bNoFlinch;
ConVar* v_bNoZoom; ConVar* v_bNoZoom;

View File

@ -17,6 +17,10 @@
#include <icliententity.h> #include <icliententity.h>
#include <client_class.h> #include <client_class.h>
const char* Quickscope::GetName() {
return "QUICKSCOPE";
}
void Quickscope::Create() { void Quickscope::Create() {
v_bEnabled = CreateConVar("u_quickscope", "1", "Quickscope mode"); v_bEnabled = CreateConVar("u_quickscope", "1", "Quickscope mode");
} }

View File

@ -8,29 +8,31 @@
#include "profiler.h" #include "profiler.h"
#include "logging.h" #include "logging.h"
#include "globals.h"
#include "fixsdk.h"
#include <convar.h>
int g_ProfilerDepth = 0; int g_ProfilerDepth = 0;
char* g_ProfilerSections[MAX_PROFILER_SECTIONS]; time_t g_ProfilerSections[MAX_PROFILER_SECTIONS];
time_t g_ProfilerSectionsTime[MAX_PROFILER_SECTIONS];
void BeginSection(char* name) { void PROFILER_BeginSection() {
if (!ENABLE_PROFILER) return; if (!ENABLE_PROFILER) return;
if (g_ProfilerDepth == MAX_PROFILER_SECTIONS - 1) { if (g_ProfilerDepth == MAX_PROFILER_SECTIONS - 1) {
logging::Info("Max profiler depth reached!"); logging::Info("Max profiler depth reached!");
return; return;
} }
g_ProfilerSections[g_ProfilerDepth] = name;
g_ProfilerSectionsTime[g_ProfilerDepth] = time(0);
g_ProfilerDepth++; g_ProfilerDepth++;
g_ProfilerSections[g_ProfilerDepth] = time(0);
} }
void EndSection(char* name) { void PROFILER_EndSection(char* name) {
if (!ENABLE_PROFILER) return; if (!ENABLE_PROFILER) return;
if (g_ProfilerDepth == 0) { if (g_ProfilerDepth == 0) {
logging::Info("Profiler underflow!"); logging::Info("Profiler underflow!");
return; return;
} }
if (g_ProfilerDepth <= PROFILER_OUTPUT_DEPTH) if (g_ProfilerDepth <= PROFILER_OUTPUT_DEPTH && g_Settings.bProfiler->GetBool())
logging::Info("[PROF] %s took %lums!", g_ProfilerSections[g_ProfilerDepth], time(0) - g_ProfilerSectionsTime[g_ProfilerDepth]); logging::Info("[PROF] %s took %ims!", name, (time(0) - g_ProfilerSections[g_ProfilerDepth]));
g_ProfilerDepth--; g_ProfilerDepth--;
} }

View File

@ -10,19 +10,19 @@
#include <time.h> #include <time.h>
#define ENABLE_PROFILER true #define ENABLE_PROFILER false
#define PROFILER_OUTPUT_DEPTH 1 #define PROFILER_OUTPUT_DEPTH 1
#define MAX_PROFILER_SECTIONS 16 #define MAX_PROFILER_SECTIONS 16
#if ENABLE_PROFILER == true #if ENABLE_PROFILER == true
#define PROF_BEGIN(X) PROFILER_BeginSection(X) #define PROF_BEGIN() PROFILER_BeginSection()
#define PROF_END(X) PROFILER_EndSection(X) #define PROF_END(X) PROFILER_EndSection(X)
#else #else
#define PROF_BEGIN(X) #define PROF_BEGIN(X)
#define PROF_END(X) #define PROF_END(X)
#endif #endif
void PROFILER_BeginSection(const char* name); void PROFILER_BeginSection();
void PROFILER_EndSection(const char* name); void PROFILER_EndSection(char* name);
#endif /* PROFILER_H_ */ #endif /* PROFILER_H_ */