From 045d6f760070413d1a5981db82eca55c874b995f Mon Sep 17 00:00:00 2001 From: esuo1198 <54134.es@gmail.com> Date: Thu, 21 Mar 2024 15:55:08 +0900 Subject: [PATCH] Add country_code to config.toml --- dist/config.toml | 1 + src/dllmain.cpp | 36 +++++++++++++++++++++--------------- src/patches/amauth.cpp | 10 ++++++---- 3 files changed, 28 insertions(+), 19 deletions(-) diff --git a/dist/config.toml b/dist/config.toml index f3699fd..6ba34a5 100644 --- a/dist/config.toml +++ b/dist/config.toml @@ -4,6 +4,7 @@ port = "54430" chassis_id = "284111080000" shop_id = "TAIKO ARCADE LOADER" game_ver = "00.00" +country_code = "JPN" [patches] version = "auto" diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 410cb6f..9a7fa84 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -7,16 +7,18 @@ GameVersion gameVersion = GameVersion::UNKNOWN; std::vector plugins; -const char *server = "127.0.0.1"; -const char *port = "54430"; -const char *chassisId = "284111080000"; -const char *shopId = "TAIKO ARCADE LOADER"; -const char *gameVerNum = "00.00"; -char fullAddress[256] = {'\0'}; -char accessCode1[21] = "00000000000000000001"; -char accessCode2[21] = "00000000000000000002"; -char chipId1[33] = "00000000000000000000000000000001"; -char chipId2[33] = "00000000000000000000000000000002"; +const char *server = "127.0.0.1"; +const char *port = "54430"; +const char *chassisId = "284111080000"; +const char *shopId = "TAIKO ARCADE LOADER"; +const char *gameVerNum = "00.00"; +const char *countryCode = "JPN"; +char fullAddress[256] = {'\0'}; +char placeId[16] = {'\0'}; +char accessCode1[21] = "00000000000000000001"; +char accessCode2[21] = "00000000000000000002"; +char chipId1[33] = "00000000000000000000000000000001"; +char chipId2[33] = "00000000000000000000000000000002"; HOOK (i32, ShowMouse, PROC_ADDRESS ("user32.dll", "ShowCursor"), bool) { return originalShowMouse (true); } HOOK (i32, ExitWindows, PROC_ADDRESS ("user32.dll", "ExitWindowsEx")) { @@ -104,15 +106,19 @@ DllMain (HMODULE module, DWORD reason, LPVOID reserved) { if (config) { auto amauth = openConfigSection (config, "amauth"); if (amauth) { - server = readConfigString (amauth, "server", server); - port = readConfigString (amauth, "port", port); - chassisId = readConfigString (amauth, "chassis_id", chassisId); - shopId = readConfigString (amauth, "shop_id", shopId); - gameVerNum = readConfigString (amauth, "game_ver", gameVerNum); + server = readConfigString (amauth, "server", server); + port = readConfigString (amauth, "port", port); + chassisId = readConfigString (amauth, "chassis_id", chassisId); + shopId = readConfigString (amauth, "shop_id", shopId); + gameVerNum = readConfigString (amauth, "game_ver", gameVerNum); + countryCode = readConfigString (amauth, "country_code", countryCode); std::strcat (fullAddress, server); std::strcat (fullAddress, ":"); std::strcat (fullAddress, port); + + std::strcat (placeId, countryCode); + std::strcat (placeId, "0FF0"); } auto patches = openConfigSection (config, "patches"); if (patches) version = readConfigString (patches, "version", version); diff --git a/src/patches/amauth.cpp b/src/patches/amauth.cpp index 45dcda1..3ad9ca4 100644 --- a/src/patches/amauth.cpp +++ b/src/patches/amauth.cpp @@ -21,7 +21,9 @@ extern const char *port; extern const char *chassisId; extern const char *shopId; extern const char *gameVerNum; +extern const char *countryCode; extern char fullAddress[256]; +extern char placeId[16]; namespace patches::AmAuth { const GUID IID_CAuth{0x045A5150, 0xD2B3, 0x4590, {0xA3, 0x8B, 0xC1, 0x15, 0x86, 0x78, 0xE1, 0xAC}}; @@ -434,9 +436,9 @@ public: strcpy_s (resp->region_name1, "X"); strcpy_s (resp->region_name2, "Y"); strcpy_s (resp->region_name3, "Z"); - strcpy_s (resp->place_id, "JPN0FFF0"); + strcpy_s (resp->place_id, placeId); strcpy_s (resp->setting, ""); - strcpy_s (resp->country, "JPN"); + strcpy_s (resp->country, countryCode); strcpy_s (resp->timezone, "+0900"); strcpy_s (resp->res_class, "PowerOnResponseVer3"); return 0; @@ -465,8 +467,8 @@ public: strcpy_s (arr->shop_name_en, sizeof (arr->shop_name_en), shopId); strcpy_s (arr->shop_nickname, sizeof (arr->shop_nickname), shopId); strcpy_s (arr->shop_nickname_en, sizeof (arr->shop_nickname_en), shopId); - strcpy_s (arr->place_id, sizeof (arr->place_id), "JPN0FFF0"); - strcpy_s (arr->country_cd, sizeof (arr->country_cd), "JPN"); + strcpy_s (arr->place_id, sizeof (arr->place_id), placeId); + strcpy_s (arr->country_cd, sizeof (arr->country_cd), countryCode); strcpy_s (arr->area0, sizeof (arr->area0), "008"); strcpy_s (arr->area0_en, sizeof (arr->area0_en), "008");