[已解決]求助大佬们我的御剑日记这些档案的解密方法

from pathlib import Path
import ujson

Path('atlas').mkdir(exist_ok=True)
data = ujson.load(open('./spines-atlas.json',encoding='utf-8'))
atlas = data.get('atlas')
for i in atlas:
    frames = i.get('frames')
    atlas_name = i.get('name')
    width = i.get('width')
    height = i.get('height')
    name = '\n' + atlas_name + '\n'
    size = f'size: {width},{height}\n'
    _format = 'format: RGBA8888\n'
    _filter = 'filter: Linear,Linear\n'
    _repeat = 'repeat: none\n'
    content = []
    for frame in frames:
        f_name = frame.get('name')
        rotate = '  rotate:' + str(frame.get('rotate', 0))
        x = frame.get('x', 0)
        y = frame.get('y', 0)
        xy = f'  xy: {x},{y}\n'
        w = frame.get('width', 0)
        h = frame.get('height', 0)
        _size = f'  size: {w},{h}\n'
        orig_w = frame.get('orig_width', 0)
        orig_h = frame.get('orig_height', 0)
        orig = f'  orig: {orig_w},{orig_h}\n'
        offx = frame.get('offx', 0)
        offy = frame.get('offy', 0)
        offset = f'  offset: {offx},{offy}\n'
        index = '  index: -1\n'
        content.append(f'{f_name}\n{rotate}\n{xy}{_size}{orig}{offset}{index}')
    content = name+size+_format+_filter+_repeat+''.join(content)
    file = Path(f"atlas/{Path(atlas_name).with_suffix('.atlas')}").write_bytes(content.encode('utf-8'))

应该没问题了,解密和atlas处理都有了。文件名还原就普通的cocos,还是很标准的

from pathlib import Path
from concurrent.futures import ThreadPoolExecutor

code = [
    0x11, 0x2B, 0x65, 0x78, 0x17, 0xC, 0xD, 0x17, 0x15,0x35, 0x62, 0x65, 0x7B, 0x62, 0x15, 0x7F, 0x11, 0x2C,0x63, 0x17, 0x4D, 0x57, 0xC, 0x59, 0xB, 0x20, 0x65,0x21, 0x20, 0x63, 0xC, 0x7F, 0x12, 0x75, 4, 0xA, 0xC
    ,0x7B, 0x15, 0x10, 0x21, 0x36, 0x37, 0x1B, 0x23, 0x65,0x64, 0xB, 0xF, 0x47, 0x2F, 0x5A, 0x24, 0x11, 0x59,0x41, 0x4C, 0x5B, 0x21, 0x66, 0x5A, 0x31, 0x40, 0x51,0x7E, 0xD, 0x15, 0x43, 0x2D, 0x27, 0x58, 0x51, 0xF
    ,0x57, 0x15, 0x13, 0x24, 0x14, 0xE, 0x2B, 0x25, 0x16,0x1F, 0xE, 0x4E, 0xE, 0x3F, 0x29, 0x42, 0x52, 0x10,0x29, 0xF, 0x69, 0x65, 0x49, 0x1C, 0x20, 0x42, 0x54,0x22, 0x3D, 0x4A, 7, 0x37, 0x4D, 0x11, 0x63, 0x69,
    0x65, 0x13, 0x4A, 0x2D, 0x2D, 0x4B, 0x41, 0x59, 0xE,0x73, 0x24, 0x4E, 0x15, 0x62, 0x77, 0x10, 0x32, 0x3C,0x46, 0x50, 0x5A, 0x64, 0x6E
]
def decrypt(path):
    try:
        f = open(path,"rb")
        info = bytearray(f.read()) 
        f.close()
        size = len(info)
        if size >= 2 and info[0:2] == b"AB":
            v5 = info[0]
            v6 = info
            v7 = size
            v9 = info[5] | (info[4] << 8)
            v10 = (info[11] | (info[10] << 8) | (v9 << 16)) % (info[15] | (info[14] << 8)) + (info[11] | (info[10] << 8) | (v9 << 16))
            v11 = (v6[13] | ((v6[3] | (v6[2] << 8)) << 16) | (v6[12] << 8))
            v12 = v11 % 3
            if not(v10 & 3):
                v12 = 3
            if v10 >= v7:
                v10 = v7
            if v10 >= 1:
                v13 = 0
                while v13 < v10:
                    v6[v11 + 16 + v13] ^= code[33 * v12 + (v11 + v13) % 33]
                    v13 += 1
            f = open(path,'wb')
            f.write(v6[16:])
            f.close()
            print(path,'\t out done')
    except:
        return

with ThreadPoolExecutor() as pool:
    results = pool.map(decrypt,Path('./out').rglob('*'))
input('all done')

附上解密,和lz的功能相同

再友情提醒下,b服特么比官服多一堆东西,绝了