From 3020e5ce953600eac3284be4b3a46215d08ffb65 Mon Sep 17 00:00:00 2001 From: baldurk Date: Tue, 2 Sep 2014 00:15:46 +0100 Subject: [PATCH] Protection if import descriptor tables are non-existant * This is perhaps for descriptors entirely importing by ordinal and the linker skips the descriptor table. --- renderdoc/os/win32/win32_hook.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/renderdoc/os/win32/win32_hook.cpp b/renderdoc/os/win32/win32_hook.cpp index f6e2cca4c..20902bd3c 100644 --- a/renderdoc/os/win32/win32_hook.cpp +++ b/renderdoc/os/win32/win32_hook.cpp @@ -156,7 +156,7 @@ struct CachedHookData if(!_stricmp(it->first.c_str(), dllName)) hookset = &it->second; - if(hookset) + if(hookset && importDesc->OriginalFirstThunk > 0 && importDesc->FirstThunk > 0) { IMAGE_THUNK_DATA *origFirst = (IMAGE_THUNK_DATA *)(baseAddress + importDesc->OriginalFirstThunk); IMAGE_THUNK_DATA *first = (IMAGE_THUNK_DATA *)(baseAddress + importDesc->FirstThunk);