-
-
Notifications
You must be signed in to change notification settings - Fork 432
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regression in detour after Dhooks safetyhook #2212
Comments
Could you send the register values from your crash dump during |
These?
|
Similar to this, also had a crash from Gamedata:
Crash dump from function:
|
Seeing the call to |
This is still an issue as of build 7187. The only detour I can see this happening on is This is a bit problematic since 1.12 is considered stable but upgrading to 7164 and above is not possible for some people. |
I would prefer if this was opened as a separate issue. The root cause of And while The Or putting this another way, this needs more information. If it really is the same crash and root issue, then please disregard the comment. |
@psychonic Perhaps a fair compromise would be to reintroduce libudis86 for CDetour in 32bits build only ? |
sourcemod/extensions/dhooks/DynamicHooks/hook.cpp Lines 624 to 625 in cb0f8f0
This change has confused me since the day of the safetyhook commit, and I bet it's responsible for the |
Full context of the changes : -masm.jmp(ExternalAddress(m_pTrampoline));
+masm.movl(eax, Operand(ExternalAddress(&m_pTrampoline)));
+masm.jmp(eax);
When dhooks used libudis86, the trampoline value was known and could be written directly into the assembly.
As of safetyhook, the bridge needs to be built before the trampoline is constructed (limitation of safetyhook). So instead it's necessary to write the assembly instructions like so
We could also just rewrite that section of the memory. But it's unnecessary extra logic for dhooks that would make the process even more confusing than it is now.
Again, most likely a different crash than OP's issue. If the jump was "wrong" we would also crash on regular function detour but we're not. Of course I'm open to the idea any changes that I made to dhooks could be wrong (instead of the issue being in safetyhook), but this needs analysis rather than conjectures. |
|
Hmm I don't recall that register being used, but either way you're absolutely right, this is a problem, and I failed to account for that. Then this should be fixeable, dhooks code confusion be dammed. Thanks! I'll have a fix ready soon. Still out of luck for the other crash |
Environment
Description
One of 16 detours we use with dhooks has started crashing after commit 6b6dbc6.
UTIL_GetLocalPlayer
as a pre-hook.MRES_Ignored
makes the original function crash any time it is called by game.DHookSetReturn(hReturn, -1); return MRES_Supercede;
instead does not crash.Problematic Code (or Steps to Reproduce)
lp_test.games.txt
lp_test.sp
Logs
https://crash.limetech.org/cvvrva7bbtoj
The text was updated successfully, but these errors were encountered: