SDGB support + extras

This commit is contained in:
Keeboy99
2025-06-02 16:31:57 +12:00
parent 33b7db0e98
commit 02bfc7dba2
7 changed files with 55 additions and 5 deletions

View File

@ -606,9 +606,9 @@ class AllnetServlet:
return decrypted[16:].decode("utf-8") return decrypted[16:].decode("utf-8")
def enc_lite(self, key, iv, data): 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) cipher = AES.new(bytes(key), AES.MODE_CBC, iv)
encrypted = cipher.encrypt(decrypted) encrypted = cipher.encrypt(unencrypted)
return encrypted return encrypted
class BillingServlet: class BillingServlet:

View File

@ -8,6 +8,11 @@ Games listed below have been tested and confirmed working. Only game versions ol
+ 1.30 + 1.30
+ 1.35 + 1.35
+ CHUNITHM CHINA
+ NEW
+ 2024 (NEW)
+ 2024 (LUMINOUS)
+ CHUNITHM INTL + CHUNITHM INTL
+ SUPERSTAR + SUPERSTAR
+ SUPERSTAR PLUS + SUPERSTAR PLUS
@ -15,6 +20,8 @@ Games listed below have been tested and confirmed working. Only game versions ol
+ NEW PLUS + NEW PLUS
+ SUN + SUN
+ SUN PLUS + SUN PLUS
+ LUMINOUS
+ LUMINOUS PLUS
+ CHUNITHM JP + CHUNITHM JP
+ AIR + AIR
@ -43,7 +50,29 @@ Games listed below have been tested and confirmed working. Only game versions ol
+ Initial D THE ARCADE + Initial D THE ARCADE
+ Season 2 + 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 + maimai DX
+ DX
+ DX Plus
+ Splash + Splash
+ Splash Plus + Splash Plus
+ UNiVERSE + UNiVERSE

View File

@ -104,7 +104,7 @@ class ChuniServlet(BaseServlet):
f"{ChuniConstants.VER_CHUNITHM_NEW}_chn": 37, f"{ChuniConstants.VER_CHUNITHM_NEW}_chn": 37,
ChuniConstants.VER_CHUNITHM_NEW_PLUS: 25, ChuniConstants.VER_CHUNITHM_NEW_PLUS: 25,
f"{ChuniConstants.VER_CHUNITHM_NEW_PLUS}_int": 31, 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, ChuniConstants.VER_CHUNITHM_SUN: 70,
f"{ChuniConstants.VER_CHUNITHM_SUN}_int": 35, f"{ChuniConstants.VER_CHUNITHM_SUN}_int": 35,
ChuniConstants.VER_CHUNITHM_SUN_PLUS: 36, ChuniConstants.VER_CHUNITHM_SUN_PLUS: 36,
@ -268,9 +268,9 @@ class ChuniServlet(BaseServlet):
elif version >= 135: # LUMINOUS PLUS elif version >= 135: # LUMINOUS PLUS
internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS_PLUS internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS_PLUS
elif game_code == "SDHJ": # Chn elif game_code == "SDHJ": # Chn
if version < 110: # NEW!! if version < 110: # NEW
internal_ver = ChuniConstants.VER_CHUNITHM_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 internal_ver = ChuniConstants.VER_CHUNITHM_NEW_PLUS
elif version >= 120: # LUMINOUS elif version >= 120: # LUMINOUS
internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS internal_ver = ChuniConstants.VER_CHUNITHM_LUMINOUS

View File

@ -18,4 +18,5 @@ game_codes = [
Mai2Constants.GAME_CODE_GREEN, Mai2Constants.GAME_CODE_GREEN,
Mai2Constants.GAME_CODE, Mai2Constants.GAME_CODE,
Mai2Constants.GAME_CODE_DX_INT, Mai2Constants.GAME_CODE_DX_INT,
Mai2Constants.GAME_CODE_DX_CHN,
] ]

View File

@ -139,6 +139,9 @@ class Mai2Base:
async def handle_get_game_ng_music_id_api_request(self, data: Dict) -> Dict: async def handle_get_game_ng_music_id_api_request(self, data: Dict) -> Dict:
return {"length": 0, "musicIdList": []} 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: 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) game_charge_list = await self.data.static.get_enabled_tickets(self.version, 1)
if game_charge_list is None: if game_charge_list is None:

View File

@ -32,6 +32,7 @@ class Mai2Constants:
GAME_CODE_FINALE = "SDEY" GAME_CODE_FINALE = "SDEY"
GAME_CODE_DX = "SDEZ" GAME_CODE_DX = "SDEZ"
GAME_CODE_DX_INT = "SDGA" GAME_CODE_DX_INT = "SDGA"
GAME_CODE_DX_CHN = "SDGB"
CONFIG_NAME = "mai2.yaml" CONFIG_NAME = "mai2.yaml"

View File

@ -337,6 +337,20 @@ class Mai2Servlet(BaseServlet):
elif version >=150: elif version >=150:
internal_ver = Mai2Constants.VER_MAIMAI_DX_PRISM 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 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 # 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 # dealing with an encrypted request. False positives shouldn't happen
@ -403,6 +417,8 @@ class Mai2Servlet(BaseServlet):
endpoint = ( endpoint = (
endpoint.replace("MaimaiExp", "") endpoint.replace("MaimaiExp", "")
if game_code == Mai2Constants.GAME_CODE_DX_INT if game_code == Mai2Constants.GAME_CODE_DX_INT
else endpoint.replace("MaimaiChn", "")
if game_code == Mai2Constants.GAME_CODE_DX_CHN
else endpoint else endpoint
) )
func_to_find = "handle_" + inflection.underscore(endpoint) + "_request" func_to_find = "handle_" + inflection.underscore(endpoint) + "_request"