|
|
|
@ -5,6 +5,7 @@
|
|
|
|
|
|
|
|
|
|
# 2.0 - Python 3 for calibre 5.0
|
|
|
|
|
# 2.1 - Some fixes for debugging
|
|
|
|
|
# 2.1.1 - Whitespace!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
@ -67,7 +68,7 @@ class KFXZipBook:
|
|
|
|
|
print("Decrypting KFX DRM voucher: {0}".format(info.filename))
|
|
|
|
|
|
|
|
|
|
for pid in [''] + totalpids:
|
|
|
|
|
# Belt and braces. PIDs should be unicode strings, but just in case...
|
|
|
|
|
# Belt and braces. PIDs should be unicode strings, but just in case...
|
|
|
|
|
if isinstance(pid, bytes):
|
|
|
|
|
pid = pid.decode('ascii')
|
|
|
|
|
for dsn_len,secret_len in [(0,0), (16,0), (16,40), (32,40), (40,0), (40,40)]:
|
|
|
|
@ -82,8 +83,8 @@ class KFXZipBook:
|
|
|
|
|
voucher.decryptvoucher()
|
|
|
|
|
break
|
|
|
|
|
except:
|
|
|
|
|
traceback.print_exc()
|
|
|
|
|
pass
|
|
|
|
|
traceback.print_exc()
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
raise Exception("Failed to decrypt KFX DRM voucher with any key")
|
|
|
|
|
|
|
|
|
|