This decrypts and decompresses the sl2 files: {{{#!python import os, sys, zlib from rijndael import Rijndael from struct import unpack for fname in sys.argv[1:]: key = [0x04, 0x38, 0x04, 0x31, 0x2D, 0x32, 0x0C, 0x30, 0x43, 0x2E, 0x08, 0x04, 0x16, 0x30, 0x22, 0x0C] iv = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00] with open(fname, "rb") as f: with open(fname.replace(".sl2", "")+".txt", "wb") as f2: print(f"handling {fname}") rjn = Rijndael(key, block_size = 16) fdata = f.read() plaintext_len = unpack(">I", fdata[0x4C:0x50])[0] ciphertext_len = (plaintext_len//16) * 16 if ciphertext_len < plaintext_len: ciphertext_len += 16 data = fdata[0x50:ciphertext_len+0x50] decrypted = [] while len(data) >= 16: ciphertext = data[:16] plaintext = rjn.decrypt(ciphertext) for i in range(len(plaintext)): plaintext[i] ^= iv[i] decrypted += plaintext iv = ciphertext data = data[16:] decrypted = decrypted[:plaintext_len] if True: decompressed = zlib.decompress(bytes(decrypted)) string_len = unpack(">I", bytes(decompressed[0x2C:0x30]))[0] text = decompressed[0x30:0x30+string_len-1] f2.write(text) else: f2.write(bytes(decrypted)) }}} This parses them: {{{#!python import os, sys, json, re for fname in sys.argv[1:]: with open(fname, "r", encoding="cp932") as f: lines = [] parsing_if = -1 data = json.load(f) i = 0 while len(data[i:]) > 0: entry = data[i] if parsing_if == 1: if entry != "true": print(entry) print("^-- expected \"true\" block of if statement") exit() else: parsing_if = 2 i += 1 continue if parsing_if == 2: if entry == "false": parsing_if = 3 i += 1 continue if parsing_if == 3: if entry == "endif": parsing_if = -1 i += 1 continue if isinstance(entry, str): if entry == "_if": if parsing_if != -1: print("error: nested if statements not supported") parsing_if = 1 i += 2 continue if entry[0] in "_": # wild guess lol if len(data[i:]) > 1 and not isinstance(data[i+1], str): i += 2 else: i += 1 continue if entry[0] in "#": i += 1 continue if entry in ["ending"]: i += 1 continue if entry in ["false", "true", "endif"]: print("in: "+fname) print(parsing_if) print("") print(data[i-6]) print(data[i-5]) print(data[i-4]) print(data[i-3]) print(data[i-2]) print(data[i-1]) print(data[i] + " <---!!") print(data[i+1]) print(data[i+2]) print(data[i+3]) print(data[i+4]) print(data[i+5]) print(data[i+6]) exit() if entry[0] in "qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM_#": print(data[i-6]) print(data[i-5]) print(data[i-4]) print(data[i-3]) print(data[i-2]) print(data[i-1]) print(data[i] + " <---()") print(data[i+1]) print(data[i+2]) print(data[i+3]) print(data[i+4]) print(data[i+5]) print(data[i+6]) exit() lines += [entry] i += 1 else: print(entry) print("^-- unexpected list") exit() lastline = "" for line in lines: if line[0] != '/': if lastline.endswith("」"): lastline = re.sub(r"[^「]*(「.*」)", r"\1", lastline) print(lastline) lastline = line else: lastline += line[1:] #if line.endswith("」"): # line = }}} rijndael.py is here: https://gist.github.com/wareya/e00c80c9d346312354d45516978e3376