From b5efee195a250aba3ecb16b7e6b9e30787406609 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Fri, 20 Apr 2012 21:05:15 +0100 Subject: [PATCH] Don't force using system librarie on retrace. --- retrace/dllretrace.py | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/retrace/dllretrace.py b/retrace/dllretrace.py index db1a586..abcd202 100644 --- a/retrace/dllretrace.py +++ b/retrace/dllretrace.py @@ -31,23 +31,18 @@ from dispatch import Dispatcher class DllRetracer(Retracer): def retraceApi(self, api): - print ''' + print r''' +static LPCSTR g_szDll = "%s"; static HMODULE g_hDll = NULL; static PROC _getPublicProcAddress(LPCSTR lpProcName) { if (!g_hDll) { - char szDll[MAX_PATH] = {0}; - - if (!GetSystemDirectoryA(szDll, MAX_PATH)) { - return NULL; - } - - strcat(szDll, "\\\\%s"); - - g_hDll = LoadLibraryA(szDll); + g_hDll = LoadLibraryA(g_szDll); if (!g_hDll) { + os::log("error: failed to load %%s\n", g_szDll); + exit(1); return NULL; } } @@ -55,7 +50,7 @@ _getPublicProcAddress(LPCSTR lpProcName) return GetProcAddress(g_hDll, lpProcName); } -''' % api.name +''' % api.name.upper() dispatcher = Dispatcher() dispatcher.dispatch_api(api) -- 2.43.0