From 007a8e8a1570ba812f52f0255837572693792fb2 Mon Sep 17 00:00:00 2001 From: Olaf Fricke Date: Sat, 1 May 2021 21:11:53 +0200 Subject: [PATCH] Issue 1635: Decypting PDF ebboks fixed --- DeDRM_plugin/ineptpdf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DeDRM_plugin/ineptpdf.py b/DeDRM_plugin/ineptpdf.py index 9eb2154..e8385fe 100755 --- a/DeDRM_plugin/ineptpdf.py +++ b/DeDRM_plugin/ineptpdf.py @@ -1204,7 +1204,7 @@ class PDFStream(PDFObject): for i in range(0, len(data), columns+1): pred = data[i] ent1 = data[i+1:i+1+columns] - if pred == b'\x02': + if pred == 2: ent1 = b''.join(bytes([(a+b) & 255]) \ for (a,b) in zip(ent0,ent1)) buf += ent1 @@ -1349,8 +1349,8 @@ class PDFXRefStream(object): raise PDFNoValidXRef('Invalid PDF stream spec.') size = stream.dic['Size'] index = stream.dic.get('Index', (0,size)) - self.index = zip(itertools.islice(index, 0, None, 2), - itertools.islice(index, 1, None, 2)) + self.index = list(zip(itertools.islice(index, 0, None, 2), + itertools.islice(index, 1, None, 2))) (self.fl1, self.fl2, self.fl3) = stream.dic['W'] self.data = stream.get_data() self.entlen = self.fl1+self.fl2+self.fl3