Please sign in to comment.
Overlay: Resolve undefined behavior
* Now that we no longer do anything when unloading the overlay DLL, remove the injection of FreeLibrary. This also drops some undefined behavior. ** If we inject into rendering (D3Dxx.cpp) we hold a self-reference to prevent to ever be unloaded. For this case, there is no issue as the hooks will always exist. ** In case of no rendering-injection, our module can actually be unloaded. In that case, MyFreeLibrary would call the original function which in turn would lead to a call to DllMain with DLL_PROCESS_DETACH, at which point we restore the hooks to their original equivalents in dllmainProcDetach. However, afterwards, execution returns to our MyFreeLibrary function, whichs code is no longer the code we began executing. ** This also leads to the question whether the non-trampoline hooking ever worked/even works. We restore, call the original (which is already code that no longer exists) and then inject again.
- Loading branch information...