2016-09-18 146 views
-1

我寫了使用win32crypt的代碼。當我在Python IDLE中運行時,沒有任何問題。我獲得了我需要的所有數據。 但是,當我轉換爲.exe並執行它,我沒有得到任何結果。我得到這個錯誤Python to exe win32crypt CryptProtectData錯誤

Traceback (most recent call last): File "chromeHack.py", line 22, in pywintypes.error: (998, 'CryptProtectData', '\xcd\xe5\xe2\xe5\xf0\xed\xe0\xff \xef\xee\xef\xfb\xf2\xea\xe0 \xe4\xee\xf1\xf2\xf3\xef\xe0 \xea \xe0\xe4\xf0\xe5\xf1\xf3 \xef\xe0\xec\xff\xf2\xe8.')

線22

password = win32crypt.CryptUnprotectData(raw[2])[1] 
fileOut.write(password + '\n') 

.exe文件無法使用Windows密碼來解密數據。我試圖以管理員身份運行,但結果相同。

回答

1

在將代碼更改爲exe之前,您必須在系統命令(windows?cmd:shell)中運行以測試代碼。

結果告訴您使用win32crypt.CryptUnprotectData後返回的值不正確。

正確的用法: win32crypt.CryptUnprotectData