diff options
Diffstat (limited to 'inject')
-rw-r--r-- | inject/injectee.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/inject/injectee.cpp b/inject/injectee.cpp index 5ffdbafd..e31df595 100644 --- a/inject/injectee.cpp +++ b/inject/injectee.cpp @@ -586,9 +586,6 @@ enum Action { }; -static char g_szSystemDirectory[MAX_PATH]; - - template< class T > void patchDescriptor(HMODULE hModule, @@ -611,9 +608,7 @@ patchDescriptor(HMODULE hModule, // Knowning the real address is useful when patching imports by ordinal LPVOID lpRealAddress = NULL; - char szRealModule[MAX_PATH]; - _snprintf(szRealModule, sizeof szRealModule, "%s\\%s", g_szSystemDirectory, szDescriptorName); - HMODULE hRealModule = GetModuleHandleA(szRealModule); + HMODULE hRealModule = GetModuleHandleA(szDescriptorName); if (hRealModule) { assert(hRealModule != g_hHookModule); lpRealAddress = (LPVOID)GetProcAddress(hRealModule, szFunctionName); @@ -1035,10 +1030,6 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) debugPrintf("inject: attached to process %s\n", szProcess); } - if (!GetSystemDirectoryA(g_szSystemDirectory, _countof(g_szSystemDirectory))) { - assert(0); - } - /* * Calling LoadLibrary inside DllMain is strongly discouraged. But it * works quite well, provided that the loaded DLL does not require or do |