diff --git a/README.md b/README.md index d9c2a81..04fb78d 100644 --- a/README.md +++ b/README.md @@ -50,6 +50,10 @@ unlock_songs = true # enable ai soshina mode mode_collabo026 = false + [patches.jpn39] + # use cn font and chineseS wordlist value + chs_patch = false + [audio] # wasapi shared mode # allows you to have multiple audio sources at once at a cost of having higher latency diff --git a/dist/config.toml b/dist/config.toml index 8677ce1..ce0da8f 100644 --- a/dist/config.toml +++ b/dist/config.toml @@ -16,6 +16,9 @@ unlock_songs = true mode_collabo025 = false mode_collabo026 = false + [patches.jpn39] + chs_patch = false + [graphics] res = { x = 1920, y = 1080 } windowed = false diff --git a/src/patches/versions/CHN00.cpp b/src/patches/versions/CHN00.cpp index 5479e8a..c16bf6d 100644 --- a/src/patches/versions/CHN00.cpp +++ b/src/patches/versions/CHN00.cpp @@ -130,7 +130,7 @@ Init () { unlockSongs = readConfigBool (patches, "unlock_songs", unlockSongs); auto chn00 = openConfigSection (patches, "chn00"); if (chn00) { - fixLanguage = readConfigBool (chn00, "fix_language", fixLanguage); + fixLanguage = readConfigBool (chn00, "fix_language", fixLanguage); demoMovie = readConfigBool (chn00, "demo_movie", demoMovie); modeCollabo025 = readConfigBool (chn00, "mode_collabo025", modeCollabo025); modeCollabo026 = readConfigBool (chn00, "mode_collabo026", modeCollabo026); diff --git a/src/patches/versions/JPN39.cpp b/src/patches/versions/JPN39.cpp index c414f9e..b3ea742 100644 --- a/src/patches/versions/JPN39.cpp +++ b/src/patches/versions/JPN39.cpp @@ -1,6 +1,7 @@ #include "../patches.h" #include "helpers.h" #include +#include namespace patches::JPN39 { @@ -40,17 +41,33 @@ ReplaceLeaBufferAddress (const std::vector &bufferAddresses, void *ne } } +SafetyHookMid changeLanguageTypeHook{}; + +void +ChangeLanguageType(SafetyHookContext& ctx) { + int* pFontType = (int *) ctx.rax; + printf("---- saftyhook 2 fontType = %d\n", *pFontType); + if (*pFontType == 4) *pFontType = 2; +} + void Init () { i32 xRes = 1920; i32 yRes = 1080; bool unlockSongs = true; + bool chsPatch = false; auto configPath = std::filesystem::current_path () / "config.toml"; std::unique_ptr config_ptr (openConfig (configPath), toml_free); if (config_ptr) { auto patches = openConfigSection (config_ptr.get (), "patches"); - if (patches) unlockSongs = readConfigBool (patches, "unlock_songs", unlockSongs); + if (patches) { + unlockSongs = readConfigBool (patches, "unlock_songs", unlockSongs); + auto jpn39 = openConfigSection (patches, "jpn39"); + if (jpn39) { + chsPatch = readConfigBool (jpn39, "chs_patch", chsPatch); + } + } auto graphics = openConfigSection (config_ptr.get (), "graphics"); if (graphics) { @@ -115,6 +132,16 @@ Init () { ReplaceLeaBufferAddress (datatableBuffer3Addresses, datatableBuffer3.data ()); } + if (chsPatch) { + WRITE_MEMORY (ASLR (0x140CD1AE0), char, "cn_64"); + WRITE_MEMORY (ASLR (0x140CD1AF0), char, "cn_32"); + WRITE_MEMORY (ASLR (0x140CD1AF8), char, "cn_30"); + WRITE_MEMORY (ASLR (0x140C946A0), char, "chineseSText"); + WRITE_MEMORY (ASLR (0x140C946B0), char, "chineseSFontType"); + + changeLanguageTypeHook = safetyhook::create_mid (ASLR (0x1400B2016), ChangeLanguageType); + } + // Disable live check auto amHandle = (u64)GetModuleHandle ("AMFrameWork.dll"); INSTALL_HOOK_DYNAMIC (AMFWTerminate, (void *)(amHandle + 0x42DE0)); @@ -137,4 +164,4 @@ Init () { patches::Qr::Init (); patches::AmAuth::Init (); } -} // namespace patches::JPN39 \ No newline at end of file +} // namespace patches::JPN39