diff --git a/uran/.cproject b/uran/.cproject
index f3ee84db..212da46d 100644
--- a/uran/.cproject
+++ b/uran/.cproject
@@ -67,7 +67,7 @@
diff --git a/uran/src/drawing.cpp b/uran/src/drawing.cpp
index 951188e6..10928bc5 100644
--- a/uran/src/drawing.cpp
+++ b/uran/src/drawing.cpp
@@ -13,6 +13,8 @@
#include
#include
#include
+#include
+#include
// TODO globals
unsigned long draw::font_handle = 0;
@@ -25,6 +27,11 @@ Color draw::red(184, 56, 59, 255);
Color draw::blue(88, 133, 162, 255);
Color draw::yellow(255, 255, 0, 255);
+ESPStringCompound::ESPStringCompound() {
+ m_Color = nullptr;
+ m_String = nullptr;
+}
+
void draw::Initialize() {
draw::font_handle = interfaces::surface->CreateFont();
draw::font_handle_large = interfaces::surface->CreateFont();
@@ -55,6 +62,17 @@ void draw::DrawString(int x, int y, Color color, bool center, const char* text,
draw::DrawString(draw::font_handle, x, y, color, string);
}
+bool draw::EntityCenterToScreen(IClientEntity* entity, Vector& out) {
+ if (!entity) return false;
+ Vector world;
+ Vector min, max;
+ entity->GetRenderBounds(min, max);
+ world = entity->GetAbsOrigin();
+ world.z += (min.z + max.z) / 2;
+ Vector scr;
+ return draw::WorldToScreen(world, scr);
+}
+
bool draw::WorldToScreen(Vector& origin, Vector& screen) {
VMatrix wts = interfaces::engineClient->WorldToScreenMatrix();
screen.z = 0;
diff --git a/uran/src/drawing.h b/uran/src/drawing.h
index f10981c9..683da91f 100644
--- a/uran/src/drawing.h
+++ b/uran/src/drawing.h
@@ -10,6 +10,13 @@
class Color;
class Vector;
+class IClientEntity;
+
+struct ESPStringCompound {
+ ESPStringCompound();
+ char* m_String;
+ Color* m_Color;
+};
namespace draw {
@@ -27,6 +34,7 @@ void Initialize();
void DrawString(unsigned long font, int x, int y, Color color, const wchar_t* text);
void DrawString(int x, int y, Color color, bool center, const char* text, ...);
bool WorldToScreen(Vector &origin, Vector &screen);
+bool EntityCenterToScreen(IClientEntity* entity, Vector& out);
void OutlineRect(int x, int y, int w, int h, Color color);
void GetStringLength(wchar_t* string, int& length, int& height);
diff --git a/uran/src/entitycache.cpp b/uran/src/entitycache.cpp
new file mode 100644
index 00000000..e136d7b1
--- /dev/null
+++ b/uran/src/entitycache.cpp
@@ -0,0 +1,92 @@
+/*
+ * entitycache.cpp
+ *
+ * Created on: Nov 7, 2016
+ * Author: nullifiedcat
+ */
+
+#include "entitycache.h"
+#include "drawing.h"
+#include "interfaces.h"
+#include "logging.h"
+#include "enums.h"
+#include "entity.h"
+
+#include "fixsdk.h"
+#include
+#include
+#include
+#include
+
+CachedEntity::CachedEntity() {
+ m_pEntity = nullptr;
+ m_Strings = new ESPStringCompound[MAX_STRINGS]();
+ m_nESPStrings = 0;
+}
+
+CachedEntity::~CachedEntity() {
+ delete m_Strings;
+}
+
+void CachedEntity::Update(int idx) {
+ m_pEntity = interfaces::entityList->GetClientEntity(idx);
+ if (!m_pEntity) {
+ //logging::Info("Tried to cache entity with index %i, null");
+ m_bNULL = true;
+ return;
+ }
+ m_nESPStrings = 0;
+
+ m_iClassID = m_pEntity->GetClientClass()->m_ClassID;
+ m_bDormant = m_pEntity->IsDormant();
+
+ if (m_iClassID == ClassID::CTFPlayer
+ || m_iClassID == ClassID::CObjectSentrygun
+ || m_iClassID == ClassID::CObjectDispenser
+ || m_iClassID == ClassID::CObjectTeleporter
+ || m_iClassID == ClassID::CTFStickBomb
+ || m_iClassID == ClassID::CTFGrenadePipebombProjectile) {
+
+ m_iTeam = GetEntityValue(m_pEntity, eoffsets.iTeamNum);
+ m_bEnemy = (m_iTeam != g_pLocalPlayer->team);
+ m_iHealth = GetEntityValue(m_pEntity, eoffsets.iHealth);
+ }
+}
+
+void CachedEntity::AddESPString(Color color, const char* string) {
+ if (m_nESPStrings >= MAX_STRINGS) {
+ logging::Info("Can't attach more than %i strings to an entity", MAX_STRINGS);
+ return;
+ }
+ if (m_nESPStrings < 0) {
+ logging::Info("Invalid string count !!!");
+ return;
+ }
+ m_Strings[m_nESPStrings].m_Color = &color;
+ m_Strings[m_nESPStrings].m_String = (char*)string;
+ m_nESPStrings++;
+}
+
+EntityCache::EntityCache() {
+ m_pArray = new CachedEntity[4096]();
+}
+
+EntityCache::~EntityCache() {
+ delete m_pArray;
+}
+
+void EntityCache::Update() {
+ m_nMax = interfaces::entityList->GetHighestEntityIndex();
+ for (int i = 0; i < m_nMax; i++) {
+ m_pArray[i].Update(i);
+ }
+}
+
+CachedEntity* EntityCache::GetEntity(int idx) {
+ if (idx < 0 || idx >= m_nMax) {
+ logging::Info("Requested invalid entity: %i", idx);
+ }
+ return &(m_pArray[idx]);
+}
+
+EntityCache gEntityCache;
diff --git a/uran/src/entitycache.h b/uran/src/entitycache.h
new file mode 100644
index 00000000..442335f4
--- /dev/null
+++ b/uran/src/entitycache.h
@@ -0,0 +1,82 @@
+/*
+ * entitycache.h
+ *
+ * Created on: Nov 7, 2016
+ * Author: nullifiedcat
+ */
+
+#ifndef ENTITYCACHE_H_
+#define ENTITYCACHE_H_
+
+class IClientEntity;
+class Color;
+struct ESPStringCompound;
+
+#define MAX_STRINGS 16
+
+class CachedEntity {
+public:
+ CachedEntity();
+ ~CachedEntity();
+
+ void Update(int idx);
+ void AddESPString(Color color, const char* string);
+
+ // Entity fields start here.
+
+ bool m_bNULL;
+ bool m_bDormant;
+ int m_iClassID;
+
+ // CBaseEntity
+ int m_iTeamNum;
+ bool m_bEnemy;
+
+ // CBasePlayer
+ bool m_bIsAlivePlayer;
+ int m_fFlags;
+ int m_lifeState;
+ int m_iHealth;
+ Vector m_vecViewOffset;
+
+ // CBaseCombatCharacter
+ int m_hActiveWeapon;
+ IClientEntity* m_activeWeapon;
+
+ // CTFPlayer
+ bool m_bIsCritBoosted;
+ bool m_bIsInvulnerable;
+
+ int m_iCond;
+ int m_iCondEx;
+ int m_iCondEx2;
+ int m_iCondEx3;
+ float m_flChargeMeter;
+ float m_flEnergyDrinkMeter;
+ int m_nNumHealers;
+
+ // Players, Buildings, Stickies
+
+
+ // Entity fields end here.
+
+ IClientEntity* m_pEntity;
+ ESPStringCompound* m_Strings;
+ int m_nESPStrings;
+};
+
+class EntityCache {
+public:
+ EntityCache();
+ ~EntityCache();
+
+ void Update();
+ CachedEntity* GetEntity(int idx);
+
+ CachedEntity* m_pArray;
+ int m_nMax;
+};
+
+extern EntityCache gEntityCache;
+
+#endif /* ENTITYCACHE_H_ */
diff --git a/uran/src/enums.h b/uran/src/enums.h
index 0816bffa..0cfb5cab 100644
--- a/uran/src/enums.h
+++ b/uran/src/enums.h
@@ -148,6 +148,364 @@ enum entities {
E_PLAYER = 241
};
+enum ClassID {
+ CTFWearableLevelableItem = 326,
+ CTFWearableDemoShield = 324,
+ CTFBaseRocket = 184,
+ CTFWeaponBaseMerasmusGrenade = 313,
+ CTFWeaponBaseMelee = 312,
+ CTFWeaponBaseGun = 311,
+ CTFWeaponBaseGrenadeProj = 310,
+ CTFWeaponBase = 309,
+ CTFWearableRobotArm = 327,
+ CTFRobotArm = 277,
+ CTFWrench = 329,
+ CTFProjectile_ThrowableBreadMonster = 269,
+ CTFProjectile_ThrowableBrick = 270,
+ CTFProjectile_ThrowableRepel = 271,
+ CTFProjectile_Throwable = 268,
+ CTFThrowable = 307,
+ CTFSyringeGun = 303,
+ CTFKatana = 219,
+ CTFSword = 302,
+ CSniperDot = 117,
+ CTFSniperRifleClassic = 296,
+ CTFSniperRifleDecap = 297,
+ CTFSniperRifle = 295,
+ CTFChargedSMG = 194,
+ CTFSMG = 294,
+ CTFShovel = 293,
+ CTFShotgunBuildingRescue = 292,
+ CTFPEPBrawlerBlaster = 235,
+ CTFSodaPopper = 298,
+ CTFShotgun_Revenge = 290,
+ CTFScatterGun = 286,
+ CTFShotgun_Pyro = 289,
+ CTFShotgun_HWG = 288,
+ CTFShotgun_Soldier = 291,
+ CTFShotgun = 287,
+ CTFCrossbow = 198,
+ CTFRocketLauncher_Mortar = 285,
+ CTFRocketLauncher_AirStrike = 283,
+ CTFRocketLauncher_DirectHit = 284,
+ CTFRocketLauncher = 282,
+ CTFRevolver = 276,
+ CTFDRGPomson = 199,
+ CTFRaygun = 274,
+ CTFPistol_ScoutSecondary = 240,
+ CTFPistol_ScoutPrimary = 239,
+ CTFPistol_Scout = 238,
+ CTFPistol = 237,
+ CTFPipebombLauncher = 236,
+ CTFWeaponPDA_Spy = 319,
+ CTFWeaponPDA_Engineer_Destroy = 318,
+ CTFWeaponPDA_Engineer_Build = 317,
+ CTFWeaponPDAExpansion_Teleporter = 321,
+ CTFWeaponPDAExpansion_Dispenser = 320,
+ CTFWeaponPDA = 316,
+ CTFParticleCannon = 233,
+ CTFParachute_Secondary = 232,
+ CTFParachute_Primary = 231,
+ CTFParachute = 230,
+ CTFMinigun = 228,
+ CTFMedigunShield = 225,
+ CWeaponMedigun = 337,
+ CTFMechanicalArm = 224,
+ CTFLunchBox_Drink = 223,
+ CTFLunchBox = 222,
+ CLaserDot = 78,
+ CTFLaserPointer = 221,
+ CTFKnife = 220,
+ CTFProjectile_Cleaver = 246,
+ CTFProjectile_JarMilk = 253,
+ CTFProjectile_Jar = 252,
+ CTFCleaver = 195,
+ CTFJarMilk = 218,
+ CTFJar = 217,
+ CTFWeaponInvis = 315,
+ CTFCannon = 193,
+ CTFGrenadeLauncher = 211,
+ CTFGrenadePipebombProjectile = 212,
+ CTFGrapplingHook = 210,
+ CTFFlareGun_Revenge = 206,
+ CTFFlareGun = 205,
+ CTFFlameRocket = 203,
+ CTFFlameThrower = 204,
+ CTFFists = 202,
+ CTFFireAxe = 201,
+ CTFCompoundBow = 197,
+ CTFClub = 196,
+ CTFBuffItem = 192,
+ CTFStickBomb = 300,
+ CTFBottle = 191,
+ CTFBonesaw = 189,
+ CTFBall_Ornament = 181,
+ CTFStunBall = 301,
+ CTFBat_Giftwrap = 187,
+ CTFBat_Wood = 188,
+ CTFBat_Fish = 186,
+ CTFBat = 185,
+ CTFProjectile_EnergyRing = 248,
+ CTFDroppedWeapon = 200,
+ CTFWeaponSapper = 322,
+ CTFWeaponBuilder = 314,
+ C_TFWeaponBuilder = 0,
+ CTFProjectile_Rocket = 254,
+ CTFProjectile_Flare = 249,
+ CTFProjectile_EnergyBall = 247,
+ CTFProjectile_GrapplingHook = 250,
+ CTFProjectile_HealingBolt = 251,
+ CTFProjectile_Arrow = 245,
+ CMannVsMachineStats = 80,
+ CTFTankBoss = 304,
+ CTFBaseBoss = 182,
+ CBossAlpha = 0,
+ NextBotCombatCharacter = 342,
+ CTFProjectile_SpellKartBats = 258,
+ CTFProjectile_SpellKartOrb = 259,
+ CTFHellZap = 215,
+ CTFProjectile_SpellLightningOrb = 260,
+ CTFProjectile_SpellTransposeTeleport = 267,
+ CTFProjectile_SpellMeteorShower = 261,
+ CTFProjectile_SpellSpawnBoss = 264,
+ CTFProjectile_SpellMirv = 262,
+ CTFProjectile_SpellPumpkin = 263,
+ CTFProjectile_SpellSpawnHorde = 265,
+ CTFProjectile_SpellSpawnZombie = 266,
+ CTFProjectile_SpellBats = 256,
+ CTFProjectile_SpellFireball = 257,
+ CTFSpellBook = 299,
+ CHightower_TeleportVortex = 74,
+ CTeleportVortex = 159,
+ CZombie = 339,
+ CMerasmusDancer = 83,
+ CMerasmus = 82,
+ CHeadlessHatman = 73,
+ CEyeballBoss = 48,
+ CTFBotHintEngineerNest = 190,
+ CBotNPCMinion = 0,
+ CBotNPC = 0,
+ CPasstimeGun = 94,
+ CTFViewModel = 308,
+ CRobotDispenser = 111,
+ CTFRobotDestruction_Robot = 278,
+ CTFReviveMarker = 275,
+ CTFPumpkinBomb = 272,
+ CTFBaseProjectile = 183,
+ CBaseObjectUpgrade = 11,
+ CTFRobotDestructionLogic = 281,
+ CTFRobotDestruction_RobotGroup = 279,
+ CTFRobotDestruction_RobotSpawn = 280,
+ CTFPlayerDestructionLogic = 242,
+ CPlayerDestructionDispenser = 101,
+ CTFMinigameLogic = 227,
+ CTFHalloweenMinigame_FallingPlatforms = 214,
+ CTFHalloweenMinigame = 213,
+ CTFMiniGame = 226,
+ CTFPowerupBottle = 244,
+ CTFItem = 216,
+ CHalloweenSoulPack = 71,
+ CTFGenericBomb = 208,
+ CBonusRoundLogic = 23,
+ CTFGameRulesProxy = 207,
+ CTETFParticleEffect = 178,
+ CTETFExplosion = 177,
+ CTETFBlood = 176,
+ CHalloweenGiftPickup = 69,
+ CBonusDuckPickup = 21,
+ CHalloweenPickup = 70,
+ CCaptureFlagReturnIcon = 27,
+ CCaptureFlag = 26,
+ CBonusPack = 22,
+ CTFTeam = 306,
+ CTFTauntProp = 305,
+ CTFPlayerResource = 243,
+ CTFPlayer = 241,
+ CTFRagdoll = 273,
+ CTEPlayerAnimEvent = 164,
+ CTFPasstimeLogic = 234,
+ CPasstimeBall = 93,
+ CTFObjectiveResource = 229,
+ CTFGlow = 209,
+ CTEFireBullets = 151,
+ CTFBuffBanner = 0,
+ CTFAmmoPack = 180,
+ CObjectTeleporter = 89,
+ CObjectSentrygun = 88,
+ CTFProjectile_SentryRocket = 255,
+ CObjectSapper = 87,
+ CObjectCartDispenser = 85,
+ CObjectDispenser = 86,
+ CMonsterResource = 84,
+ CFuncRespawnRoomVisualizer = 64,
+ CFuncRespawnRoom = 63,
+ CFuncPasstimeGoal = 61,
+ CFuncForceField = 57,
+ CCaptureZone = 28,
+ CCurrencyPack = 31,
+ CBaseObject = 10,
+ CTestTraceline = 175,
+ CTEWorldDecal = 179,
+ CTESpriteSpray = 173,
+ CTESprite = 172,
+ CTESparks = 171,
+ CTESmoke = 170,
+ CTEShowLine = 168,
+ CTEProjectedDecal = 166,
+ CTEPlayerDecal = 165,
+ CTEPhysicsProp = 163,
+ CTEParticleSystem = 162,
+ CTEMuzzleFlash = 161,
+ CTELargeFunnel = 158,
+ CTEKillPlayerAttachments = 157,
+ CTEImpact = 156,
+ CTEGlowSprite = 155,
+ CTEShatterSurface = 167,
+ CTEFootprintDecal = 153,
+ CTEFizz = 152,
+ CTEExplosion = 150,
+ CTEEnergySplash = 149,
+ CTEEffectDispatch = 148,
+ CTEDynamicLight = 147,
+ CTEDecal = 145,
+ CTEClientProjectile = 144,
+ CTEBubbleTrail = 143,
+ CTEBubbles = 142,
+ CTEBSPDecal = 141,
+ CTEBreakModel = 140,
+ CTEBloodStream = 139,
+ CTEBloodSprite = 138,
+ CTEBeamSpline = 137,
+ CTEBeamRingPoint = 136,
+ CTEBeamRing = 135,
+ CTEBeamPoints = 134,
+ CTEBeamLaser = 133,
+ CTEBeamFollow = 132,
+ CTEBeamEnts = 131,
+ CTEBeamEntPoint = 130,
+ CTEBaseBeam = 129,
+ CTEArmorRicochet = 128,
+ CTEMetalSparks = 160,
+ CSteamJet = 122,
+ CSmokeStack = 116,
+ DustTrail = 340,
+ CFireTrail = 50,
+ SporeTrail = 347,
+ SporeExplosion = 346,
+ RocketTrail = 344,
+ SmokeTrail = 345,
+ CPropVehicleDriveable = 107,
+ ParticleSmokeGrenade = 343,
+ CParticleFire = 90,
+ MovieExplosion = 341,
+ CTEGaussExplosion = 154,
+ CEnvQuadraticBeam = 43,
+ CEmbers = 36,
+ CEnvWind = 47,
+ CPrecipitation = 106,
+ CBaseTempEntity = 17,
+ CWeaponIFMSteadyCam = 336,
+ CWeaponIFMBaseCamera = 335,
+ CWeaponIFMBase = 334,
+ CTFWearableVM = 328,
+ CTFWearable = 323,
+ CTFWearableItem = 325,
+ CEconWearable = 35,
+ CBaseAttributableItem = 3,
+ CEconEntity = 34,
+ CHandleTest = 72,
+ CTeamplayRoundBasedRulesProxy = 125,
+ CTeamRoundTimer = 126,
+ CSpriteTrail = 121,
+ CSpriteOriented = 120,
+ CSprite = 119,
+ CRagdollPropAttached = 110,
+ CRagdollProp = 109,
+ CPoseController = 105,
+ CGameRulesProxy = 68,
+ CInfoLadderDismount = 75,
+ CFuncLadder = 58,
+ CEnvDetailController = 40,
+ CWorld = 338,
+ CWaterLODControl = 333,
+ CWaterBullet = 332,
+ CVoteController = 331,
+ CVGuiScreen = 330,
+ CPropJeep = 0,
+ CPropVehicleChoreoGeneric = 0,
+ CTest_ProxyToggle_Networkable = 174,
+ CTesla = 169,
+ CTeamTrainWatcher = 127,
+ CBaseTeamObjectiveResource = 16,
+ CTeam = 124,
+ CSun = 123,
+ CParticlePerformanceMonitor = 91,
+ CSpotlightEnd = 118,
+ CSlideshowDisplay = 115,
+ CShadowControl = 114,
+ CSceneEntity = 113,
+ CRopeKeyframe = 112,
+ CRagdollManager = 108,
+ CPhysicsPropMultiplayer = 98,
+ CPhysBoxMultiplayer = 96,
+ CBasePropDoor = 15,
+ CDynamicProp = 33,
+ CPointCommentaryNode = 104,
+ CPointCamera = 103,
+ CPlayerResource = 102,
+ CPlasma = 100,
+ CPhysMagnet = 99,
+ CPhysicsProp = 97,
+ CPhysBox = 95,
+ CParticleSystem = 92,
+ CMaterialModifyControl = 81,
+ CLightGlow = 79,
+ CInfoOverlayAccessor = 77,
+ CFuncTrackTrain = 67,
+ CFuncSmokeVolume = 66,
+ CFuncRotating = 65,
+ CFuncReflectiveGlass = 62,
+ CFuncOccluder = 60,
+ CFuncMonitor = 59,
+ CFunc_LOD = 54,
+ CTEDust = 146,
+ CFunc_Dust = 53,
+ CFuncConveyor = 56,
+ CBreakableSurface = 25,
+ CFuncAreaPortalWindow = 55,
+ CFish = 51,
+ CEntityFlame = 38,
+ CFireSmoke = 49,
+ CEnvTonemapController = 46,
+ CEnvScreenEffect = 44,
+ CEnvScreenOverlay = 45,
+ CEnvProjectedTexture = 42,
+ CEnvParticleScript = 41,
+ CFogController = 52,
+ CEntityParticleTrail = 39,
+ CEntityDissolve = 37,
+ CDynamicLight = 32,
+ CColorCorrectionVolume = 30,
+ CColorCorrection = 29,
+ CBreakableProp = 24,
+ CBasePlayer = 13,
+ CBaseFlex = 8,
+ CBaseEntity = 7,
+ CBaseDoor = 6,
+ CBaseCombatCharacter = 4,
+ CBaseAnimatingOverlay = 2,
+ CBoneFollower = 20,
+ CBaseAnimating = 1,
+ CInfoLightingRelative = 76,
+ CAI_BaseNPC = 0,
+ CBeam = 19,
+ CBaseViewModel = 18,
+ CBaseProjectile = 14,
+ CBaseParticleEntity = 12,
+ CBaseGrenade = 9,
+ CBaseCombatWeapon = 5
+};
+
enum tf_class {
tf_scout = 1,
tf_sniper,
diff --git a/uran/src/hack.cpp b/uran/src/hack.cpp
index 4d2dcecc..0d4e8bf7 100644
--- a/uran/src/hack.cpp
+++ b/uran/src/hack.cpp
@@ -18,6 +18,7 @@
#include "interfaces.h"
#include "sharedobj.h"
+#include "entitycache.h"
#include "sdk/in_buttons.h"
#include "logging.h"
#include "hooks.h"
@@ -26,7 +27,7 @@
#include "hacks/HBunnyhop.h"
#include "hacks/HTrigger.h"
#include "hacks/HEsp.h"
-#include "hacks/HGlow.h"
+//#include "hacks/HGlow.h"
#include "hacks/HPyroBot.h"
#include "hacks/HAimbot.h"
#include "hacks/AntiAim.h"
@@ -50,6 +51,7 @@
#include
#include
#include
+#include
#include
#include "copypasted/CSignature.h"
#include "copypasted/Netvar.h"
@@ -81,24 +83,35 @@ void hack::Hk_PaintTraverse(void* p, unsigned int vp, bool fr, bool ar) {
i_hack->PaintTraverse(p, vp, fr, ar);
}
}
+ Vector screen;
+ for (int i = 0; i < gEntityCache.m_nMax; i++) {
+ CachedEntity* ce = gEntityCache.GetEntity(i);
+ if (ce->m_bNULL) continue;
+ if (!draw::EntityCenterToScreen(ce->m_pEntity, screen)) continue;
+ for (int j = 0; j < ce->m_nESPStrings; j++) {
+ draw::DrawString(screen.x, screen.y, *(ce->m_Strings[j].m_Color), true, ce->m_Strings[j].m_String);
+ screen.z += 14;
+ }
+ }
}
bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
bool ret = ((CreateMove_t*)hooks::hkCreateMove->GetMethod(hooks::offCreateMove))(thisptr, inputSample, cmd);
+ gEntityCache.Update();
if (!cmd) return ret;
//logging::Info("Inside CreateMove");
g_pLocalPlayer->v_OrigViewangles = cmd->viewangles;
- g_pLocalPlayer->bUseSilentAngles = false;
+ //g_pLocalPlayer->bUseSilentAngles = false;
g_pLocalPlayer->Update();
//logging::Info("Inside CreateMove #1");
for (IHack* i_hack : hack::hacks) {
if (!i_hack->CreateMove(thisptr, inputSample, cmd)) {
ret = false;
- g_pLocalPlayer->bUseSilentAngles = true;
+ //g_pLocalPlayer->bUseSilentAngles = true;
}
}
//logging::Info("Inside CreateMove #2");
- if (g_pLocalPlayer->bUseSilentAngles) {
+ /*if (g_pLocalPlayer->bUseSilentAngles) {
Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
Vector ang;
@@ -106,15 +119,15 @@ bool hack::Hk_CreateMove(void* thisptr, float inputSample, CUserCmd* cmd) {
float yaw = deg2rad(ang.y - g_pLocalPlayer->v_OrigViewangles.y + cmd->viewangles.y);
cmd->forwardmove = cos(yaw) * speed;
cmd->sidemove = sin(yaw) * speed;
- }
+ }*/
//logging::Info("Inside CreateMove #3");
//logging::Info("viewangles: %f, %f, %f", cmd->viewangles.x, cmd->viewangles.y, cmd->viewangles.z);
- QAngle a;
- a.x = g_pLocalPlayer->v_OrigViewangles.x;
- a.y = g_pLocalPlayer->v_OrigViewangles.y;
- a.z = g_pLocalPlayer->v_OrigViewangles.z;
- interfaces::engineClient->SetViewAngles(a);
- g_pLocalPlayer->bAttackLastTick = (cmd->buttons & (IN_ATTACK | IN_ATTACK2 | IN_USE));
+ //QAngle a;
+ //a.x = g_pLocalPlayer->v_OrigViewangles.x;
+ //a.y = g_pLocalPlayer->v_OrigViewangles.y;
+ //a.z = g_pLocalPlayer->v_OrigViewangles.z;
+ //interfaces::engineClient->SetViewAngles(a);
+ //g_pLocalPlayer->bAttackLastTick = (cmd->buttons & (IN_ATTACK | IN_ATTACK2 | IN_USE));
//logging::Info("Inside CreateMove #4");
return ret;
}
diff --git a/uran/src/hacks/HAimbot.cpp b/uran/src/hacks/HAimbot.cpp
index b512f4e1..1b378248 100644
--- a/uran/src/hacks/HAimbot.cpp
+++ b/uran/src/hacks/HAimbot.cpp
@@ -15,6 +15,8 @@
#include "../targethelper.h"
#include "../localplayer.h"
+//typedef int CBaseEntity;
+
#include "../fixsdk.h"
#include
#include
@@ -180,6 +182,23 @@ bool HAimbot::Aim(IClientEntity* entity, CUserCmd* cmd) {
}
cmd->buttons |= IN_ATTACK;
}
+ if (this->v_bSilent->GetBool()) {
+ //FixMovement(*cmd, viewangles_old);
+ Vector vsilent(cmd->forwardmove, cmd->sidemove, cmd->upmove);
+ float speed = sqrt(vsilent.x * vsilent.x + vsilent.y * vsilent.y);
+ Vector ang;
+ VectorAngles(vsilent, ang);
+ float yaw = deg2rad(ang.y - g_pLocalPlayer->v_OrigViewangles.y + cmd->viewangles.y);
+ cmd->forwardmove = cos(yaw) * speed;
+ cmd->sidemove = sin(yaw) * speed;
+ }
+ if (!this->v_bSilent->GetBool()) {
+ QAngle a;
+ a.x = angles.x;
+ a.y = angles.y;
+ a.z = angles.z;
+ interfaces::engineClient->SetViewAngles(a);
+ }
//if (this->v_bSilent->GetBool()) {
//FixMovement(*cmd, viewangles_old);
//g_pLocalPlayer->bUseSilentAngles = true;
diff --git a/uran/src/hacks/HEsp.cpp b/uran/src/hacks/HEsp.cpp
index b2c8a695..5f8b8bfb 100644
--- a/uran/src/hacks/HEsp.cpp
+++ b/uran/src/hacks/HEsp.cpp
@@ -13,6 +13,7 @@
#include "../enums.h"
#include "../helpers.h"
#include "../entity.h"
+#include "../entitycache.h"
#include "../targethelper.h"
#include
#include
@@ -34,15 +35,7 @@ const char* classes[] = {
"Engineer"
};
-void HEsp::PaintTraverse(void*, unsigned int, bool, bool) {
- for (int i = 0; i < interfaces::entityList->GetHighestEntityIndex(); i++) {
- IClientEntity* ent = interfaces::entityList->GetClientEntity(i);
- if (ent != 0 && i != interfaces::engineClient->GetLocalPlayer()) {
- //if (ent->GetClientClass()->m_ClassID == 241)
- this->ProcessEntity(ent, i);
- }
- }
-}
+void HEsp::PaintTraverse(void*, unsigned int, bool, bool) {}
void HEsp::Create() {
this->v_bEnabled = CreateConVar("u_esp_enabled", "1", "Enables ESP");
@@ -52,18 +45,52 @@ void HEsp::Create() {
this->v_bTeammatePowerup = CreateConVar("u_esp_powerup_team", "1", "Show powerups on teammates if u_esp_teammates is 0");
this->v_bShowTargetScore = CreateConVar("u_esp_threat", "1", "Shows target score aka threat value");
this->v_bShowEntityID = CreateConVar("u_esp_entity_id", "0", "Shows EID");
- //this->v_bModelInfo = CreateConVar("u_esp_model", "0", "ESP model info");
- /*this->v_bEnabled = new ConVar("u_esp_enabled", "1");
- this->v_bShowPacks = new ConVar("u_esp_showpacks", "1");
- interfaces::cvar->RegisterConCommand(v_bEnabled);
- interfaces::cvar->RegisterConCommand(v_bShowPacks);*/
}
#define ESP_HEIGHT 14
-void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
+void HEsp::ProcessEntity(CachedEntity* ent) {
if (!this->v_bEnabled->GetBool()) return;
- if (!ent) return;
+ if (ent->m_bNULL) return;
+ if (ent->m_bDormant) return;
+
+ switch (ent->m_iClassID) {
+ case ClassID::CBaseAnimating: {
+ if (!this->v_bItemESP->GetBool()) break;
+ item_type type = GetItemType(ent->m_pEntity);
+ if (type == item_type::item_null) break;
+ if (type >= item_medkit_small && type <= item_medkit_large) {
+ ent->AddESPString(draw::white, cstr("%s HEALTH", packs[type - item_medkit_small]));
+ } else if (type >= item_ammo_small && type <= item_ammo_large) {
+ ent->AddESPString(draw::white, cstr("%s AMMO", packs[type - item_ammo_small]));
+ } else if (type >= item_mp_strength && type <= item_mp_crit) {
+ int skin = ent->m_pEntity->GetSkin();
+ Color pickupColor;
+ if (skin == 1) {
+ pickupColor = draw::red;
+ } else if (skin == 2) {
+ pickupColor = draw::blue;
+ } else {
+ pickupColor = draw::yellow;
+ }
+ ent->AddESPString(pickupColor, cstr("%s PICKUP", powerups[type - item_mp_strength]));
+ }
+ break;
+ }
+ case ClassID::CTFPlayer: {
+
+ break;
+ }
+ case ClassID::CObjectSentrygun:
+ case ClassID::CObjectDispenser:
+ case ClassID::CObjectTeleporter: {
+ break;
+ }
+
+ }
+
+
+ /*if (!ent) return;
if (ent->IsDormant()) return;
int local = interfaces::engineClient->GetLocalPlayer();
IClientEntity* me = interfaces::entityList->GetClientEntity(local);
@@ -82,34 +109,10 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
int ClassID = ent->GetClientClass()->m_ClassID;
scr.y -= 32;
if (v_bShowEntityID->GetBool()) {
- draw::DrawString(scr.x, scr.y, draw::white, true, "IDX %i CLASS %i", idx, ent->GetClientClass()->m_ClassID);
- scr.y += ESP_HEIGHT;
+ //draw::DrawString(scr.x, scr.y, draw::white, true, "IDX %i CLASS %i", idx, ent->GetClientClass()->m_ClassID);
+ //scr.y += ESP_HEIGHT;
}
switch (ClassID) {
- case 1: {
- if (!this->v_bItemESP->GetBool()) break;
- item_type type = GetItemType(ent);
- if (type == item_type::item_null) break;
- if (type >= item_medkit_small && type <= item_medkit_large) {
- draw::DrawString(scr.x, scr.y, draw::white, true, "%s HEALTH", packs[type - item_medkit_small]);
- scr.y += ESP_HEIGHT;
- } else if (type >= item_ammo_small && type <= item_ammo_large) {
- draw::DrawString(scr.x, scr.y, draw::white, true, "%s AMMO", packs[type - item_ammo_small]);
- scr.y += ESP_HEIGHT;
- } else if (type >= item_mp_strength && type <= item_mp_crit) {
- int skin = ent->GetSkin();
- Color pickupColor;
- if (skin == 1) {
- pickupColor = draw::red;
- } else if (skin == 2) {
- pickupColor = draw::blue;
- } else {
- pickupColor = draw::yellow;
- }
- draw::DrawString(scr.x, scr.y, pickupColor, true, "%s PICKUP", powerups[type - item_mp_strength]);
- scr.y += ESP_HEIGHT;
- }
- } break;
case 241: {
int team = GetEntityValue(ent, eoffsets.iTeamNum);
int health = GetEntityValue(ent, eoffsets.iHealth);
@@ -121,8 +124,8 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
if (!interfaces::engineClient->GetPlayerInfo(idx, &info)) return;
powerup_type power = GetPowerupOnPlayer(ent);
bool teammate = (team == my_team);
- /* If target is enemy, always show powerups, if player is teammate, show powerups
- * only if bTeammatePowerup or bTeammates is true */
+ // If target is enemy, always show powerups, if player is teammate, show powerups
+ // only if bTeammatePowerup or bTeammates is true
if (power >= 0 && (!teammate || this->v_bTeammatePowerup->GetBool() || this->v_bTeammates->GetBool())) {
Color clr = (team == 3 ? draw::blue : (team == 2 ? draw::red : draw::white));
draw::DrawString(scr.x, scr.y, clr, true, "HAS [%s]", powerups[power]);
@@ -153,7 +156,7 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
} break;
case 89:
case 88:
- case 86: { /* Engi Buildings */
+ case 86: { // builds
int team = GetEntityValue(ent, eoffsets.iTeamNum);
if (team == my_team && !this->v_bTeammates->GetBool()) return;
int health = GetEntityValue(ent, eoffsets.iBuildingHealth);
@@ -165,7 +168,7 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
draw::DrawString(scr.x, scr.y, clr, true, "%iu", (int)distance);
scr.y += ESP_HEIGHT;
} break;
- case 212: { /* Pipes and Stickies */
+ case 212: { // pipes
int team = GetEntityValue(ent, eoffsets.iTeamNum);
if (team == my_team && !this->v_bTeammates->GetBool()) return;
int type = GetEntityValue(ent, eoffsets.iPipeType);
@@ -181,10 +184,16 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
scr.y += ESP_HEIGHT;
draw::DrawString(scr.x, scr.y, draw::white, true, "%s %iu", GetModelPath(ent), (int)distance);
scr.y += ESP_HEIGHT;
- }
+ }*/
}
-bool HEsp::CreateMove(void*, float, CUserCmd*) { return true; };
+bool HEsp::CreateMove(void*, float, CUserCmd*) {
+ for (int i = 0; i < gEntityCache.m_nMax; i++) {
+ ProcessEntity(gEntityCache.GetEntity(i));
+ }
+ return true;
+};
+
void HEsp::Destroy() {};
diff --git a/uran/src/hacks/HEsp.h b/uran/src/hacks/HEsp.h
index e46665e9..d4bf337b 100644
--- a/uran/src/hacks/HEsp.h
+++ b/uran/src/hacks/HEsp.h
@@ -10,8 +10,8 @@
#include "IHack.h"
-class IClientEntity;
class ConVar;
+class CachedEntity;
class HEsp : public IHack {
public:
@@ -19,7 +19,7 @@ public:
void PaintTraverse(void*, unsigned int, bool, bool);
void Create();
void Destroy();
- void ProcessEntity(IClientEntity* ent, int idx);
+ void ProcessEntity(CachedEntity* ent);
ConVar* v_bEnabled;
ConVar* v_bBoxESP;
ConVar* v_bEntityESP;
diff --git a/uran/src/hacks/HGlow.cpp b/uran/src/hacks/HGlow.cpp
deleted file mode 100644
index e9abc2bf..00000000
--- a/uran/src/hacks/HGlow.cpp
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * HGlow.cpp
- *
- * Created on: Oct 22, 2016
- * Author: nullifiedcat
- */
-
-#include "HGlow.h"
-
-#include "../copypasted/CSignature.h"
-#include "../logging.h"
-#include "../entity.h"
-#include "../helpers.h"
-#include "../interfaces.h"
-#include "../localplayer.h"
-
-#include "../fixsdk.h"
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-// -------------------------------------------------------------------------------------------------- //
-template< class T >
-class CHandle : public CBaseHandle
-{
-public:
-
- CHandle();
- CHandle( int iEntry, int iSerialNumber );
- CHandle( const CBaseHandle &handle );
- CHandle( T *pVal );
-
- // The index should have come from a call to ToInt(). If it hasn't, you're in trouble.
- static CHandle FromIndex( int index );
-
- T* Get() const;
- void Set( const T* pVal );
-
- operator T*();
- operator T*() const;
-
- bool operator !() const;
- bool operator==( T *val ) const;
- bool operator!=( T *val ) const;
- const CBaseHandle& operator=( const T *val );
-
- T* operator->() const;
-};
-
-struct GlowObjectDefinition_t
-{
- CHandle m_hEntity;
- Vector m_vGlowColor;
- float m_flGlowAlpha;
-
- bool m_bRenderWhenOccluded;
- bool m_bRenderWhenUnoccluded;
- int m_nSplitScreenSlot;
-
- // Linked list of free slots
- int m_nNextFreeSlot;
-};
-
-struct CGlowManager
-{
- CUtlVector m_GlowObjectDefinitions;
- int RegisterGlowObject(CBaseEntity *pEntity, const Vector &vGlowColor, float flGlowAlpha, bool bRenderWhenOccluded, bool bRenderWhenUnoccluded, int nSplitScreenSlot);
-};
-
-
-template
-T GetFunction(void* obj, unsigned idx) {
- const void** vtbl = *reinterpret_cast((size_t*)obj);
- return reinterpret_cast(vtbl[idx]);
-}
-
-void UpdateGlowEffect(IClientEntity* entity);
-void DestroyGlowEffect(IClientEntity* entity);
-
-//void GetHealthColor(IClientEntity* entity, Color)
-
-void ToggleEntityGlow(IClientEntity* entity, bool glow) {
- if (!entity) return;
- if (GetEntityValue(entity, eoffsets.bGlowEnabled) == glow) return;
- SetEntityValue(entity, eoffsets.bGlowEnabled, (int)glow);
- if (glow) UpdateGlowEffect(entity);
- else DestroyGlowEffect(entity);
-}
-
-void UpdateGlowEffect(IClientEntity* entity) {
- typedef void (*UpdateGlowEffect_t)(IClientEntity* entity);
- GetFunction(entity, 0x35c / 4);
-}
-
-void DestroyGlowEffect(IClientEntity* entity) {
- typedef void (*DestroyGlowEffect_t)(IClientEntity* entity);
- GetFunction(entity, 0x360 / 4);
-}
-
-void SetEntityGlowColor(IClientEntity* entity, Color& color) {
- if (!GetEntityValue(entity, eoffsets.bGlowEnabled)) return;
-
-}
-
-CGlowManager* g_pGlowManager = 0;
-
-void CC_GlowSigSearch(const CCommand& args) {
- logging::Info("Searching for %s", args.ArgS());
- g_pGlowManager = *(CGlowManager**)(gSignatures.GetClientSignature((char*)args.ArgS()) + 8);
- if (g_pGlowManager == 0) {
- logging::Info("GlowManager sigsearch failed");
- }
- logging::Info("GlowManager: 0x%08f", g_pGlowManager);
-}
-
-void HGlow::Create() {
- cmd_scan = CreateConCommand("u_glow_scan", CC_GlowSigSearch, "Re-scans the memory for glow ptr");
- v_bEnabled = CreateConVar("u_glow_enabled", "0", "Glow enabled. Experimental.");
- v_bEnemyOnly = CreateConVar("u_glow_enemy", "1", "Only enemies will glow");
- g_pGlowManager = *(CGlowManager**)(gSignatures.GetClientSignature("A1 ? ? ? ? C7 04 24 ? ? ? ? 89 44 24 04 E8 ? ? ? ? 8B 35 ? ? ? ? 89 C7 C1 E0 05 89 45 CC 01 C6 E9") + 8);
- if (g_pGlowManager == 0) {
- logging::Info("GlowManager sigsearch failed");
- }
- logging::Info("GlowManager: 0x%08f", g_pGlowManager);
-}
-
-bool HGlow::CreateMove(void*, float, CUserCmd*) {
- if (!g_pGlowManager) return true;
- if (!v_bEnabled->GetBool()) return true;
- for (int i = 0; i < interfaces::entityList->GetHighestEntityIndex(); i++) {
- IClientEntity* entity = interfaces::entityList->GetClientEntity(i);
- if (i == interfaces::engineClient->GetLocalPlayer()) continue;
- if (!entity) continue;
- if (entity->GetClientClass()->m_ClassID != 241) continue;
- if (entity->IsDormant()) {
- ToggleEntityGlow(entity, false);
- continue;
- }
- if (GetEntityValue(entity, eoffsets.iLifeState)) {
- ToggleEntityGlow(entity, false);
- continue;
- }
- if (v_bEnemyOnly->GetBool()) {
- if (GetEntityValue(entity, eoffsets.iTeamNum) == g_pLocalPlayer->team) continue;
- }
- ToggleEntityGlow(entity, true);
- }
- return true;
-}
-
-void HGlow::Destroy() {
-
-}
-
-void HGlow::PaintTraverse(void*, unsigned int, bool, bool) {
-
-}
diff --git a/uran/src/hacks/HGlow.h b/uran/src/hacks/HGlow.h
deleted file mode 100644
index b6664288..00000000
--- a/uran/src/hacks/HGlow.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * HGlow.h
- *
- * Created on: Oct 22, 2016
- * Author: nullifiedcat
- */
-
-#ifndef HGLOW_H_
-#define HGLOW_H_
-
-#include "IHack.h"
-
-#include "../fixsdk.h"
-#include "basehandle.h"
-
-class ConVar;
-class ConCommand;
-
-class HGlow : public IHack {
-public:
- void Create();
- bool CreateMove(void*, float, CUserCmd*);
- void Destroy();
- void PaintTraverse(void*, unsigned int, bool, bool);
- ConVar* v_bEnabled;
- ConVar* v_bEnemyOnly;
- ConVar* v_bHealthColor;
- ConCommand* cmd_scan;
-};
-
-
-#endif /* HGLOW_H_ */
diff --git a/uran/src/helpers.cpp b/uran/src/helpers.cpp
index 42e6d0cc..644aee73 100644
--- a/uran/src/helpers.cpp
+++ b/uran/src/helpers.cpp
@@ -404,6 +404,15 @@ bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float
return true;
}
+char* cstr(const char* fmt, ...) {
+ char buffer[1024];
+ va_list list;
+ va_start(list, fmt);
+ vsprintf(buffer, fmt, list);
+ va_end(list);
+ return buffer;
+}
+
const char* powerups[] = {
"STRENGTH",
"RESISTANCE",
diff --git a/uran/src/helpers.h b/uran/src/helpers.h
index 1715a9d8..1887befc 100644
--- a/uran/src/helpers.h
+++ b/uran/src/helpers.h
@@ -43,6 +43,7 @@ void fVectorAngles(Vector &forward, Vector &angles);
float deg2rad(float deg);
bool GetProjectileData(IClientEntity* weapon, float& speed, bool& arc);
bool PredictProjectileAim(Vector origin, IClientEntity* target, hitbox hb, float speed, bool arc, Vector& result);
+char* cstr(const char* fmt, ...);
extern const char* powerups[POWERUP_COUNT];
extern const char* packs[PACK_COUNT];