This custom version of <tt>vpatch_th06.dll</tt> changes the references to the game's .exe file name from Shift-JIS to Unicode. With this, the patch will always refer to 東方紅魔郷.exe (and never to any mojibake representation), independent of the current locale.

Of course, this alone won't suddenly make vpatch work with the Japanese th06 without AppLocale. This would require the game itself to use Unicode.

It is mainly required to be able to chain the [[Touhou Community Reliant Automatic Patcher]] to vpatch. Since all the relevant code is called from <tt>DllMain()</tt>, these modifications would have been impossible to achieve on-the-fly with thcrap in its current state of development.

=== Setup ===
Copy <tt>vpatch_th06_unicode.dll</tt> to the directory containing th06 and vpatch, and delete the original <tt>vpatch_th06.dll</tt> from that position. This is necessary because vpatch might otherwise inject the original DLL.

=== Detailed changelog ====
All adresses refer to file offsets.

* <tt>0x02c61</tt>: Change the application name pointer to our modified name.
* <tt>0x033e2</tt>: Double the size of the local stack to accommodate for wide chars.
* <tt>0x033f4</tt>: Replace GetModuleFileNameA() with GetModuleFileNameW().
* <tt>0x03403</tt>: Adjust calculation to point to the last 10 wide chars of the GetModuleFileNameW() buffer.
* <tt>0x0340b</tt>: Replace the call to vpatch_th06.dll's custom compare function with a call to StrCmpW(), and remove the local stack cleanup (all Windows functions do so themselves).
* <tt>0x03470</tt>: Double the size of the local stack to accommodate for wide chars.
* <tt>0x11124</tt>: Replace the Shift-JIS string "東方紅魔郷.exe" with its UTF-16 representation. Overwrite the second instance, since the string is larger in UTF-16 and we only need one constant copy of it.
* <tt>0x124cf</tt>: Change CreateProcessA() to CreateProcessW().
* <tt>0x14490</tt>: Add one more element to the relocation table.
* <tt>0x14496</tt>: Insert a relocation for the StrCmpW() call. The rest of the relocation table is moved by 2 bytes.
* Add a new import table, importing <tt>GetModuleFileNameW()</tt> from KERNEL32.DLL and <tt>StrCmpW()</tt> from SHLWAPI.DLL.