有大佬知道叫我大掌柜这种图片加密的应该怎么解开吗

解压后有图片,但是被加密了,是需要找到密钥解密吗



image

1 个赞

sign 为lyqszp 然后异或0x70就可以了 pkm文件还需再进行一次gzip解压 代码如下

import  os
import gzip

def xor_decrypt(path):
    for root, dirs, files in os.walk(path):
        for file in files:
            file_path = os.path.join(root,file)
            with open(file_path, 'rb') as file:
                encrypted_data = file.read()
                if encrypted_data[0:6] == b'lyqszp':
                   decrypt_data = bytes([byte ^ 0x70 for byte in encrypted_data])
                   with open(file_path, 'wb') as file:
                        file.write(decrypt_data[6:])
                        print("正在解密文件",file.name)
    for root, dirs, files in os.walk(path):
        for file in files:
            if file.endswith('pkm'):
                file_path = os.path.join(root, file)
                with open(file_path, 'rb') as file:
                    decompress = gzip.decompress(file.read())
                with open(file_path, 'wb') as file:
                    file.write(decompress)
                    print("正在解压文件",file.name)


if __name__ == '__main__':
    path = r"C:\Users\zjbook\Desktop\新建文件夹 (14)\res"
    xor_decrypt(path)

解完后是uuid形式 还原思路参考有什么方法能从cocos creator构建的游戏里还原出live2d或spine动画资源?

1 个赞

感谢大佬,我去试试