求助大佬,七龙珠H版怎么解密

有加密,不会解,求大佬们指点一下





这个是游戏APK安装包
通过网盘分享的文件:base.apk
链接: https://pan.baidu.com/s/1gNIbm1YGXL6rf_klBZdn-g?pwd=8b3s 提取码: 8b3s

加密的样版spine文件
spine.zip (883.6 KB)

image
strings搜索文件头交叉引用后在调用函数内可以发现调用了EVP_CipherInit_ex
是openssl库的一个函数用于aes操作

/**
函数作用:初始化密码上下文ctx
ctx  : 由 EVP_CIPHER_CTX_new() 创建
type : 使用的算法类型,例如:EVP_aes_256_cbc()、EVP_aes_128_cbc()
impl :密码类型,如果impl为 NULL,则使用默认实现。一般都设置为NULL
key  : 加密密钥
iv   : 偏移量
enc  : 1 - 加密;0 - 解密
**/
int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *type, ENGINE *impl, const unsigned char *key, const unsigned char *iv, int enc);

那么得到密钥

unsigned char unk_1D03FF7[] =
{
  0x01, 0x02, 0xFF, 0xAB, 0x45, 0x67, 0x89, 0x00, 0x23, 0x34, 
  0x12, 0x56, 0x78, 0x9A, 0xBC, 0xDE
};

这里看到的iv向量似乎是0写一个脚本试试解密(忽略文件头前13个字节)

参考解密脚本

import os
from Crypto.Cipher import AES
from Crypto.Util.Padding import unpad

AES_KEY = bytes([
    0x01, 0x02, 0xFF, 0xAB, 0x45, 0x67, 0x89, 0x00,
    0x23, 0x34, 0x12, 0x56, 0x78, 0x9A, 0xBC, 0xDE
])

TARGET_DIR = r"C:\Users\xxx\Downloads\base"  # 替换为你的目标目录

def is_encrypted_file(file_data):
    return file_data.startswith(b"ENCRYPTED_AES")

def decrypt_file(file_path):
    with open(file_path, "rb") as f:
        encrypted_data = f.read()

    if not is_encrypted_file(encrypted_data):
        print(f"[跳过] {file_path} 不是加密文件")
        return False
        
    encrypted_data = encrypted_data[13:]
    cipher = AES.new(AES_KEY, AES.MODE_ECB)

    try:
        decrypted_data = unpad(cipher.decrypt(encrypted_data), AES.block_size)
    except ValueError:
        decrypted_data = cipher.decrypt(encrypted_data)
    with open(file_path, "wb") as f:
        f.write(decrypted_data)

    print(f"[解密成功] {file_path}")
    return True

def decrypt_all_files_in_directory(directory):
    for root, _, files in os.walk(directory):
        for file in files:
            file_path = os.path.join(root, file)
            try:
                decrypt_file(file_path)
            except Exception as e:
                print(f"[错误] 解密 {file_path} 失败: {e}")

if __name__ == "__main__":
    decrypt_all_files_in_directory(TARGET_DIR)
    print("解密完成!")
2 个赞

CG有点眼熟估计也是从龙之女扣过来换皮的
(离谱的要死大部分cocos的黄油cg都是从这扣完换皮)

感谢大佬热心的回答成功解包
D9D1931275627F8CB397A57D53273F8C