Am Montag, 27. November 2023, 06:27:51 EAT schrieb Dāvis Mosāns:
Hi,
I've been looking to get League of Legends work in Wine. The issue is that their Anti-Cheat hooks bunch of functions in ntdll.dll directly by prepending `jmp their_code` before the real function and it seems it messes something up.
Anyway, topic of this email is about handling of stack overflow. When their exception handler gets messed up it is invoked recursively until stack overflow. And because it happened while it was in critical section it causes other threads to deadlock.
Since this is anti-cheat it is tricky, and things might not be what they seem.
When you say "it messes something up", are you sure the hook is working correctly to begin with? If not, that needs to be fixed rather than handling the fallout exception.
Do you know if the recursive invocation happens on Windows too? You mention that the process is killed, so it doesn't sound like it is supposed to happen.
Anti-cheat / Anti-debugger / DRM systems usually don't tell you nicely if they think something is wrong. When they think you are trying to mess with them they usually pretend to proceed for a while, do something else and then at a much later point deliberately crash the process in a weird way. So your exception handler recursion might be the Anti-cheat's underhanded attempt to kill the process.