Merge remote-tracking branch 'origin/master' into glow_dme
This commit is contained in:
commit
82b26041da
@ -13,6 +13,8 @@
|
||||
|
||||
std::unordered_map<int, int> command_number_mod {};
|
||||
|
||||
int* g_PredictionRandomSeed = nullptr;
|
||||
|
||||
bool AllowAttacking() {
|
||||
if (!(hacks::shared::misc::crit_hack || ((GetWeaponMode(LOCAL_E) == weapon_melee) && hacks::shared::misc::crit_melee))) return true;
|
||||
bool crit = IsAttackACrit(g_pUserCmd);
|
||||
@ -55,6 +57,10 @@ bool IsAttackACrit(CUserCmd* cmd) {
|
||||
return *(bool*)((uintptr_t)RAW_ENT(LOCAL_W) + 2454ul);
|
||||
}
|
||||
} else if (TF2) {
|
||||
if (!g_PredictionRandomSeed) {
|
||||
uintptr_t sig = gSignatures.GetClientSignature("89 1C 24 D9 5D D4 FF 90 3C 01 00 00 89 C7 8B 06 89 34 24 C1 E7 08 FF 90 3C 01 00 00 09 C7 33 3D ? ? ? ? 39 BB 34 0B 00 00 74 0E 89 BB 34 0B 00 00 89 3C 24 E8 ? ? ? ?");
|
||||
g_PredictionRandomSeed = *reinterpret_cast<int**>(sig + (uintptr_t)32);
|
||||
}
|
||||
if (vfunc<bool(*)(IClientEntity*)>(weapon, 1944 / 4, 0)(weapon)) {
|
||||
static uintptr_t CalcIsAttackCritical_s = gSignatures.GetClientSignature("55 89 E5 83 EC 28 89 5D F4 8B 5D 08 89 75 F8 89 7D FC 89 1C 24 E8 ? ? ? ? 85 C0 89 C6 74 60 8B 00 89 34 24 FF 90 E0 02 00 00 84 C0 74 51 A1 ? ? ? ? 8B 40 04");
|
||||
typedef void(*CalcIsAttackCritical_t)(IClientEntity*);
|
||||
@ -66,8 +72,7 @@ bool IsAttackACrit(CUserCmd* cmd) {
|
||||
int md5seed = MD5_PseudoRandom(cmd->command_number) & 0x7fffffff;
|
||||
int rseed = md5seed;
|
||||
float bucket = *(float*)((uintptr_t)RAW_ENT(LOCAL_W) + 2612u);
|
||||
int& a = *(int*)((uintptr_t)(sharedobj::client->lmap->l_addr) + 0x01F8B228);
|
||||
a = md5seed;
|
||||
*g_PredictionRandomSeed = md5seed;
|
||||
int c = LOCAL_W->m_IDX << 8;
|
||||
int b = LOCAL_E->m_IDX;
|
||||
rseed = rseed ^ (b | c);
|
||||
|
@ -20,6 +20,7 @@ bool IsAttackACrit(CUserCmd* cmd);
|
||||
#include <unordered_map>
|
||||
#include "aftercheaders.h"
|
||||
|
||||
extern int* g_PredictionRandomSeed;
|
||||
extern std::unordered_map<int, int> command_number_mod;
|
||||
|
||||
//bool CalcIsAttackCritical(IClientEntity* weapon);
|
||||
|
@ -47,7 +47,6 @@ void CachedEntity::Update(int idx) {
|
||||
}
|
||||
#endif
|
||||
m_iClassID = RAW_ENT(this)->GetClientClass()->m_ClassID;
|
||||
|
||||
Vector origin = RAW_ENT(this)->GetAbsOrigin();
|
||||
//if (TF2 && EstimateAbsVelocity) EstimateAbsVelocity(m_pEntity, m_vecVelocity);
|
||||
/*if ((gvars->realtime - m_fLastUpdate) >= 0.05f) {
|
||||
|
@ -6,5 +6,121 @@
|
||||
*/
|
||||
|
||||
#include "glowobjects.h"
|
||||
#include "common.h"
|
||||
|
||||
static CatEnum glow_color_scheme_enum({"ESP", "HEALTH"});
|
||||
static CatVar glow_color_scheme(glow_color_scheme_enum, "glow_color_scheme", "1", "Colors", "Doesn't need a description");
|
||||
// Doesn't work - has to be registered manually.
|
||||
static CatVar glow_ammo_boxes(CV_SWITCH, "glow_ammo_boxes", "0", "Ammo");
|
||||
static CatVar glow_health_packs(CV_SWITCH, "glow_health_packs", "0", "Health");
|
||||
static CatVar glow_teammates(CV_SWITCH, "glow_teammates", "0", "Teammates");
|
||||
static CatVar glow_teammate_buildings(CV_SWITCH, "glow_teammate_buildings", "0", "Teammate buildings");
|
||||
static CatVar glow_buildings(CV_SWITCH, "glow_buildings", "1", "Buildings");
|
||||
static CatVar glow_stickies(CV_SWITCH, "glow_stickies", "0", "Stickies");
|
||||
|
||||
int CGlowObjectManager::EnableGlow(IClientEntity* entity, int color) {
|
||||
int idx = GlowHandle(entity);
|
||||
if (idx != -1) {
|
||||
logging::Info("[WARNING] Glow handle exists!!!");
|
||||
return idx;
|
||||
}
|
||||
if (m_nFirstFreeSlot == END_OF_FREE_LIST) {
|
||||
idx = m_GlowObjectDefinitions.AddToTail();
|
||||
} else {
|
||||
idx = m_nFirstFreeSlot;
|
||||
m_nFirstFreeSlot = m_GlowObjectDefinitions[idx].m_nNextFreeSlot;
|
||||
}
|
||||
g_CathookManagedGlowObjects.insert(idx);
|
||||
GlowObjectDefinition_t& def = m_GlowObjectDefinitions[idx];
|
||||
def.m_bRenderWhenOccluded = true;
|
||||
def.m_bRenderWhenUnoccluded = true;
|
||||
def.m_flGlowAlpha = 1.0f;
|
||||
def.m_hEntity = CBaseHandle();
|
||||
def.m_hEntity.Set(entity);
|
||||
unsigned char _b = (color >> 16) & 0xFF;
|
||||
unsigned char _g = (color >> 8) & 0xFF;
|
||||
unsigned char _r = (color) & 0xFF;
|
||||
def.m_vGlowColor = Vector((float)_r / 255.0f, (float)_g / 255.0f, (float)_b / 255.0f);
|
||||
def.m_nNextFreeSlot = ENTRY_IN_USE;
|
||||
def.m_nSplitScreenSlot = -1;
|
||||
return idx;
|
||||
}
|
||||
|
||||
void CGlowObjectManager::DisableGlow(int idx) {
|
||||
const auto& it = g_CathookManagedGlowObjects.find(idx);
|
||||
if (it == g_CathookManagedGlowObjects.end()) {
|
||||
return;
|
||||
}
|
||||
g_CathookManagedGlowObjects.erase(it);
|
||||
m_GlowObjectDefinitions[idx].m_nNextFreeSlot = m_nFirstFreeSlot;
|
||||
m_GlowObjectDefinitions[idx].m_hEntity = NULL;
|
||||
m_nFirstFreeSlot = idx;
|
||||
}
|
||||
|
||||
int CGlowObjectManager::GlowHandle(IClientEntity* entity) const {
|
||||
for (int i = 0; i < m_GlowObjectDefinitions.Count(); i++) {
|
||||
if (m_GlowObjectDefinitions[i].m_nNextFreeSlot == ENTRY_IN_USE && (m_GlowObjectDefinitions[i].m_hEntity.m_Index & 0xFFF) == entity->entindex()) return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int GetEntityGlowColor(int idx) {
|
||||
if (idx < 0 || idx > g_IEntityList->GetHighestEntityIndex()) return colors::white;
|
||||
CachedEntity* ent = ENTITY(idx);
|
||||
if (CE_BAD(ent)) return colors::white;
|
||||
switch (ent->m_Type) {
|
||||
case ENTITY_BUILDING:
|
||||
case ENTITY_PLAYER:
|
||||
if ((int)glow_color_scheme == 1) {
|
||||
return colors::Health(ent->m_iHealth, ent->m_iMaxHealth);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return colors::EntityF(ent);
|
||||
}
|
||||
|
||||
bool CanEntityEvenGlow(int idx) {
|
||||
IClientEntity* entity = g_IEntityList->GetClientEntity(idx);
|
||||
if (!entity) return false;
|
||||
int classid = entity->GetClientClass()->m_ClassID;
|
||||
return (classid == g_pClassID->CTFAmmoPack || classid == g_pClassID->CTFPlayer || classid == g_pClassID->CTFGrenadePipebombProjectile || classid == g_pClassID->CObjectDispenser || classid == g_pClassID->CObjectSentrygun || classid == g_pClassID->CObjectTeleporter || classid == g_pClassID->CBaseAnimating);
|
||||
}
|
||||
|
||||
bool ShouldEntityGlow(int idx) {
|
||||
CachedEntity* ent = ENTITY(idx);
|
||||
if (CE_BAD(ent)) return false;
|
||||
switch (ent->m_Type) {
|
||||
case ENTITY_BUILDING:
|
||||
if (!glow_buildings) return false;
|
||||
if (!ent->m_bEnemy && !(glow_teammate_buildings || glow_teammates)) return false;
|
||||
return true;
|
||||
case ENTITY_PLAYER:
|
||||
if (!glow_teammates && !ent->m_bEnemy) return false;
|
||||
if (CE_BYTE(ent, netvar.iLifeState) != LIFE_ALIVE) return false;
|
||||
return true;
|
||||
break;
|
||||
case ENTITY_PROJECTILE:
|
||||
if (!ent->m_bEnemy) return false;
|
||||
if (glow_stickies && ent->m_iClassID == g_pClassID->CTFGrenadePipebombProjectile) {
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
case ENTITY_GENERIC:
|
||||
switch (ent->m_ItemType) {
|
||||
case ITEM_HEALTH_LARGE:
|
||||
case ITEM_HEALTH_MEDIUM:
|
||||
case ITEM_HEALTH_SMALL:
|
||||
return glow_health_packs;
|
||||
case ITEM_AMMO_LARGE:
|
||||
case ITEM_AMMO_MEDIUM:
|
||||
case ITEM_AMMO_SMALL:
|
||||
return glow_ammo_boxes;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::set<int> g_CathookManagedGlowObjects {};
|
||||
|
||||
CGlowObjectManager* g_GlowObjectManager = 0;
|
||||
|
@ -11,13 +11,12 @@
|
||||
#define END_OF_FREE_LIST -1
|
||||
#define ENTRY_IN_USE -2
|
||||
|
||||
#include "fixsdk.h"
|
||||
#include <tier1/utlvector.h>
|
||||
#include <mathlib/vector.h>
|
||||
#include <basehandle.h>
|
||||
#include "common.h"
|
||||
|
||||
//template<typename T> class CUtlVector;
|
||||
|
||||
extern std::set<int> g_CathookManagedGlowObjects;
|
||||
|
||||
struct GlowObjectDefinition_t {
|
||||
CBaseHandle m_hEntity;
|
||||
Vector m_vGlowColor;
|
||||
@ -30,10 +29,17 @@ struct GlowObjectDefinition_t {
|
||||
|
||||
class CGlowObjectManager {
|
||||
public:
|
||||
int EnableGlow(IClientEntity* entity, int color);
|
||||
void DisableGlow(int idx);
|
||||
int GlowHandle(IClientEntity* entity) const;
|
||||
CUtlVector<GlowObjectDefinition_t> m_GlowObjectDefinitions;
|
||||
int m_nFirstFreeSlot;
|
||||
};
|
||||
|
||||
extern CGlowObjectManager* g_GlowObjectManager;
|
||||
|
||||
bool CanEntityEvenGlow(int idx);
|
||||
int GetEntityGlowColor(int idx);
|
||||
bool ShouldEntityGlow(int idx);
|
||||
|
||||
#endif /* GLOWOBJECTS_H_ */
|
||||
|
@ -18,17 +18,20 @@
|
||||
void GUIVisibleCallback(IConVar* var, const char* pOldValue, float flOldValue) {
|
||||
g_IInputSystem->SetCursorPosition(draw::width / 2, draw::height / 2);
|
||||
g_ISurface->SetCursor(vgui::CursorCode::dc_none);
|
||||
g_IMatSystemSurface->SetCursorAlwaysVisible(false);
|
||||
g_ISurface->SetCursorAlwaysVisible(false);
|
||||
//g_IMatSystemSurface->SetCursorAlwaysVisible(false);
|
||||
if (gui_visible) {
|
||||
g_IMatSystemSurface->UnlockCursor();
|
||||
g_ISurface->UnlockCursor();
|
||||
//g_IMatSystemSurface->UnlockCursor();
|
||||
} else {
|
||||
g_IMatSystemSurface->LockCursor();
|
||||
g_ISurface->LockCursor();
|
||||
//g_IMatSystemSurface->LockCursor();
|
||||
}
|
||||
}
|
||||
|
||||
CatVar gui_visible(CV_SWITCH, "gui_visible", "0", "GUI Active", "GUI switch (bind it to a key!)");
|
||||
CatVar gui_draw_bounds(CV_SWITCH, "gui_bounds", "0", "Draw Bounds", "Draw GUI elements' bounding boxes");
|
||||
CatVar gui_nullcore(CV_SWITCH, "gui_nullcore", "0", "NullCore GUI", "Use NullCoreCheat GUI");
|
||||
CatVar gui_nullcore(CV_SWITCH, "gui_nullcore", "1", "NullCore GUI", "Use NullCoreCheat GUI");
|
||||
|
||||
CatGUI::CatGUI() {
|
||||
root_nullcore = nullptr;
|
||||
|
@ -153,6 +153,18 @@ List& MainList() {
|
||||
]
|
||||
]
|
||||
|
||||
"Glow" [
|
||||
"Glow Menu"
|
||||
"glow_enabled"
|
||||
"glow_color_scheme"
|
||||
"glow_health_packs"
|
||||
"glow_ammo_boxes"
|
||||
"glow_teammates"
|
||||
"glow_teammate_buildings"
|
||||
"glow_buildings"
|
||||
"glow_stickies"
|
||||
]
|
||||
|
||||
"ESP" [
|
||||
"ESP Menu"
|
||||
"esp_enabled"
|
||||
@ -161,12 +173,16 @@ List& MainList() {
|
||||
"esp_name"
|
||||
"esp_distance"
|
||||
"esp_box"
|
||||
"esp_box_text_position"
|
||||
"3D Box" [
|
||||
"3D Box Settings"
|
||||
"esp_3d_box"
|
||||
"esp_3d_box_thick"
|
||||
"esp_3d_box_health"
|
||||
"esp_3d_box_expand"
|
||||
"esp_3d_box_smoothing"
|
||||
"esp_3d_box_expand_size"
|
||||
"esp_3d_box_healthbar"
|
||||
]
|
||||
"esp_legit"
|
||||
"esp_health_num"
|
||||
@ -261,7 +277,6 @@ List& MainList() {
|
||||
"tauntslide"
|
||||
"anti_afk"
|
||||
"flashlight"
|
||||
"noisemaker"
|
||||
"minigun_jump"
|
||||
"no_zoom"
|
||||
"no_visuals"
|
||||
|
@ -120,11 +120,11 @@ void hack::Initialize() {
|
||||
Patch((void*)mmmf, (void*)patch1, 3);
|
||||
Patch((void*)(mmmf + 8), (void*)patch2, 3);
|
||||
}
|
||||
uintptr_t canInspectSig = (gSignatures.GetClientSignature("55 0F 57 C0 89 E5 83 EC 48 8B 45 08 F3 0F 11 04 24 F3 0F 11 45 E8 C7 44 24 10 01 00 00 00 C7 44 24 0C 00 00 00 00 89 44 24 08 C7 44 24 ? ? ? ? ? E8 ? ? ? ? F3 0F 10 45 E8 D9 5D E4 F3 0F 10 4D E4 C9 0F 2F C8 0F 95 C0 C3") + 72);
|
||||
/*uintptr_t canInspectSig = (gSignatures.GetClientSignature("55 0F 57 C0 89 E5 83 EC 48 8B 45 08 F3 0F 11 04 24 F3 0F 11 45 E8 C7 44 24 10 01 00 00 00 C7 44 24 0C 00 00 00 00 89 44 24 08 C7 44 24 ? ? ? ? ? E8 ? ? ? ? F3 0F 10 45 E8 D9 5D E4 F3 0F 10 4D E4 C9 0F 2F C8 0F 95 C0 C3") + 72);
|
||||
if (canInspectSig) {
|
||||
unsigned char patch[] = { 0xB0, 0x01, 0x90 };
|
||||
Patch((void*)canInspectSig, (void*)patch, 3);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
BeginConVars();
|
||||
hack::c_Cat = CreateConCommand(CON_NAME, &hack::CC_Cat, "Info");
|
||||
@ -182,6 +182,7 @@ void hack::Initialize() {
|
||||
hack::command_stack().push("cat_killsay_reload");
|
||||
hack::command_stack().push("cat_spam_reload");
|
||||
logging::Info("Hooked!");
|
||||
playerlist::Load();
|
||||
}
|
||||
|
||||
void hack::Think() {
|
||||
@ -191,6 +192,7 @@ void hack::Think() {
|
||||
void hack::Shutdown() {
|
||||
if (hack::shutdown) return;
|
||||
hack::shutdown = true;
|
||||
playerlist::Save();
|
||||
logging::Info("Killing hooks..");
|
||||
if (hooks::hkPanel) hooks::hkPanel->Kill();
|
||||
if (hooks::hkClientMode) hooks::hkClientMode->Kill();
|
||||
|
@ -103,9 +103,16 @@ void Draw() {
|
||||
}
|
||||
}
|
||||
|
||||
static CatEnum esp_box_text_position_enum({"TOP RIGHT", "BOTTOM RIGHT", "CENTER", "ABOVE", "BELOW" });
|
||||
static CatVar esp_box_text_position(esp_box_text_position_enum, "esp_box_text_position", "0", "Text position", "Defines text position");
|
||||
static CatVar esp_3d_box_health(CV_SWITCH, "esp_3d_box_health", "1", "3D box health color");
|
||||
static CatVar esp_3d_box_thick(CV_SWITCH, "esp_3d_box_thick", "1", "Thick 3D box");
|
||||
static CatVar esp_3d_box_expand_rate(CV_FLOAT, "esp_3d_box_expand_size", "10", "3D Box Expand Size", "Expand 3D box by X units", 50.0f);
|
||||
static CatVar esp_3d_box_expand(CV_SWITCH, "esp_3d_box_expand", "1", "Expand 3D box");
|
||||
static CatEnum esp_3d_box_smoothing_enum({"None", "Origin offset", "Bone update (NOT IMPL)"});
|
||||
static CatVar esp_3d_box_smoothing(esp_3d_box_smoothing_enum, "esp_3d_box_smoothing", "1", "3D box smoothing", "3D box smoothing method");
|
||||
static CatVar esp_3d_box_nodraw(CV_SWITCH, "esp_3d_box_nodraw", "0", "Invisible 3D box", "Don't draw 3d box");
|
||||
static CatVar esp_3d_box_healthbar(CV_SWITCH, "esp_3d_box_healthbar", "1", "Health bar");
|
||||
|
||||
void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healthmax) {
|
||||
Vector mins, maxs;
|
||||
@ -121,13 +128,23 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt
|
||||
if (!set || hb->max.z > maxs.z) maxs.z = hb->max.z;
|
||||
set = true;
|
||||
}
|
||||
// Expand it a bit
|
||||
|
||||
static const Vector expand_vector(8.5, 8.5, 8.5);
|
||||
// This is weird, smoothing only makes it worse on local servers
|
||||
if ((int)esp_3d_box_smoothing == 1) {
|
||||
mins += (RAW_ENT(ent)->GetAbsOrigin() - ent->m_vecOrigin);
|
||||
maxs += (RAW_ENT(ent)->GetAbsOrigin() - ent->m_vecOrigin);
|
||||
}
|
||||
|
||||
//static const Vector expand_vector(8.5, 8.5, 8.5);
|
||||
|
||||
if (esp_3d_box_expand) {
|
||||
maxs += expand_vector;
|
||||
mins -= expand_vector;
|
||||
const float& exp = (float)esp_3d_box_expand_rate;
|
||||
maxs.x += exp;
|
||||
maxs.y += exp;
|
||||
maxs.z += exp;
|
||||
mins.x -= exp;
|
||||
mins.y -= exp;
|
||||
mins.z -= exp;
|
||||
}
|
||||
|
||||
Vector points_r[8];
|
||||
@ -147,7 +164,31 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (!draw::WorldToScreen(points_r[i], points[i])) success = false;
|
||||
}
|
||||
int max_x = -1, max_y = -1, min_x = 65536, min_y = 65536;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (points[i].x > max_x) max_x = points[i].x;
|
||||
if (points[i].y > max_y) max_y = points[i].y;
|
||||
if (points[i].x < min_x) min_x = points[i].x;
|
||||
if (points[i].y < min_y) min_y = points[i].y;
|
||||
}
|
||||
if (!success) return;
|
||||
data.at(ent->m_IDX).esp_origin.Zero();
|
||||
switch ((int)esp_box_text_position) {
|
||||
case 0: { // TOP RIGHT
|
||||
data.at(ent->m_IDX).esp_origin = Vector(max_x + 1, min_y, 0);
|
||||
} break;
|
||||
case 1: { // BOTTOM RIGHT
|
||||
data.at(ent->m_IDX).esp_origin = Vector(max_x + 1, max_y - data.at(ent->m_IDX).string_count * 13, 0);
|
||||
} break;
|
||||
case 2: { // CENTER
|
||||
} break;
|
||||
case 3: { // ABOVE
|
||||
data.at(ent->m_IDX).esp_origin = Vector(min_x, min_y - data.at(ent->m_IDX).string_count * 13, 0);
|
||||
} break;
|
||||
case 4: { // BELOW
|
||||
data.at(ent->m_IDX).esp_origin = Vector(min_x, max_y, 0);
|
||||
}
|
||||
}
|
||||
//draw::String(fonts::ESP, points[0].x, points[0].y, clr, 1, "MIN");
|
||||
//draw::String(fonts::ESP, points[6].x, points[6].y, clr, 1, "MAX");
|
||||
constexpr int indices[][2] = {
|
||||
@ -159,14 +200,21 @@ void Draw3DBox(CachedEntity* ent, int clr, bool healthbar, int health, int healt
|
||||
if (esp_3d_box_health) clr = colors::Health(health, healthmax);
|
||||
bool cloak = ent->m_iClassID == g_pClassID->C_Player && IsPlayerInvisible(ent);
|
||||
if (cloak) clr = colors::Transparent(clr, 0.2);
|
||||
for (int i = 0; i < 12; i++) {
|
||||
const Vector& p1 = points[indices[i][0]];
|
||||
const Vector& p2 = points[indices[i][1]];
|
||||
draw::DrawLine(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
if (esp_3d_box_thick) {
|
||||
draw::DrawLine(p1.x + 1, p1.y, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
draw::DrawLine(p1.x, p1.y + 1, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
draw::DrawLine(p1.x + 1, p1.y + 1, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
if (esp_3d_box_healthbar) {
|
||||
draw::OutlineRect(min_x - 6, min_y, 6, max_y - min_y, colors::black);
|
||||
int hbh = (max_y - min_y - 2) * min((float)health / (float)healthmax, 1.0f);
|
||||
draw::DrawRect(min_x - 5, max_y - 1 - hbh, 4, hbh, colors::Health(health, healthmax));
|
||||
}
|
||||
if (!esp_3d_box_nodraw) {
|
||||
for (int i = 0; i < 12; i++) {
|
||||
const Vector& p1 = points[indices[i][0]];
|
||||
const Vector& p2 = points[indices[i][1]];
|
||||
draw::DrawLine(p1.x, p1.y, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
if (esp_3d_box_thick) {
|
||||
draw::DrawLine(p1.x + 1, p1.y, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
draw::DrawLine(p1.x, p1.y + 1, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
draw::DrawLine(p1.x + 1, p1.y + 1, p2.x - p1.x, p2.y - p1.y, clr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -197,8 +245,28 @@ void DrawBox(CachedEntity* ent, int clr, float widthFactor, float addHeight, boo
|
||||
//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((int)so.x, (int)so.y, draw::white, false, "origin");
|
||||
data[ent->m_IDX].esp_origin.x = so.x + width / 2 + 1;
|
||||
data[ent->m_IDX].esp_origin.y = so.y - height;
|
||||
int min_x, min_y, max_x, max_y;
|
||||
data.at(ent->m_IDX).esp_origin.Zero();
|
||||
max_x = so.x + width / 2 + 1;
|
||||
min_y = so.y - height;
|
||||
max_y = so.y;
|
||||
min_x = so.x - width / 2;
|
||||
switch ((int)esp_box_text_position) {
|
||||
case 0: { // TOP RIGHT
|
||||
data.at(ent->m_IDX).esp_origin = Vector(max_x, min_y, 0);
|
||||
} break;
|
||||
case 1: { // BOTTOM RIGHT
|
||||
data.at(ent->m_IDX).esp_origin = Vector(max_x, max_y - data.at(ent->m_IDX).string_count * 13, 0);
|
||||
} break;
|
||||
case 2: { // CENTER
|
||||
} break;
|
||||
case 3: { // ABOVE
|
||||
data.at(ent->m_IDX).esp_origin = Vector(min_x, min_y - data.at(ent->m_IDX).string_count * 13, 0);
|
||||
} break;
|
||||
case 4: { // BELOW
|
||||
data.at(ent->m_IDX).esp_origin = Vector(min_x, max_y, 0);
|
||||
}
|
||||
}
|
||||
unsigned char alpha = clr >> 24;
|
||||
float trf = (float)((float)alpha / 255.0f);
|
||||
int border = cloak ? colors::Create(160, 160, 160, alpha) : colors::Transparent(colors::black, trf);
|
||||
|
@ -83,6 +83,10 @@ void CreateMove() {
|
||||
typedef void(*CalcIsAttackCritical_t)(IClientEntity*);
|
||||
CalcIsAttackCritical_t CIACFn = (CalcIsAttackCritical_t)(CalcIsAttackCritical_s);
|
||||
if (g_pUserCmd->command_number) {
|
||||
if (!g_PredictionRandomSeed) {
|
||||
uintptr_t sig = gSignatures.GetClientSignature("89 1C 24 D9 5D D4 FF 90 3C 01 00 00 89 C7 8B 06 89 34 24 C1 E7 08 FF 90 3C 01 00 00 09 C7 33 3D ? ? ? ? 39 BB 34 0B 00 00 74 0E 89 BB 34 0B 00 00 89 3C 24 E8 ? ? ? ?");
|
||||
g_PredictionRandomSeed = *reinterpret_cast<int**>(sig + (uintptr_t)32);
|
||||
}
|
||||
int tries = 0;
|
||||
int cmdn = g_pUserCmd->command_number;
|
||||
bool chc = false;
|
||||
@ -90,8 +94,7 @@ void CreateMove() {
|
||||
int md5seed = MD5_PseudoRandom(cmdn) & 0x7fffffff;
|
||||
int rseed = md5seed;
|
||||
float bucket = *(float*)((uintptr_t)RAW_ENT(LOCAL_W) + 2612u);
|
||||
int& a = *(int*)((uintptr_t)(sharedobj::client->lmap->l_addr) + 0x01F8B228);
|
||||
a = md5seed;
|
||||
*g_PredictionRandomSeed = md5seed;
|
||||
int c = LOCAL_W->m_IDX << 8;
|
||||
int b = LOCAL_E->m_IDX;
|
||||
rseed = rseed ^ (b | c);
|
||||
|
@ -109,6 +109,8 @@ void Shutdown_hook(void* thisptr, const char* reason) {
|
||||
SEGV_END;
|
||||
}
|
||||
|
||||
static CatVar glow_enabled(CV_SWITCH, "glow_enabled", "0", "Enable", "Make sure to enable glow_outline_effect_enable in tf2 settings");
|
||||
|
||||
void FrameStageNotify_hook(void* thisptr, int stage) {
|
||||
SEGV_BEGIN;
|
||||
//logging::Info("FrameStageNotify %i", stage);
|
||||
@ -118,6 +120,63 @@ void FrameStageNotify_hook(void* thisptr, int stage) {
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
// TODO hack FSN hook
|
||||
if (TF && cathook && !g_Settings.bInvalid && stage == FRAME_RENDER_START) {
|
||||
if (glow_enabled) {
|
||||
for (int i = 0; i < g_GlowObjectManager->m_GlowObjectDefinitions.m_Size; i++) {
|
||||
GlowObjectDefinition_t& glowobject = g_GlowObjectManager->m_GlowObjectDefinitions[i];
|
||||
if (glowobject.m_nNextFreeSlot != ENTRY_IN_USE)
|
||||
continue;
|
||||
int color = GetEntityGlowColor(glowobject.m_hEntity.m_Index & 0xFFF);
|
||||
unsigned char _b = (color >> 16) & 0xFF;
|
||||
unsigned char _g = (color >> 8) & 0xFF;
|
||||
unsigned char _r = (color) & 0xFF;
|
||||
glowobject.m_vGlowColor.x = (float)_r / 255.0f;
|
||||
glowobject.m_vGlowColor.y = (float)_g / 255.0f;
|
||||
glowobject.m_vGlowColor.z = (float)_b / 255.0f;
|
||||
}
|
||||
}
|
||||
// Remove glow from dead entities
|
||||
for (int i = 0; i < g_GlowObjectManager->m_GlowObjectDefinitions.Count(); i++) {
|
||||
if (g_GlowObjectManager->m_GlowObjectDefinitions[i].m_nNextFreeSlot != ENTRY_IN_USE) continue;
|
||||
IClientEntity* ent = (IClientEntity*)g_IEntityList->GetClientEntityFromHandle(g_GlowObjectManager->m_GlowObjectDefinitions[i].m_hEntity);
|
||||
if (ent && ent->IsDormant()) {
|
||||
g_GlowObjectManager->DisableGlow(i);
|
||||
} else if (ent && ent->GetClientClass()->m_ClassID == g_pClassID->C_Player) {
|
||||
if (NET_BYTE(ent, netvar.iLifeState) != LIFE_ALIVE) {
|
||||
g_GlowObjectManager->DisableGlow(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (glow_enabled) {
|
||||
for (int i = 1; i < g_IEntityList->GetHighestEntityIndex(); i++) {
|
||||
IClientEntity* entity = g_IEntityList->GetClientEntity(i);
|
||||
if (!entity || i == g_IEngine->GetLocalPlayer() || entity->IsDormant())
|
||||
continue;
|
||||
if (!CanEntityEvenGlow(i)) continue;
|
||||
int clazz = entity->GetClientClass()->m_ClassID;
|
||||
int current_handle = g_GlowObjectManager->GlowHandle(entity);
|
||||
bool shouldglow = ShouldEntityGlow(i);
|
||||
if (current_handle != -1) {
|
||||
if (!shouldglow) {
|
||||
g_GlowObjectManager->DisableGlow(current_handle);
|
||||
}
|
||||
} else {
|
||||
if (shouldglow) {
|
||||
g_GlowObjectManager->EnableGlow(entity, colors::white);
|
||||
}
|
||||
}
|
||||
/*bool old_byte = NET_BYTE(entity, 0xDA1);
|
||||
bool new_byte = (glow_enabled && ShouldEntityGlow(i));
|
||||
if (CanEntityEvenGlow(i)) NET_BYTE(entity, 0xDA1) = new_byte;
|
||||
if (old_byte != new_byte && clazz == g_pClassID->CTFPlayer) {
|
||||
if (new_byte) {
|
||||
vfunc<void(*)(IClientEntity*)>(entity, 290, 0)(entity);
|
||||
} else {
|
||||
vfunc<void(*)(IClientEntity*)>(entity, 291, 0)(entity);
|
||||
}
|
||||
}*/
|
||||
|
||||
}
|
||||
}
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
if (force_thirdperson && !g_pLocalPlayer->life_state && CE_GOOD(g_pLocalPlayer->entity)) {
|
||||
SVDBG("FSN %i", __LINE__);
|
||||
@ -186,6 +245,7 @@ bool DispatchUserMessage_hook(void* thisptr, int type, bf_read& buf) {
|
||||
}
|
||||
|
||||
void LevelInit_hook(void* thisptr, const char* newmap) {
|
||||
playerlist::Save();
|
||||
((LevelInit_t*) hooks::hkClientMode->GetMethod(hooks::offLevelInit))(thisptr, newmap);
|
||||
g_IEngine->ClientCmd_Unrestricted("exec cat_matchexec");
|
||||
hacks::shared::aimbot::Reset();
|
||||
|
@ -92,10 +92,10 @@ void CreateInterfaces() {
|
||||
if (TF2) g_IInput = **(reinterpret_cast<IInput***>((uintptr_t)1 + gSignatures.GetClientSignature("A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF 92 B4 00 00 00 A1 ? ? ? ? 8B 10")));
|
||||
else if (TF2C) g_IInput = **(reinterpret_cast<IInput***>((uintptr_t)1 + gSignatures.GetClientSignature("A1 ? ? ? ? C6 05 ? ? ? ? 01 8B 10 89 04 24 FF 92 A8 00 00 00 A1 ? ? ? ? 8B 10")));
|
||||
else if (HL2DM) g_IInput = **(reinterpret_cast<IInput***>((uintptr_t)1 + gSignatures.GetClientSignature("A1 ? ? ? ? 8B 10 89 04 24 FF 52 78 A1 ? ? ? ? 8B 10")));
|
||||
if (TF2 || HL2DM)
|
||||
g_IMatSystemSurface = **reinterpret_cast<IMatSystemSurface***>((uintptr_t)19 + gSignatures.GetClientSignature("FF 92 94 02 00 00 8B 8D C4 FE FF FF 89 85 B0 FE FF FF A1 ? ? ? ? 8B 10 89 4C 24 0C"));
|
||||
else if (TF2C)
|
||||
g_IMatSystemSurface = **reinterpret_cast<IMatSystemSurface***>((uintptr_t)53 + gSignatures.GetClientSignature("C7 44 24 1C FF 00 00 00 C7 44 24 18 FF 00 00 00 C7 44 24 14 FF 00 00 00 C7 44 24 10 00 00 00 00 89 74 24 08 8B 83 D0 E1 00 00 89 95 A4 FE FF FF 89 44 24 04 A1 ? ? ? ? 89 04 24 FF 91 88 02 00 00 8B 95 A4 FE FF FF A1 ? ? ? ? 29 FA 8B 08 89 54 24 0C"));
|
||||
//if (TF2 || HL2DM)
|
||||
//g_IMatSystemSurface = **reinterpret_cast<IMatSystemSurface***>((uintptr_t)19 + gSignatures.GetClientSignature("FF 92 94 02 00 00 8B 8D C4 FE FF FF 89 85 B0 FE FF FF A1 ? ? ? ? 8B 10 89 4C 24 0C"));
|
||||
//else if (TF2C)
|
||||
//g_IMatSystemSurface = **reinterpret_cast<IMatSystemSurface***>((uintptr_t)53 + gSignatures.GetClientSignature("C7 44 24 1C FF 00 00 00 C7 44 24 18 FF 00 00 00 C7 44 24 14 FF 00 00 00 C7 44 24 10 00 00 00 00 89 74 24 08 8B 83 D0 E1 00 00 89 95 A4 FE FF FF 89 44 24 04 A1 ? ? ? ? 89 04 24 FF 91 88 02 00 00 8B 95 A4 FE FF FF A1 ? ? ? ? 29 FA 8B 08 89 54 24 0C"));
|
||||
g_ISteamUser = g_ISteamClient->GetISteamUser(su, sp, "SteamUser018");
|
||||
g_IAchievementMgr = g_IEngine->GetAchievementMgr();
|
||||
g_ISteamUserStats = g_ISteamClient->GetISteamUserStats(su, sp, "STEAMUSERSTATS_INTERFACE_VERSION011");
|
||||
|
Reference in New Issue
Block a user