From 05fff5217b02adea0265ceeb0712b497585fd304 Mon Sep 17 00:00:00 2001 From: Ben Combee Date: Thu, 22 Aug 2024 18:17:47 -0500 Subject: [PATCH] Fix crash using bare sha1 symbol Use sha1 from hashlib, as it isn't imported globally, fixed crash trying to decrypt a eReader PDB file --- DeDRM_plugin/erdr2pml.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DeDRM_plugin/erdr2pml.py b/DeDRM_plugin/erdr2pml.py index 4d95724..2efe9bb 100755 --- a/DeDRM_plugin/erdr2pml.py +++ b/DeDRM_plugin/erdr2pml.py @@ -255,7 +255,7 @@ class EreaderProcessor(object): encrypted_key = r[172:172+8] encrypted_key_sha = r[56:56+20] self.content_key = des.decrypt(encrypted_key) - if sha1(self.content_key).digest() != encrypted_key_sha: + if hashlib.sha1(self.content_key).digest() != encrypted_key_sha: raise ValueError('Incorrect Name and/or Credit Card') def getNumImages(self):