From 02bfc7dba250e4d85bc7d0bbbce6aaa8b068c1b7 Mon Sep 17 00:00:00 2001 From: Keeboy99 <67620144+Keeboy99@users.noreply.github.com> Date: Mon, 2 Jun 2025 16:31:57 +1200 Subject: [PATCH] SDGB support + extras --- core/allnet.py | 4 ++-- readme.md | 29 +++++++++++++++++++++++++++++ titles/chuni/index.py | 6 +++--- titles/mai2/__init__.py | 1 + titles/mai2/base.py | 3 +++ titles/mai2/const.py | 1 + titles/mai2/index.py | 16 ++++++++++++++++ 7 files changed, 55 insertions(+), 5 deletions(-) diff --git a/core/allnet.py b/core/allnet.py index 7cd9b43..94b34ab 100644 --- a/core/allnet.py +++ b/core/allnet.py @@ -606,9 +606,9 @@ class AllnetServlet: return decrypted[16:].decode("utf-8") def enc_lite(self, key, iv, data): - decrypted = pad(bytes([0] * 16) + data.encode('utf-8'), 16) + unencrypted = pad(bytes([0] * 16) + data.encode('utf-8'), 16) cipher = AES.new(bytes(key), AES.MODE_CBC, iv) - encrypted = cipher.encrypt(decrypted) + encrypted = cipher.encrypt(unencrypted) return encrypted class BillingServlet: diff --git a/readme.md b/readme.md index e29784d..8591c74 100644 --- a/readme.md +++ b/readme.md @@ -8,6 +8,11 @@ Games listed below have been tested and confirmed working. Only game versions ol + 1.30 + 1.35 ++ CHUNITHM CHINA + + NEW + + 2024 (NEW) + + 2024 (LUMINOUS) + + CHUNITHM INTL + SUPERSTAR + SUPERSTAR PLUS @@ -15,6 +20,8 @@ Games listed below have been tested and confirmed working. Only game versions ol + NEW PLUS + SUN + SUN PLUS + + LUMINOUS + + LUMINOUS PLUS + CHUNITHM JP + AIR @@ -43,7 +50,29 @@ Games listed below have been tested and confirmed working. Only game versions ol + Initial D THE ARCADE + Season 2 ++ maimai DX CHINA + + DX (Muji) + + 2021 (Muji) + + 2022 (Muji) + + 2023 (FESTiVAL) + + 2024 (BUDDiES) + ++ maimai DX INTL + + DX + + DX Plus + + Splash + + Splash Plus + + UNiVERSE + + UNiVERSE PLUS + + FESTiVAL + + FESTiVAL PLUS + + BUDDiES + + BUDDiES PLUS + + PRiSM + + maimai DX + + DX + + DX Plus + Splash + Splash Plus + UNiVERSE diff --git a/titles/chuni/index.py b/titles/chuni/index.py index ad51bb0..1392588 100644 --- a/titles/chuni/index.py +++ b/titles/chuni/index.py @@ -104,7 +104,7 @@ class ChuniServlet(BaseServlet): f"{ChuniConstants.VER_CHUNITHM_NEW}_chn": 37, ChuniConstants.VER_CHUNITHM_NEW_PLUS: 25, f"{ChuniConstants.VER_CHUNITHM_NEW_PLUS}_int": 31, - f"{ChuniConstants.VER_CHUNITHM_NEW_PLUS}_chn": 35, + f"{ChuniConstants.VER_CHUNITHM_NEW_PLUS}_chn": 35, # NEW ChuniConstants.VER_CHUNITHM_SUN: 70, f"{ChuniConstants.VER_CHUNITHM_SUN}_int": 35, ChuniConstants.VER_CHUNITHM_SUN_PLUS: 36, @@ -268,9 +268,9 @@ class ChuniServlet(BaseServlet): elif version >= 135: # LUMINOUS PLUS internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS_PLUS elif game_code == "SDHJ": # Chn - if version < 110: # NEW!! + if version < 110: # NEW internal_ver = ChuniConstants.VER_CHUNITHM_NEW - elif version >= 110 and version < 120: # NEW PLUS!! + elif version >= 110 and version < 120: # NEW *Cursed but needed due to different encryption key internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS elif version >= 120: # LUMINOUS internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS diff --git a/titles/mai2/__init__.py b/titles/mai2/__init__.py index 234e864..4c1739d 100644 --- a/titles/mai2/__init__.py +++ b/titles/mai2/__init__.py @@ -18,4 +18,5 @@ game_codes = [ Mai2Constants.GAME_CODE_GREEN, Mai2Constants.GAME_CODE, Mai2Constants.GAME_CODE_DX_INT, + Mai2Constants.GAME_CODE_DX_CHN, ] diff --git a/titles/mai2/base.py b/titles/mai2/base.py index 5d1c767..1983ef7 100644 --- a/titles/mai2/base.py +++ b/titles/mai2/base.py @@ -139,6 +139,9 @@ class Mai2Base: async def handle_get_game_ng_music_id_api_request(self, data: Dict) -> Dict: return {"length": 0, "musicIdList": []} + async def handle_get_game_ng_word_list_api_request(self, data: Dict) -> Dict: + return {"ngWordExactMatchLength": 0, "ngWordExactMatchList": [], "ngWordPartialMatchLength": 0, "ngWordPartialMatchList": []} + async def handle_get_game_charge_api_request(self, data: Dict) -> Dict: game_charge_list = await self.data.static.get_enabled_tickets(self.version, 1) if game_charge_list is None: diff --git a/titles/mai2/const.py b/titles/mai2/const.py index 99642b2..47e5cbd 100644 --- a/titles/mai2/const.py +++ b/titles/mai2/const.py @@ -32,6 +32,7 @@ class Mai2Constants: GAME_CODE_FINALE = "SDEY" GAME_CODE_DX = "SDEZ" GAME_CODE_DX_INT = "SDGA" + GAME_CODE_DX_CHN = "SDGB" CONFIG_NAME = "mai2.yaml" diff --git a/titles/mai2/index.py b/titles/mai2/index.py index d8e2a4f..d59ce87 100644 --- a/titles/mai2/index.py +++ b/titles/mai2/index.py @@ -337,6 +337,20 @@ class Mai2Servlet(BaseServlet): elif version >=150: internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM + elif game_code == "SDGB": # Chn + if version < 110: # Muji + internal_ver = Mai2Constants.VER_MAIMAI_DX + elif version >= 110 and version < 120: # Muji + internal_ver = Mai2Constants.VER_MAIMAI_DX + elif version >= 120 and version < 130: # Muji (LMAO) + internal_ver = Mai2Constants.VER_MAIMAI_DX + elif version >= 130 and version < 140: # FESTiVAL + internal_ver = Mai2Constants.VER_MAIMAI_DX_FESTIVAL + elif version >= 140 and version < 150: # BUDDiES + internal_ver = Mai2Constants.VER_MAIMAI_DX_BUDDIES + elif version >=150: + internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM + if all(c in string.hexdigits for c in endpoint) and len(endpoint) == 32: # If we get a 32 character long hex string, it's a hash and we're # dealing with an encrypted request. False positives shouldn't happen @@ -403,6 +417,8 @@ class Mai2Servlet(BaseServlet): endpoint = ( endpoint.replace("MaimaiExp", "") if game_code == Mai2Constants.GAME_CODE_DX_INT + else endpoint.replace("MaimaiChn", "") + if game_code == Mai2Constants.GAME_CODE_DX_CHN else endpoint ) func_to_find = "handle_" + inflection.underscore(endpoint) + "_request"