Tell the user to download KB2533623 if DLL injection failed.

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, f4b1db75e905a443b814b5dddd1e28f49233f6c9 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.
MSG patching: Fix a memory corruption bug introduced by the last cleanup commit.

I should keep a tally of the instances where pointer arithmetic has actually made the code clearer, and where it just made matters worse.
Prepare and keep breakpoint data in a local structure.

This gets rid of all the JSON dictionary lookups in breakpoint_process(), and makes everything a whole lot cleaner.

... It also trades O(1) performance for O(N) performance, but it shouldn't really matter in the current use cases - and once it does, we'll think of a better solution than Jansson.
binhacks_apply(): Fix a logic flaw in the log counting.
Add functions to access flexible JSON arrays.

Suddenly, even my most hated function in this code is looking so clean!
Count the number of binary hack instances in advance.

And yes, we're going to use this for multi-address breakpoints, too.

"Hackpoints". What a brilliant name.
Music Room patching: Don't print "@" for untranslated music titles.
Cleanup.
Use runconfig_func_get() to resolve functions in binary hacks.

This requires the list of exported functions to be stored in the run configuration beforehand - which is also going to be required for the upcoming changes to the breakpoint system.

Also, getting rid of all the comments suggesting that the function list would be exclusively used for binary hacks.
Refactor breakpoint rendering into its own function.
breakpoints_apply(): Take the "breakpoints" object as a parameter.

Now orthogonal to binhacks_apply().
Support breakpoints with multiple addresses.
Eliminate crashes when an "archive" object is no string.
Only use the LOAD_LIBRARY_SEARCH_DLL_LOAD_DIR flag if KB2533623 is installed.

... oh wait, it *is* easy to check whether that update is installed.
runconfig_set(): Decrease the reference count of the old run configuration.
thcrap_init(): Improve naming of the different run configuration variables.

... really, we should get rid of that run_cfg global.
Introduce a global run configuration file at the bottom of the hierarchy.

This can be used to define general run configuration elements shared by all games.
Add a breakpoint to calculate the X offset for variable-width Ruby annotations.

Third attempt at patching ruby annotations. At a cost of requiring 6 values per game, we finally got it right this time.
Use the iat_detour_t structure for the low-level IAT detour functions.
Fall back to IAT detouring by pointer if OriginalFirstThunk is not available.

Fixes a crash that previously occurred in this case. This is particularly likely to happen with unpacked versions of previously packed binaries (UPX decompressor, I'm looking at you).