Repository navigation
Conversation
(cherry picked from commit 57929ca)
(cherry picked from commit 4b87f92)
(cherry picked from commit ca591ee)
(cherry picked from commit 82cdcf5)
(cherry picked from commit 1b5aeba)
(cherry picked from commit 7a7137c)
(cherry picked from commit 34c664a)
…copy a ton of notes from System V docs (cherry picked from commit 4a8b72b)
(cherry picked from commit d2b821e)
(cherry picked from commit 323671b)
(cherry picked from commit b329d65)
(cherry picked from commit a884302)
(cherry picked from commit 330907b)
(cherry picked from commit 623632d)
(cherry picked from commit 13b3a8e)
(cherry picked from commit 860326b)
(cherry picked from commit e20a0cf)
…elegates/original
…, not from the pointer itself
This was referenced Oct 19, 2026
This was referenced Oct 19, 2026
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SourceHook: hook manager generator for Linux x86_64
Why
SourceMod's DHooks virtual hooks go through
IHookManagerAutoGen::MakeHookMan, which on Linux x86_64 had no working generator. Without it DHooks can't run on 64-bit Linux servers (CS:S, TF2, DoD:S, HL2:DM). We need it to move our CS:S servers to x64.What
linux64hookswork (x64 linux sourcehook hookmangen alliedmodders/metamod-source#212, closed when upstream moved to KHook). Authorship is kept on all 18 commits. It's rebased on the current1.12-dev(cb47755, the 1.12.0-git1228 build), and the only conflict was thexor→xorregrename done upstream.breakpoint()(int3) that was left at the start of every generated hook function and made the server stop with SIGTRAP on the first hooked call;PushParametersreloaded every saved argument register, including the originalthis, but never loadedv_this. Delegates were therefore called with the hooked entity asthisand crashed inISHDelegate::Call. It now loadsv_thisinto the this register, after the hidden return pointer when there is one, like the MSVC path.Vector(12-byte object) return path readxmm0/xmm1from thev_retptrslot itself rather than from the value it points to, so callers got the pointer's bytes. It now dereferences it, like the generic path below.Testing
Teleportis caught and the teleport really happens;OnTakeDamagepre-hook changes the damage throughSetObjectVarand the change applies in game (20 → 10 HP);Weapon_ShootPositionreturns aVector: the post-hook reads it and a pre-hook supercede reaches the caller;GetPlayerMaxSpeedreturns a float and is superseded;AcceptInputpassesvariant_tby hidden reference.Companion PR: srcdslab/sourcemod#9 (DHooks Linux x86_64).