Skip to content

Commit

Permalink
Merge pull request #3 from Banz99/patch-1
Browse files Browse the repository at this point in the history
Allow .ini setting to change OST
  • Loading branch information
CookiePLMonster authored Jul 17, 2020
2 parents df2b7d2 + a489aea commit 4131a9e
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions source/SilentPatchW101.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,18 @@ void OnInitializeHook()
Patch<uint8_t>( noFL.get_first<void>( 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<uint32_t>(switchToLive.get_first<void>(0x10), 0x6769724F); //"Orig" ASCII in little endian
}
}

// Convert Shift-JIS texts to Unicode
ShiftJISTexts::RedirectImports();
Expand All @@ -210,4 +221,4 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
hDLLModule = hinstDLL;
}
return TRUE;
}
}

0 comments on commit 4131a9e

Please # to comment.