yxhsea / mock_login

模拟登录
33 stars 16 forks source link

显示pako未定义怎么办 ,想用execjs执行 #2

Open waitfortea opened 1 year ago

waitfortea commented 1 year ago

显示pako未定义怎么办 ,想用execjs执行

waitfortea commented 1 year ago
def decrypt(self, encryptedContent):
    with open('./js/aes.js', 'r', encoding='UTF-8') as f:
        aes_js = f.read()
    with open('./js/mode-ecb.js', 'r', encoding='UTF-8') as f:
        mode_ecb_js = f.read()
    with open('./js/pako.js', 'r', encoding='UTF-8') as f:
        pako_js = f.read()
    with open('./js/chan.js', 'r', encoding='UTF-8') as f:
        chan_js = f.read()

    ctx = execjs.compile(aes_js + mode_ecb_js + pako_js + chan_js)
    result = ctx.call("decryption", encryptedContent)

    return json.loads(result)
shouge commented 3 months ago

不需要这么麻烦 直接采用python就能解密了