From 0fa8fe06f0fde03be22b0d3ca86f920f997799ca Mon Sep 17 00:00:00 2001 From: Kevin Trocolli Date: Thu, 9 Nov 2023 21:17:18 -0500 Subject: [PATCH] sao: fix crypt maybe --- titles/sao/index.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/titles/sao/index.py b/titles/sao/index.py index 84256fa..9d40e21 100644 --- a/titles/sao/index.py +++ b/titles/sao/index.py @@ -135,7 +135,9 @@ class SaoServlet(BaseServlet): cipher = Blowfish.new(self.game_cfg.crypt.key.encode(), Blowfish.MODE_CBC, iv) data_crypt = cipher.encrypt(data_to_crypt) - resp = resp[:24] + iv + data_crypt + crypt_data_len = len(data_crypt) + tmp = struct.pack("!I", crypt_data_len) # does it want the length of the encrypted response?? + resp = resp[:20] + tmp + iv + data_crypt self.logger.debug(f"Encrypted Response: {resp.hex()}") return resp \ No newline at end of file