Skip to content

Commit

Permalink
Update SilentPatchW101.cpp
Browse files Browse the repository at this point in the history
Added initial implementation of the OST change functionality
  • Loading branch information
Banz99 authored Jul 17, 2020
1 parent df2b7d2 commit a489aea
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 a489aea

Please # to comment.