Store run configuration file name in the run configuration.

This will be necessary for chaining multiple injection-based patches together. And it's a one-liner change, yay.

On the other hand, this gets us even further away from run configuration stacking. Well, gotta wait for the GUI configuration tool to see how and whether we need this.
Add a macro for the most common StringToUTF16 use case.
strings_vsprintf(): Don't replace the pointer if realloc() failed.
Use the new json_pack() string concatenation syntax introduced in Jansson 2.5.
thcrap_inject(): Determine the DLL directory using GetModuleFileNameU().

Necessary for chained injection, where the directory of a process executable may no longer be the same as the directory that contains thcrap.dll.
thcrap_inject(): Determine the DLL name using GetModuleHandleEx().

Not only does this get rid of the #ifdef, it also allows the DLL to be renamed without changing the source code.
Add json_array_from_wchar_array().

Not too happy about either naming or placement... but well, that code appeared in both the loader and the configuration tool, so it deserved to get its own function.

Putting it into win32_utf8, returning a char**, would have been the alternative, but that has to be recursively freed, so I decided against it. GetCommandLine() and CommandLineToArgvW() are basically the same.
Move DLL injection code to the main engine.
Cleanup.

That should have been all the whitespace issues.
Simplify size calculation for translated Win32 dialogs.

Well, it always takes a while for me to get the best ideas.
thcrap_update: Add UTF-8 wrappers for the wininet functions used.

Sometimes, you just got to do the right thing... even if that means adding about 150 lines of code that seemingly do nothing.

Anyway, this means that the engine now truly uses UTF-8 everywhere.
Remove UTF-16 JSON and logging functions from the main engine.

Finally, everything is consistent. Encodings should never be mixed again.
thcrap_tsa layout: Statically call the functions detoured for the main process.

The DLL still keeps its own function pointers to the system functions. These type definitions and GetProcAddress() calls are not necessary at all.
Introduce a "detour" naming convention for the IAT patch functions.

There are already way too many different things named "patch" in the engine. It has pretty much become an umbrella term without any real meaning, and this is never a good thing.
Move submodule detour calls from thcrap_init() to a dedicated function.
Split log functions into a variadic and a va_list function.
tsa_CreateWindowExA(): Observe CW_USEDEFAULT.
StringToUTF8: Take the actual buffer length as parameter.

... instead of intransparently multiplying it by some factor. You should not be able to accidentally cause a buffer overflow just because you forgot an implementation detail of a certain function. Instead, let's do the one and only sensible thing - and lo and behold, it doesn't complicate the code in the slightest.
EnumProcessModules() takes the number of *bytes*, not elements.

Changing variable names to reflect this.
module_base_get(): Accept both relative and absolute module names.