summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoDRM <[email protected]>2022-12-23 10:42:25 +0100
committerNoDRM <[email protected]>2022-12-23 10:42:25 +0100
commit901a6c091d116b232044a803e5eaf337bcb115c0 (patch)
tree85fb9b2ceccc7d6f8fcec4e65fe5e05653a9ab9b
parente16748e85486f4e7aac0d73b380e272b6712ac01 (diff)
Fix exception in error logging in ineptpdf
-rwxr-xr-xDeDRM_plugin/ineptpdf.py12
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: