diff options
| author | salmonik <salmonik@tuta.io> | 2026-11-04 13:19:50 +0100 |
|---|---|---|
| committer | salmonik <salmonik@tuta.io> | 2026-11-04 13:19:50 +0100 |
| commit | 6a7e0b3bae04a5a4667267b6a45baddeb66fc570 (patch) | |
| tree | 557c31924d468345a15886ac6e75209d00c49524 /src/hl2h.h | |
| parent | Studio: drop the prop draw diagnostic (diff) | |
| download | hl2h-6a7e0b3bae04a5a4667267b6a45baddeb66fc570.tar.gz hl2h-6a7e0b3bae04a5a4667267b6a45baddeb66fc570.zip | |
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.
Diffstat (limited to 'src/hl2h.h')
| -rw-r--r-- | src/hl2h.h | 2 |
1 files changed, 2 insertions, 0 deletions
| @@ -278,6 +278,8 @@ int server_npc_takedamage(int idx); | |||
| 278 | int server_npc_turret_flags(int idx); | 278 | int server_npc_turret_flags(int idx); |
| 279 | int server_model_index(void *base); | 279 | int server_model_index(void *base); |
| 280 | void find_modules(); | 280 | void find_modules(); |
| 281 | bool module_jump_slot(const char *path, const char *name, uintptr_t *vaddr, | ||
| 282 | uintptr_t *bias); | ||
| 281 | void init_conmsg(); | 283 | void init_conmsg(); |
| 282 | bool feature_active(int feature); | 284 | bool feature_active(int feature); |
| 283 | bool feature_has_bind(int feature); | 285 | bool feature_has_bind(int feature); |
