Skip to content

Commit

Permalink
Tell the user to download KB2533623 if DLL injection failed.
Browse files Browse the repository at this point in the history
Another cause for DLL injection failure, and hopefully the last one. The LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR flag of LoadLibraryEx is unsupported on Windows XP, but the function works just fine otherwise. However, on Windows Vista and 7 installations *without* KB2533623 installed, the function just outright fails entirely if that flag is given. As a result, f4b1db7 broke thcrap for pretty much everyone who hasn't updated their Windows Vista or 7 since KB2533623 was published in 2011.

Working around this issue is both painful and counter-productive (keep your systems updated, will you!). Thus, we just tell people to get that specific system update instead.

Of course we could have only mentioned that update if the user actually *is* running Vista or 7. However, with Windows 8.1, GetVersionInfoEx() was deprecated and replaced by the new Version Helper APIs (http://msdn.microsoft.com/en-us/library/windows/desktop/dn424972%28v=vs.85%29.aspx). These are, of course, exclusively available in the Windows 8.1 SDK, which I have been failing to integrate into my build environment.
  • Loading branch information
nmlgc committed Jan 24, 2014
1 parent ed0f7d9 commit 30c4bca
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion thcrap/src/inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,12 @@ unsigned char* StringToUTF16_advance_dst(unsigned char *dst, const char *src)
int Inject(HANDLE hProcess, const char *dll_dir, const char *dll_fn, const char *func_name, const void *param, const size_t param_size)
{
// String constants
const char *injectError1Format = "Could not load the dll: %s";
const char *injectError1Format =
"Could not inject %s.\n"
"\n"
"If you're running Windows Vista or 7, make sure that you have installed the KB2533623 update:\n"
"\n"
"\thttp://support.microsoft.com/kb/2533623/";
const char *injectError2Format = "Could not load the function: %s";

//------------------------------------------//
Expand Down

0 comments on commit 30c4bca

Please sign in to comment.