From 37f3519e6ca6d55408d6ddf52f21e968156a54e4 Mon Sep 17 00:00:00 2001 From: nullifiedcat Date: Fri, 2 Dec 2016 19:51:10 +0300 Subject: [PATCH] jjjjjjjjjjjjjj --- uran/.cproject | 12 +++++----- uran/TODO | 6 ++--- uran/src/CDumper.h | 16 +++++++------- uran/src/hack.cpp | 2 ++ uran/src/hacks/Airstuck.cpp | 15 +++++++++---- uran/src/hacks/FollowBot.cpp | 7 +++--- uran/src/hacks/HAimbot.cpp | 21 +++++++++++++++--- uran/src/hacks/Misc.cpp | 4 ++-- uran/src/targeting/ITargetSystem.cpp | 22 +++++++++++++++++++ uran/{ => src}/targeting/ITargetSystem.h | 13 +++++++++++ uran/src/targeting/TargetSystemDistance.cpp | 21 ++++++++++++++++++ uran/src/targeting/TargetSystemDistance.h | 19 ++++++++++++++++ uran/src/targeting/TargetSystemFOV.cpp | 18 +++++++++++++++ uran/src/targeting/TargetSystemFOV.h | 19 ++++++++++++++++ .../{ => src}/targeting/TargetSystemSmart.cpp | 2 ++ uran/{ => src}/targeting/TargetSystemSmart.h | 4 ++++ 16 files changed, 171 insertions(+), 30 deletions(-) create mode 100644 uran/src/targeting/ITargetSystem.cpp rename uran/{ => src}/targeting/ITargetSystem.h (59%) create mode 100644 uran/src/targeting/TargetSystemDistance.cpp create mode 100644 uran/src/targeting/TargetSystemDistance.h create mode 100644 uran/src/targeting/TargetSystemFOV.cpp create mode 100644 uran/src/targeting/TargetSystemFOV.h rename uran/{ => src}/targeting/TargetSystemSmart.cpp (87%) rename uran/{ => src}/targeting/TargetSystemSmart.h (87%) diff --git a/uran/.cproject b/uran/.cproject index fab8b5f4..9368ec0e 100644 --- a/uran/.cproject +++ b/uran/.cproject @@ -88,9 +88,9 @@ - + - + @@ -140,9 +140,9 @@ - + - + @@ -231,9 +231,9 @@ - + - + diff --git a/uran/TODO b/uran/TODO index ede43860..14dc2636 100644 --- a/uran/TODO +++ b/uran/TODO @@ -2,9 +2,8 @@ MAX -> MIN priority FIX Followbot Crash Huntsman autoshoot -Ambassador CanHeadshot detection Triggerbot ignores vaccinator ubers -Ambassador & Huntsman AutoHitbox fix +Proper ambassador detection (not just CTFRevolver) No AutoShoot (aimbot/trigger) on consumables and PDAs Improve Projectile Aimbot. A lot. Integrate SEGVCATCH @@ -15,8 +14,6 @@ Aim Key mode (inverse/normal/disabled) Trigger ambassador correction ESP Icons ESP Distance sort -Don't Aim if can't shoot -No aim when cloaked Show sapped buildings in ESP Make hacks respect Mannpower powerups and other conditions when calcuating damage, hitbox and prioritizing targets Fake Lag @@ -27,6 +24,7 @@ Fixing NoZoom flickering Ambassador bodyshotting Recalculate rifles' headshot ability (Bazaar + Precision rifles) Auto Uber Flash +Auto trigger DR before rockets AutoHeal Airstuck Critical rifles bodyshotting diff --git a/uran/src/CDumper.h b/uran/src/CDumper.h index 47a0ac50..3dc90478 100644 --- a/uran/src/CDumper.h +++ b/uran/src/CDumper.h @@ -23,23 +23,23 @@ class CDumper char* TypeToString(SendPropType type) { //logging::Info("inside..."); - char* ret = "UNKNOWN"; + char* ret = (char *)"UNKNOWN"; //logging::Info("oh my"); //logging::Info("ret.. %s", ret); if (type == 0) { - ret = "INT"; + ret = (char *)"INT"; } else if (type == 1) { - ret = "FLOAT"; + ret = (char *)"FLOAT"; } else if (type == 2) { - ret = "VECTOR3"; + ret = (char *)"VECTOR3"; } else if (type == 3) { - ret = "VECTOR2"; + ret = (char *)"VECTOR2"; } else if (type == 4) { - ret = "STRING"; + ret = (char *)"STRING"; } else if (type == 5) { - ret = "ARRAY"; + ret = (char *)"ARRAY"; } else if (type == 6) { - ret = "TABLE"; + ret = (char *)"TABLE"; } //logging::Info("returning %s", ret); return ret; diff --git a/uran/src/hack.cpp b/uran/src/hack.cpp index 4b0e9d41..ec38c8d4 100644 --- a/uran/src/hack.cpp +++ b/uran/src/hack.cpp @@ -41,6 +41,7 @@ #include "entity.h" #include "localplayer.h" #include "playerresource.h" +#include "targeting/ITargetSystem.h" #include "profiler.h" @@ -212,6 +213,7 @@ void hack::Initialize() { hack::InitHacks(); logging::Info("Init global settings"); g_Settings.Init(); + InitTargetingConVars(); ConVar_Register(); logging::Info("Initializing NetVar tree..."); gNetvars.init(); diff --git a/uran/src/hacks/Airstuck.cpp b/uran/src/hacks/Airstuck.cpp index 39381cb2..73fc75bf 100644 --- a/uran/src/hacks/Airstuck.cpp +++ b/uran/src/hacks/Airstuck.cpp @@ -10,6 +10,10 @@ #include "../helpers.h" #include "../sdk/in_buttons.h" #include "../usercmd.h" +#include "../logging.h" +#include "../interfaces.h" +#include "../fixsdk.h" +#include Airstuck::Airstuck() { v_bStuck = CreateConVar("u_airstuck", "0", "Toggle airstuck"); @@ -21,14 +25,17 @@ const char* Airstuck::GetName() { bool Airstuck::CreateMove(void*, float, CUserCmd* cmd) { // TODO Airstuck. - return true; - /*if (v_bStuck->GetBool()) { + interfaces::cvar->FindVar("net_fakeloss")->SetValue(0); + interfaces::cvar->FindVar("host_timescale")->SetValue(1.0f); + if (v_bStuck->GetBool()) { if (cmd->buttons & (IN_ATTACK | IN_ATTACK2)) { return true; } - + //cmd->tick_count = 0xFFFF; + //interfaces::cvar->FindVar("net_fakeloss")->SetValue(99); + interfaces::cvar->FindVar("host_timescale")->SetValue(0.001f); } - return true;*/ + return true; } void Airstuck::PaintTraverse(void*, unsigned int, bool, bool) {}; diff --git a/uran/src/hacks/FollowBot.cpp b/uran/src/hacks/FollowBot.cpp index 7955c736..07c019a6 100644 --- a/uran/src/hacks/FollowBot.cpp +++ b/uran/src/hacks/FollowBot.cpp @@ -35,15 +35,15 @@ const char* FollowBot::GetName() { // TODO bool FollowBot::ShouldPopUber(bool force) { int health_my = g_pLocalPlayer->health; - int health_tr = GetEntityValue(interfaces::entityList->GetClientEntity(this->m_hTargetHealing), eoffsets.iHealth); + //int health_tr = GetEntityValue(interfaces::entityList->GetClientEntity(this->m_hTargetHealing), eoffsets.iHealth); if (health_my < 30) return true; - bool other_bots_have_uber = false; + //bool other_bots_have_uber = false; for (int i = 0; i < 64 && i < interfaces::entityList->GetHighestEntityIndex(); i++) { IClientEntity* ent = interfaces::entityList->GetClientEntity(i); if (ent == g_pLocalPlayer->entity) continue; if (IsFriendlyBot(ent)) { if (GetEntityValue(ent, eoffsets.iLifeState)) continue; - IClientEntity* medigun; + //IClientEntity* medigun; // TODO } } @@ -122,6 +122,7 @@ void FollowBot::Tick(CUserCmd* cmd) { owner_entity = interfaces::entityList->GetClientEntity(i); } } + if (!owner_entity) return; switch (v_iBotPackage->GetInt()) { case botpackage::BOT_FOLLOW: { diff --git a/uran/src/hacks/HAimbot.cpp b/uran/src/hacks/HAimbot.cpp index 66078ccc..1a3f1915 100644 --- a/uran/src/hacks/HAimbot.cpp +++ b/uran/src/hacks/HAimbot.cpp @@ -15,8 +15,10 @@ #include "../targethelper.h" #include "../localplayer.h" #include "../drawing.h" - -//typedef int CBaseEntity; +#include "../targeting/ITargetSystem.h" +#include "../targeting/TargetSystemSmart.h" +#include "../targeting/TargetSystemFOV.h" +#include "../targeting/TargetSystemDistance.h" #include "../fixsdk.h" #include @@ -35,12 +37,23 @@ bool fix_silent; int target_lock; +enum TargetSystem_t { + SMART = 0, + FOV = 1, + DISTANCE = 2 +}; + +ITargetSystem* target_systems[3]; + const char* HAimbot::GetName() { return "AIMBOT"; } /* null-safe */ HAimbot::HAimbot() { + target_systems[0] = new TargetSystemSmart(); + target_systems[1] = new TargetSystemFOV(); + target_systems[2] = new TargetSystemDistance(); this->v_bEnabled = CreateConVar("u_aimbot_enabled", "0", "Enables aimbot. EXPERIMENTAL AND TOTALLY NOT LEGIT"); this->v_iHitbox = CreateConVar("u_aimbot_hitbox", "0", "Hitbox"); this->v_bAutoHitbox = CreateConVar("u_aimbot_autohitbox", "1", "Autohitbox"); @@ -82,6 +95,8 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { } } + if (g_pLocalPlayer->cond_0 & cond::cloaked) return true; // TODO other kinds of cloak + if (this->v_bActiveOnlyWhenCanShoot->GetBool() && !BulletTime()) return true; if (this->v_bEnabledAttacking->GetBool() && !(cmd->buttons & IN_ATTACK)) { @@ -100,7 +115,7 @@ bool HAimbot::CreateMove(void*, float, CUserCmd* cmd) { if (this->v_bAmbassador->GetBool()) { // TODO defindex check if (g_pLocalPlayer->weapon && g_pLocalPlayer->weapon->GetClientClass()->m_ClassID == ClassID::CTFRevolver) { - if ((interfaces::gvars->curtime - GetEntityValue(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) <= 0.95) { + if ((interfaces::gvars->curtime - GetEntityValue(g_pLocalPlayer->weapon, eoffsets.flLastFireTime)) <= 1.0) { return true; } } diff --git a/uran/src/hacks/Misc.cpp b/uran/src/hacks/Misc.cpp index 2a598775..54304222 100644 --- a/uran/src/hacks/Misc.cpp +++ b/uran/src/hacks/Misc.cpp @@ -62,7 +62,7 @@ void CC_AddRage(const CCommand& args) { } void DumpRecvTable(IClientEntity* ent, RecvTable* table, int depth, const char* ft) { - bool forcetable = strlen(ft); + //bool forcetable = strlen(ft); if (!ft || !strcmp(ft, table->GetName())) logging::Info("==== TABLE: %s", table->GetName()); for (int i = 0; i < table->GetNumProps(); i++) { @@ -165,7 +165,7 @@ void CC_SayInfo(const CCommand& args) { int id = atoi(args.Arg(1)); player_info_t info; if (!interfaces::engineClient->GetPlayerInfo(id, &info)) return; - char* buf = new char[256]; + //char* buf = new char[256]; } diff --git a/uran/src/targeting/ITargetSystem.cpp b/uran/src/targeting/ITargetSystem.cpp new file mode 100644 index 00000000..511f48df --- /dev/null +++ b/uran/src/targeting/ITargetSystem.cpp @@ -0,0 +1,22 @@ +/* + * ITargetSystem.cpp + * + * Created on: Nov 30, 2016 + * Author: nullifiedcat + */ + +#include "ITargetSystem.h" +#include "../helpers.h" + +TargetingConVars* g_pTargetingConVars = 0; + +ITargetSystem::~ITargetSystem() {} + +void InitTargetingConVars() { + g_pTargetingConVars = new TargetingConVars(); + g_pTargetingConVars->bTargetInvisible = CreateConVar("u_target_ignore_cloak", "0", "Ignore cloak when targeting"); + g_pTargetingConVars->flMaxFOV = CreateConVar("u_target_max_fov", "0", "Maximum FOV when targeting"); + g_pTargetingConVars->iMaxDistance = CreateConVar("u_target_max_distance", "0", "Maximum distance when targeting"); +} + + diff --git a/uran/targeting/ITargetSystem.h b/uran/src/targeting/ITargetSystem.h similarity index 59% rename from uran/targeting/ITargetSystem.h rename to uran/src/targeting/ITargetSystem.h index 65d69972..8993ca26 100644 --- a/uran/targeting/ITargetSystem.h +++ b/uran/src/targeting/ITargetSystem.h @@ -8,6 +8,8 @@ #ifndef ITARGETSYSTEM_H_ #define ITARGETSYSTEM_H_ +// TODO Targeting. + class ITargetSystem { public: virtual ~ITargetSystem(); @@ -15,4 +17,15 @@ public: virtual int GetScore(int idx) = 0; }; +class ConVar; +struct TargetingConVars { + ConVar* bTargetInvisible; + ConVar* flMaxFOV; + ConVar* iMaxDistance; +}; + +extern TargetingConVars* g_pTargetingConVars; + +void InitTargetingConVars(); + #endif /* ITARGETSYSTEM_H_ */ diff --git a/uran/src/targeting/TargetSystemDistance.cpp b/uran/src/targeting/TargetSystemDistance.cpp new file mode 100644 index 00000000..0b88e1d8 --- /dev/null +++ b/uran/src/targeting/TargetSystemDistance.cpp @@ -0,0 +1,21 @@ +/* + * TargetSystemDistance.cpp + * + * Created on: Nov 30, 2016 + * Author: nullifiedcat + */ + +#include "TargetSystemDistance.h" + +bool TargetSystemDistance::ShouldTarget(int idx) { + //CachedEntity* ent = gEntityCache.GetEntity(idx); + //float fov = GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, GetHitboxPosition(ent->m_pEntity, )); + return false; +} + +int TargetSystemDistance::GetScore(int idx) { + return 0; +} + + + diff --git a/uran/src/targeting/TargetSystemDistance.h b/uran/src/targeting/TargetSystemDistance.h new file mode 100644 index 00000000..36b572ee --- /dev/null +++ b/uran/src/targeting/TargetSystemDistance.h @@ -0,0 +1,19 @@ +/* + * TargetSystemDistance.h + * + * Created on: Nov 30, 2016 + * Author: nullifiedcat + */ + +#ifndef TARGETSYSTEMDISTANCE_H_ +#define TARGETSYSTEMDISTANCE_H_ + +#include "ITargetSystem.h" + +class TargetSystemDistance : public ITargetSystem { +public: + bool ShouldTarget(int idx); + int GetScore(int idx); +}; + +#endif /* TARGETSYSTEMDISTANCE_H_ */ diff --git a/uran/src/targeting/TargetSystemFOV.cpp b/uran/src/targeting/TargetSystemFOV.cpp new file mode 100644 index 00000000..dbe8beae --- /dev/null +++ b/uran/src/targeting/TargetSystemFOV.cpp @@ -0,0 +1,18 @@ +/* + * TargetSystemFOV.cpp + * + * Created on: Nov 30, 2016 + * Author: nullifiedcat + */ + +#include "TargetSystemFOV.h" + +bool TargetSystemFOV::ShouldTarget(int idx) { + //CachedEntity* ent = gEntityCache.GetEntity(idx); + //float fov = GetFov(g_pLocalPlayer->v_OrigViewangles, g_pLocalPlayer->v_Eye, GetHitboxPosition(ent->m_pEntity, )); + return false; +} + +int TargetSystemFOV::GetScore(int idx) { + return 0; +} diff --git a/uran/src/targeting/TargetSystemFOV.h b/uran/src/targeting/TargetSystemFOV.h new file mode 100644 index 00000000..d1a5e4a6 --- /dev/null +++ b/uran/src/targeting/TargetSystemFOV.h @@ -0,0 +1,19 @@ +/* + * TargetSystemFOV.h + * + * Created on: Nov 30, 2016 + * Author: nullifiedcat + */ + +#ifndef TARGETSYSTEMFOV_H_ +#define TARGETSYSTEMFOV_H_ + +#include "ITargetSystem.h" + +class TargetSystemFOV : public ITargetSystem { +public: + bool ShouldTarget(int idx); + int GetScore(int idx); +}; + +#endif /* TARGETSYSTEMFOV_H_ */ diff --git a/uran/targeting/TargetSystemSmart.cpp b/uran/src/targeting/TargetSystemSmart.cpp similarity index 87% rename from uran/targeting/TargetSystemSmart.cpp rename to uran/src/targeting/TargetSystemSmart.cpp index 527f4e9c..0146062c 100644 --- a/uran/targeting/TargetSystemSmart.cpp +++ b/uran/src/targeting/TargetSystemSmart.cpp @@ -5,6 +5,8 @@ * Author: nullifiedcat */ +#include "TargetSystemSmart.h" + bool TargetSystemSmart::ShouldTarget(int idx) { return false; } diff --git a/uran/targeting/TargetSystemSmart.h b/uran/src/targeting/TargetSystemSmart.h similarity index 87% rename from uran/targeting/TargetSystemSmart.h rename to uran/src/targeting/TargetSystemSmart.h index 6169e6f5..add085a7 100644 --- a/uran/targeting/TargetSystemSmart.h +++ b/uran/src/targeting/TargetSystemSmart.h @@ -8,6 +8,10 @@ #ifndef TARGETSYSTEMSMART_H_ #define TARGETSYSTEMSMART_H_ +#include "ITargetSystem.h" + +class ConVar; + class TargetSystemSmart : public ITargetSystem { public: bool ShouldTarget(int idx);