From d164e3373108d0c0f83452fbea22f8569b84eec6 Mon Sep 17 00:00:00 2001 From: salmonik Date: Mon, 26 Oct 2026 17:53:40 +0100 Subject: Docs/cleanup: refresh CONTEXT, update ISurface status, remove dead code - rewrite CONTEXT.md for the current architecture, interfaces, netvars, menu tree, bones/ESP, aimbot/vischeck, triggerbot, silent aim and ABH - update ISURFACE_STATUS.md: DrawLine slot, current menu/config path, 9 build TUs, current file layout - remove the stale root-level `tree` file - drop unused class_health_off/per-class health scan (NPC HP is not networked), surf_call_slot, and unused scancode helpers --- src/netvars.cpp | 44 ++++---------------------------------------- 1 file changed, 4 insertions(+), 40 deletions(-) (limited to 'src/netvars.cpp') diff --git a/src/netvars.cpp b/src/netvars.cpp index f702c41..b4e31d5 100644 --- a/src/netvars.cpp +++ b/src/netvars.cpp @@ -27,24 +27,7 @@ static bool module_string(uintptr_t p, char *out, size_t outn) { static int g_dumped_tables = 0; -// per-client-class health offset (m_iHealth lives at different offsets per -// class chain: CBasePlayer via DT_BasePlayer=128, NPCs via DT_BaseCombatCharacter) -static struct { - char name[32]; - int off; -} g_class_health[256]; -static int g_class_health_n = 0; - -int class_health_off(const char *name) { - for (int i = 0; i < g_class_health_n; i++) - if (strcmp(name, g_class_health[i].name) == 0) - return g_class_health[i].off; - return -1; -} - -static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth, - int *out_health) -{ +static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth) { if (depth > 8) return; uintptr_t props = *(uintptr_t *)(table + 0x00); @@ -85,13 +68,10 @@ static void collect_netvars(uintptr_t table, uintptr_t base_off, int depth, logf(" [%s] %s type=%d off=%d(0x%x) table=%s array=%s", tname, pname2, ptype, poff, poff, ptable ? "yes" : "no", parray ? "yes" : "no"); if (ptable) { - collect_netvars(ptable, base_off + (uint32_t)poff, depth + 1, - out_health); + collect_netvars(ptable, base_off + (uint32_t)poff, depth + 1); continue; } - if (out_health && *out_health < 0 && strcmp(pname2, "m_iHealth") == 0) - *out_health = (int)(base_off + (uint32_t)poff); if (strcmp(pname2, "m_lifeState") == 0 && g_net.lifestate < 0) { g_net.lifestate = (int)(base_off + (uint32_t)poff); } else if (strcmp(pname2, "m_nModelIndex") == 0 && g_net.modelindex < 0) { @@ -217,25 +197,9 @@ void resolve_netvars() { for (uintptr_t cc = head; cc && g_client.contains(cc) && classes < 1024; cc = *(uintptr_t *)(cc + 0x10)) { classes++; - char cname[32]; - int hoff = -1; - // per-class health offset — NPCs send m_iHealth via their own table chain, - // not DT_BasePlayer's; g_net.health keeps the player's for aimbot use - if (module_string(*(uintptr_t *)(cc + 0x08), cname, sizeof(cname))) { - collect_netvars(*(uintptr_t *)(cc + 0x0C), 0, 0, &hoff); - if (hoff >= 0 && g_class_health_n < 256) { - char *dst = g_class_health[g_class_health_n].name; - const char *src = cname; - size_t n = sizeof(g_class_health[g_class_health_n].name) - 1; - for (size_t i = 0; i < n && src[i]; i++) dst[i] = src[i]; - dst[n] = 0; - g_class_health[g_class_health_n].off = hoff; - g_class_health_n++; - } - } + collect_netvars(*(uintptr_t *)(cc + 0x0C), 0, 0); } - logf("client classes walked: %d, health-offset classes: %d", classes, - g_class_health_n); + logf("client classes walked: %d", classes); if (g_net.movetype < 0 && !resolve_movetype()) { // movetype unresolved — bhop still works, just no noclip/ladder guard -- cgit v1.2.3