diff --git a/source/SilentPatchW101.cpp b/source/SilentPatchW101.cpp index 51648d7..ca8368d 100644 --- a/source/SilentPatchW101.cpp +++ b/source/SilentPatchW101.cpp @@ -195,7 +195,18 @@ void OnInitializeHook() Patch( noFL.get_first( 2 ), 0xEB ); // jbe -> jmp } } - + + + // Change OST + // This works by changing the BGM_304_SwitchtoLive in .rdata to BGM_304_SwitchtoOrig + if (const int INIoption = GetPrivateProfileIntW(L"SilentPatch", L"OriginalOst", 0, wcModulePath); INIoption == 1) + { + auto switchToLive = pattern("42 47 4D 5F 33 30 34 5F 53 77 69 74 63 68 74 6F 4C 69 76 65").count(1); //BGM_304_SwitchtoLive + if (switchToLive.size() == 1) + { + Patch(switchToLive.get_first(0x10), 0x6769724F); //"Orig" ASCII in little endian + } + } // Convert Shift-JIS texts to Unicode ShiftJISTexts::RedirectImports(); @@ -210,4 +221,4 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) hDLLModule = hinstDLL; } return TRUE; -} \ No newline at end of file +}