This commit is contained in:
nullifiedcat 2016-10-20 21:56:53 +03:00
parent 6f40a6dd55
commit 49a2aec0a3
10 changed files with 134 additions and 20 deletions

3
uran/.gitignore vendored
View File

@ -2,4 +2,5 @@
/Debug/src_/
/Debug/makefile
/Debug/objects.mk
/Debug/sources.mk
/Debug/sources.mk
/Debug/

Binary file not shown.

View File

@ -4,5 +4,25 @@
ESP: Box, bones
ESP: Uber n stuff
TRIGGER: Amby
TRIGGER: Ignore uber; vacc; etc.
AIMBOT
TRIGGER: Ignore VACC
Priority FIX
OPTIMIZE
Buildings aimbot
priority system
proper player struct
optimize
buildings aim
no autoshoot consumable
no autoshoot disg
amby body
Entity::AddEntityString
Glow Objects
actual ammo box esp
no trigger/aim vacc uber
LINES

View File

@ -1,5 +1,5 @@
/*
* entity.cpp
a * entity.cpp
*
* Created on: Oct 6, 2016
* Author: nullifiedcat

View File

@ -14,6 +14,8 @@ class IClientEntity;
template<typename T>
inline T GetEntityValue(IClientEntity* ent, unsigned int offset) {
int null = 0;
if (ent == 0) return *(reinterpret_cast<T*>(&null));
//logging::Info("GetEntityValue 0x%08x, 0x%08x", ent, offset);
return *(reinterpret_cast<T*>((unsigned int)ent + offset));
}

View File

@ -100,6 +100,7 @@ enum powerup_type {
king,
plague,
supernova,
crits,
POWERUP_COUNT
};
@ -109,6 +110,32 @@ enum powerup_owner {
blue = 2
};
enum item_type {
item_null = -1,
item_medkit_small,
item_medkit_medium,
item_medkit_large,
item_ammo_small,
item_ammo_medium,
item_ammo_large,
item_mp_strength,
item_mp_resistance,
item_mp_vampire,
item_mp_reflect,
item_mp_haste,
item_mp_regeneration,
item_mp_precision,
item_mp_agility,
item_mp_knockout,
item_mp_king,
item_mp_plague,
item_mp_supernova,
item_mp_crit,
item_mp_uber, /* this exists for some reason */
item_mp_warlock, /* never seen that powerup, but the model exists */
item_mp_thorns /* and this one */
};
enum pack_type {
not_pack = -1,
small,

View File

@ -147,6 +147,8 @@ bool HAimbot::ShouldTarget(IClientEntity* entity) {
if (v_iMinRange->GetInt() > 0) {
if ((enemy_pos - my_pos).Length() > v_iMinRange->GetInt()) return false;
}
int econd = GetEntityValue<int>(entity, entityvars.iCond1);
if ((econd & cond_ex::vacc_bullet)) return false;
return this->IsVisible(entity);
}

View File

@ -81,21 +81,25 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
switch (ClassID) {
case 1: {
if (!this->v_bItemESP->GetBool()) break;
powerup_type type = GetPowerupType(ent);
if (type >= 0) {
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 += 16;
} 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 += 16;
} else if (type >= item_mp_strength && type <= item_mp_crit) {
int skin = ent->GetSkin();
Color clr = (skin == 0 ? draw::yellow : (skin == 1 ? draw::red : draw::blue));
draw::DrawString(scr.x, scr.y, clr, true, "POWERUP %s", powerups[type]);
scr.y += 16;
}
pack_type health = GetHealthPackType(ent);
if (health >= 0) {
draw::DrawString(scr.x, scr.y, draw::white, true, "%s HEALTH", packs[health]);
scr.y += 16;
}
pack_type ammo = GetAmmoPackType(ent);
if (ammo >= 0) {
draw::DrawString(scr.x, scr.y, draw::white, true, "%s AMMO", packs[ammo]);
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 += 16;
}
} break;
@ -114,7 +118,7 @@ void HEsp::ProcessEntity(IClientEntity* ent, int idx) {
* 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, "%s", powerups[power]);
draw::DrawString(scr.x, scr.y, clr, true, "HAS [%s]", powerups[power]);
scr.y += 16;
}
if (teammate && !this->v_bTeammates->GetBool()) return;

