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动画资源?