From 6a7e0b3bae04a5a4667267b6a45baddeb66fc570 Mon Sep 17 00:00:00 2001 From: salmonik Date: Wed, 4 Nov 2026 13:19:50 +0100 Subject: Fix No spread on the hl2_complete server build The server RandomSeed GOT slot was hardcoded to 0xce1348, measured on the older bin/server.so. The anniversary branch loads hl2_complete/bin/server.so, whose R_386_JMP_SLOT for RandomSeed is 0xce5348, so the patch hit unrelated writable data and no spread silently did nothing. - Read the relocation from the loaded module's ELF (module_jump_slot) instead of hardcoding, with the two known offsets as fallback. - Override whenever the RandomSeed caller's `this` is the local server player (CBaseEntity::FireBullets) instead of matching a hardcoded return-address range that also moved between builds. - m_takedamage is a char (FIELD_CHARACTER) in the 2013 SDK; resolve it as such and read a byte, so the IMMUNE damage tag actually works. --- src/hl2h.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/hl2h.h') diff --git a/src/hl2h.h b/src/hl2h.h index e35e737..b7fc2f5 100644 --- a/src/hl2h.h +++ b/src/hl2h.h @@ -278,6 +278,8 @@ int server_npc_takedamage(int idx); int server_npc_turret_flags(int idx); int server_model_index(void *base); void find_modules(); +bool module_jump_slot(const char *path, const char *name, uintptr_t *vaddr, + uintptr_t *bias); void init_conmsg(); bool feature_active(int feature); bool feature_has_bind(int feature); -- cgit v1.2.3