File:vpatch th06 unicode.zip

From Touhou Patch Center
Jump to: navigation, search
vpatch_th06_unicode.zip(file size: 48 KB, MIME type: application/zip)
Warning: This file type may contain malicious code. By executing it, your system may be compromised.

This custom version of vpatch_th06.dll 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 DllMain(), these modifications would have been impossible to achieve on-the-fly with thcrap in its current state of development.

Setup

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

Detailed changelog

All adresses refer to file offsets.

  • 0x02c61: Change the application name pointer to our modified name.
  • 0x033e2: Double the size of the local stack to accommodate for wide chars.
  • 0x033f4: Replace GetModuleFileNameA() with GetModuleFileNameW().
  • 0x03403: Adjust calculation to point to the last 10 wide chars of the GetModuleFileNameW() buffer.
  • 0x0340b: 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).
  • 0x03470: Double the size of the local stack to accommodate for wide chars.
  • 0x11124: 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.
  • 0x124cf: Change CreateProcessA() to CreateProcessW().
  • 0x14490: Add one more element to the relocation table.
  • 0x14496: Insert a relocation for the StrCmpW() call. The rest of the relocation table is moved by 2 bytes.
  • Add a new import table, importing GetModuleFileNameW() from KERNEL32.DLL and StrCmpW() from SHLWAPI.DLL.

File history

Click on a date/time to view the file as it appeared at that time.

Date/TimeDimensionsUserComment
current17:02, 25 October 2013 (48 KB)NamelessLegacy (Talk | contribs)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 ...
  • You cannot overwrite this file.

There are no pages that link to this file.