解压后有图片,但是被加密了,是需要找到密钥解密吗
![image](https://live2dhub.com/uploads/default/original/2X/b/bbd3efb5476caa1831c5bbf4dcb8357a9348a53e.png)
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动画资源?
感谢大佬,我去试试