View File

@ -56,6 +56,62 @@ const char* GetModelPath(IClientEntity* entity) {
return interfaces::model->GetModelName(model);
}
/* Takes CBaseAnimating entity as input */
item_type GetItemType(IClientEntity* entity) {
if (entity == 0) return item_type::item_null;
const char* path = GetModelPath(entity); /* SDK function */
size_t length = strlen(path);
/* Default/Festive medkits */
if (length >= 29 && path[16] == 'k') {
if (path[20] == 's') return item_type::item_medkit_small;
if (path[20] == 'm') return item_type::item_medkit_medium;
if (path[20] == 'l') return item_type::item_medkit_large;
}
/* Sandwich/Steak */
if (length >= 22 && path[13] == 'p' && path[14] == 'l') {
return item_type::item_medkit_medium;
}
/* Medieval meat */
if (length == 39 && path[31] == 'm' && path[29] == 'l') {
return item_type::item_medkit_medium;
}
/* Halloween medkits */
if (length >= 49 && path[33] == 'm' && path[36] == 'k') {
if (path[20] == 's') return item_type::item_medkit_small;
if (path[40] == 'm') return item_type::item_medkit_medium;
if (path[40] == 'l') return item_type::item_medkit_large;
}
/* Ammo packs */
if (length >= 31 && path[14] == 'm' && path[15] == 'm') {
if (path[22] == 's') return item_type::item_ammo_small;
if (path[22] == 'm') return item_type::item_ammo_medium;
if (path[22] == 'l') return item_type::item_ammo_large;
}
/* Powerups */
if (length >= 38 && path[20] == 'p' && path[24] == 'w') {
if (path[30] == 'h') return item_type::item_mp_haste;
if (path[30] == 'v') return item_type::item_mp_vampire;
if (path[30] == 'u') return item_type::item_mp_uber;
if (path[32] == 'e') return item_type::item_mp_precision;
if (path[30] == 'w') return item_type::item_mp_warlock;
if (path[32] == 'r') return item_type::item_mp_strength;
if (path[32] == 'g') return item_type::item_mp_regeneration;
if (path[37] == 'v') return item_type::item_mp_supernova;
/* looks like resistance.mdl is unused and replaced with defense.mdl? idk */
if (path[37] == 'n') return item_type::item_mp_resistance;
if (path[34] == 'k') return item_type::item_mp_knockout;
/* actually this one is 'defense' but it's used for resistance powerup */
if (path[35] == 's') return item_type::item_mp_resistance;
if (path[30] == 'c') return item_type::item_mp_crit;
if (path[30] == 'a') return item_type::item_mp_agility;
if (path[31] == 'i') return item_type::item_mp_king;
if (path[33] == 'g') return item_type::item_mp_plague;
if (path[36] == 't') return item_type::item_mp_reflect;
if (path[30] == 't') return item_type::item_mp_thorns;
}
return item_type::item_null;
}
pack_type GetHealthPackType(IClientEntity* ent) {
if (!ent) return pack_type::not_pack;
const char* name = GetModelPath(ent);
@ -172,7 +228,8 @@ const char* powerups[] = {
"KNOCKOUT",
"KING",
"PLAGUE",
"SUPERNOVA"
"SUPERNOVA",
"CRITS"
};
const char* packs[] = {

View File

@ -28,6 +28,7 @@ pack_type GetHealthPackType(IClientEntity* ent);
pack_type GetAmmoPackType(IClientEntity* ent);
powerup_type GetPowerupType(IClientEntity* ent);
powerup_type GetPowerupOnPlayer(IClientEntity* player);
item_type GetItemType(IClientEntity* entity);
const char* GetModelPath(IClientEntity* entity);
int GetHitboxPosition(IClientEntity* entity, int hb, Vector& out);