summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoDRM <[email protected]>2022-03-18 17:45:07 +0100
committerNoDRM <[email protected]>2022-03-18 17:45:07 +0100
commita4689f6ac0af8494c622c8bee3f8866ec028755f (patch)
treed912d7ed1210c5aae8591c12e3d3238dc9491eae
parent82a698edf65630b203f67b7b03acb2fc20f93836 (diff)
Make B&N plugin skip invalid hashes in Windows app
-rw-r--r--DeDRM_plugin/ignoblekeyWindowsStore.py14
1 files changed, 9 insertions, 5 deletions
diff --git a/DeDRM_plugin/ignoblekeyWindowsStore.py b/DeDRM_plugin/ignoblekeyWindowsStore.py
index f22d64d..886c7cd 100644
--- a/DeDRM_plugin/ignoblekeyWindowsStore.py
+++ b/DeDRM_plugin/ignoblekeyWindowsStore.py
@@ -13,6 +13,7 @@ https://github.com/noDRM/DeDRM_tools/discussions/9
import sys, os
import apsw
import base64
+import traceback
try:
from Cryptodome.Cipher import AES
from Cryptodome.Util.Padding import unpad
@@ -56,11 +57,14 @@ def dump_keys(print_result=False):
decrypted_hashes = []
for pass_hash in activation_xml.findall(".//{http://ns.adobe.com/adept}passHash"):
- encrypted_cc_hash = base64.b64decode(pass_hash.text)
- cc_hash = unpad(AES.new(hash_key, AES.MODE_CBC, encrypted_cc_hash[:16]).decrypt(encrypted_cc_hash[16:]), 16)
- decrypted_hashes.append((base64.b64encode(cc_hash).decode("ascii")))
- if print_result:
- print("Nook ccHash is %s" % (base64.b64encode(cc_hash).decode("ascii")))
+ try:
+ encrypted_cc_hash = base64.b64decode(pass_hash.text)
+ cc_hash = unpad(AES.new(hash_key, AES.MODE_CBC, encrypted_cc_hash[:16]).decrypt(encrypted_cc_hash[16:]), 16)
+ decrypted_hashes.append((base64.b64encode(cc_hash).decode("ascii")))
+ if print_result:
+ print("Nook ccHash is %s" % (base64.b64encode(cc_hash).decode("ascii")))
+ except:
+ traceback.print_exc()
return decrypted_hashes