性界大战cocos游戏解密

https://h5.game-app543.com/game/detail/285

尝试使用签名范围搜索密钥

签名 xjdzEncrypt

密钥 xjdzaabbccddeeffgghh

但是xxtea无法解密

这种js引擎的需要使用索引文件但是我没有在res文件夹下找到任何config文件

import os
HEADER = b"xjdzEncrypt"
KEY = b"xjdzaabbccddeeffgghh"
KEY_LEN = len(KEY)
def decrypt_file(file_path):
    try:
        with open(file_path, "rb") as f:
            data = f.read()
        if len(data) < len(HEADER):
            return

        if not data.startswith(HEADER):
            return

        encrypted = data[len(HEADER):]
        decrypted = bytearray(len(encrypted))
        for i in range(len(encrypted)):
            decrypted[i] = encrypted[i] ^ KEY[i % KEY_LEN]
        with open(file_path, "wb") as f:
            f.write(decrypted)

        print(f"[Y] {file_path}")

    except Exception as e:
        print(f"[-N-] {file_path} -> {e}")

def decrypt_directory(root_dir):
    for root, dirs, files in os.walk(root_dir):
        for name in files:
            file_path = os.path.join(root, name)
            decrypt_file(file_path)

decrypt_directory(r'69ba8af2561df4.74886084-spj2-2020318-release-v1.0.0.9\assets\res')

交叉引用一下就能看到其实是异或
我也没找到config文件倒是main.js没加密
包含一段

    // init assets
    cc.AssetLibrary.init({
        libraryPath: 'res/import',
        rawAssetsBase: 'res/raw-',
        rawAssets: settings.rawAssets,
        packedAssets: settings.packedAssets,
        md5AssetsMap: settings.md5AssetsMap,
        subpackages: settings.subpackages
    });

没见过

1 个赞