diff options
author | NoDRM <[email protected]> | 2022-12-23 10:42:25 +0100 |
---|---|---|
committer | NoDRM <[email protected]> | 2022-12-23 10:42:25 +0100 |
commit | 901a6c091d116b232044a803e5eaf337bcb115c0 (patch) | |
tree | 85fb9b2ceccc7d6f8fcec4e65fe5e05653a9ab9b | |
parent | e16748e85486f4e7aac0d73b380e272b6712ac01 (diff) |
Fix exception in error logging in ineptpdf
-rwxr-xr-x | DeDRM_plugin/ineptpdf.py | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/DeDRM_plugin/ineptpdf.py b/DeDRM_plugin/ineptpdf.py index adb9937..ea509ad 100755 --- a/DeDRM_plugin/ineptpdf.py +++ b/DeDRM_plugin/ineptpdf.py @@ -1636,13 +1636,15 @@ class PDFDocument(object): else: print("ebx_V is %d and ebx_type is %d" % (ebx_V, ebx_type)) print("length is %d and len(bookkey) is %d" % (length, len(bookkey))) - print("bookkey[0] is %d" % bookkey[0]) + if len(bookkey) > 0: + print("bookkey[0] is %d" % bookkey[0]) raise ADEPTError('error decrypting book session key - mismatched length') else: # proper length unknown try with whatever you have print("ebx_V is %d and ebx_type is %d" % (ebx_V, ebx_type)) print("length is %d and len(bookkey) is %d" % (length, len(bookkey))) - print("bookkey[0] is %d" % ord(bookkey[0])) + if len(bookkey) > 0: + print("bookkey[0] is %d" % ord(bookkey[0])) if ebx_V == 3: V = 3 else: @@ -1708,13 +1710,15 @@ class PDFDocument(object): else: print("ebx_V is %d and ebx_type is %d" % (ebx_V, ebx_type)) print("length is %d and len(bookkey) is %d" % (length, len(bookkey))) - print("bookkey[0] is %d" % bookkey[0]) + if len(bookkey) > 0: + print("bookkey[0] is %d" % bookkey[0]) raise ADEPTError('error decrypting book session key - mismatched length') else: # proper length unknown try with whatever you have print("ebx_V is %d and ebx_type is %d" % (ebx_V, ebx_type)) print("length is %d and len(bookkey) is %d" % (length, len(bookkey))) - print("bookkey[0] is %d" % bookkey[0]) + if len(bookkey) > 0: + print("bookkey[0] is %d" % bookkey[0]) if ebx_V == 3: V = 3 else: |