mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-28 04:41:07 +00:00
Refresh module handle if NULL when hitting GetProcAddress
* This might be a more serious problem in future... * We only hook all loaded modules once, at init time, in Win32_IAT_EndHooks * If a LoadLibrary call afterwards implicitly loads some modules we don't see them. Potentially we should rehook all loaded modules again each time LoadLibrary is called but then there would be a lot of redundant work unless we tracked module unload/loads to see if a module has been hooked before or not. For now assume we don't need to hook these modules and get away with just updating module handles
This commit is contained in:
@@ -220,6 +220,9 @@ FARPROC WINAPI Hooked_GetProcAddress(HMODULE mod, LPCSTR func)
|
||||
|
||||
for(auto it=s_HookData->DllHooks.begin(); it != s_HookData->DllHooks.end(); ++it)
|
||||
{
|
||||
if(it->second.module == NULL)
|
||||
it->second.module = GetModuleHandleA(it->first.c_str());
|
||||
|
||||
if(mod == it->second.module)
|
||||
{
|
||||
FunctionHook search(func, NULL, NULL);
|
||||
|
||||
Reference in New Issue
Block a user