资源包内spine和NPC的live2d没有加密,给所有可抽取角色的assetbundle包进行了加密
又对比了一下一部分的spine也被加密了
开服的包没加密,夏活包改加密了
单纯的xor加密,key是37, 12, 178, 118, 37, 12, 178, 118, 37, 12, 178, 118, 37, 12, 178, 118,对前0xe0字节xor。
不太懂这个啊大佬
import sys
key = [37, 12, 178, 118, 37, 12, 178, 118, 37, 12, 178, 118, 37, 12, 178, 118]
if __name__ == '__main__':
path = sys.argv[1]
with open(path, 'rb') as f:
data = f.read()
data = bytearray(data)
for i in range(0xe0):
data[i] ^= key[i % len(key)]
with open(f"{path}", 'wb') as f:
f.write(data)
這個遊戲這邊今年6月解過,實際上他每個資料夾內都是不同的xor key。至於解密長度"根據最新版的測試-從208到224之間都有,雖然大多數文件落在220"。暫時只能一個一個嘗試
當時的解密腳本
import os
def xor_decrypt(data, key):
decrypted_data = bytearray()
key_len = len(key)
for i, byte in enumerate(data):
decrypted_data.append(byte ^ key[i % key_len])
return decrypted_data
def process_folder(folder_path):
for root, dirs, files in os.walk(folder_path):
for file in files:
if file.lower().endswith(“.dat”):
file_path = os.path.join(root, file)
with open(file_path, ‘rb’) as file:
unity_data = bytearray(file.read())
k1 = unity_data[:4]
key = bytearray.fromhex("55 6E 69 74")
k2 = xor_decrypt(k1, key)
decrypted_unity_data = xor_decrypt(unity_data[:220], k2)
new_decrypted_data = decrypted_unity_data + unity_data[220:]
with open(file_path, 'wb') as file:
file.write(new_decrypted_data)
print(f"Decrypted and overwritten {file_path}")
if name == “main”:
folder_path = input("Enter the folder path to process: ")
process_folder(folder_path)
儘管如此,還是有無法加密回去的問題,除非另導出k1與檔名之對應值
感谢回复