mirror of
https://github.com/apprenticeharper/DeDRM_tools
synced 2024-12-27 09:58:59 +01:00
using byte string in kfxdedrm.py
This commit is contained in:
parent
e0c7d7d382
commit
66bab7bd7d
1 changed files with 3 additions and 3 deletions
|
@ -35,7 +35,7 @@ class KFXZipBook:
|
||||||
for filename in zf.namelist():
|
for filename in zf.namelist():
|
||||||
with zf.open(filename) as fh:
|
with zf.open(filename) as fh:
|
||||||
data = fh.read(8)
|
data = fh.read(8)
|
||||||
if data != '\xeaDRMION\xee':
|
if data != b'\xeaDRMION\xee':
|
||||||
continue
|
continue
|
||||||
data += fh.read()
|
data += fh.read()
|
||||||
if self.voucher is None:
|
if self.voucher is None:
|
||||||
|
@ -53,11 +53,11 @@ class KFXZipBook:
|
||||||
for info in zf.infolist():
|
for info in zf.infolist():
|
||||||
with zf.open(info.filename) as fh:
|
with zf.open(info.filename) as fh:
|
||||||
data = fh.read(4)
|
data = fh.read(4)
|
||||||
if data != '\xe0\x01\x00\xea':
|
if data != b'\xe0\x01\x00\xea':
|
||||||
continue
|
continue
|
||||||
|
|
||||||
data += fh.read()
|
data += fh.read()
|
||||||
if 'ProtectedData' in data:
|
if b'ProtectedData' in data:
|
||||||
break # found DRM voucher
|
break # found DRM voucher
|
||||||
else:
|
else:
|
||||||
raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
|
raise Exception("The .kfx-zip archive contains an encrypted DRMION file without a DRM voucher")
|
||||||
|
|
Loading…
Reference in a new issue