Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6716db1f62 | ||
|
|
464788a3f1 | ||
|
|
218539f131 | ||
|
|
cdab22e59c |
@@ -7,7 +7,7 @@ from __future__ import with_statement
|
|||||||
# Copyright © 2008-2020 Apprentice Harper et al.
|
# Copyright © 2008-2020 Apprentice Harper et al.
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = '6.8.0'
|
__version__ = '6.8.1'
|
||||||
__docformat__ = 'restructuredtext en'
|
__docformat__ = 'restructuredtext en'
|
||||||
|
|
||||||
|
|
||||||
@@ -71,13 +71,14 @@ __docformat__ = 'restructuredtext en'
|
|||||||
# 6.6.3 - More cleanup of kindle book names and start of support for .kinf2018
|
# 6.6.3 - More cleanup of kindle book names and start of support for .kinf2018
|
||||||
# 6.7.0 - Handle new library in calibre.
|
# 6.7.0 - Handle new library in calibre.
|
||||||
# 6.8.0 - Full support for .kinf2018 and new KFX encryption (Kindle for PC/Mac 2.5+)
|
# 6.8.0 - Full support for .kinf2018 and new KFX encryption (Kindle for PC/Mac 2.5+)
|
||||||
|
# 6.8.1 - Kindle key fix for Mac OS X Big Syr
|
||||||
|
|
||||||
"""
|
"""
|
||||||
Decrypt DRMed ebooks.
|
Decrypt DRMed ebooks.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
PLUGIN_NAME = u"DeDRM"
|
PLUGIN_NAME = u"DeDRM"
|
||||||
PLUGIN_VERSION_TUPLE = (6, 8, 0)
|
PLUGIN_VERSION_TUPLE = tuple([int(x) for x in __version__.split(".")])
|
||||||
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
PLUGIN_VERSION = u".".join([unicode(str(x)) for x in PLUGIN_VERSION_TUPLE])
|
||||||
# Include an html helpfile in the plugin's zipfile with the following name.
|
# Include an html helpfile in the plugin's zipfile with the following name.
|
||||||
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
RESOURCE_NAME = PLUGIN_NAME + '_Help.htm'
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from __future__ import with_statement
|
|||||||
# Copyright © 2008-2020 Apprentice Harper et al.
|
# Copyright © 2008-2020 Apprentice Harper et al.
|
||||||
|
|
||||||
__license__ = 'GPL v3'
|
__license__ = 'GPL v3'
|
||||||
__version__ = '2.7'
|
__version__ = '2.8'
|
||||||
|
|
||||||
# Revision history:
|
# Revision history:
|
||||||
# 1.0 - Kindle info file decryption, extracted from k4mobidedrm, etc.
|
# 1.0 - Kindle info file decryption, extracted from k4mobidedrm, etc.
|
||||||
@@ -30,6 +30,7 @@ __version__ = '2.7'
|
|||||||
# 2.5 - Final Fix for Windows user names with non-ascii characters, thanks to oneofusoneofus
|
# 2.5 - Final Fix for Windows user names with non-ascii characters, thanks to oneofusoneofus
|
||||||
# 2.6 - Start adding support for Kindle 1.25+ .kinf2018 file
|
# 2.6 - Start adding support for Kindle 1.25+ .kinf2018 file
|
||||||
# 2.7 - Finish .kinf2018 support, PC & Mac by Apprentice Sakuya
|
# 2.7 - Finish .kinf2018 support, PC & Mac by Apprentice Sakuya
|
||||||
|
# 2.8 - Fix for Mac OS X Big Sur
|
||||||
|
|
||||||
|
|
||||||
"""
|
"""
|
||||||
@@ -901,7 +902,7 @@ if iswindows:
|
|||||||
# double the buffer size
|
# double the buffer size
|
||||||
buffer = create_unicode_buffer(len(buffer) * 2)
|
buffer = create_unicode_buffer(len(buffer) * 2)
|
||||||
size.value = len(buffer)
|
size.value = len(buffer)
|
||||||
|
|
||||||
# replace any non-ASCII values with 0xfffd
|
# replace any non-ASCII values with 0xfffd
|
||||||
for i in xrange(0,len(buffer)):
|
for i in xrange(0,len(buffer)):
|
||||||
if buffer[i]>u"\u007f":
|
if buffer[i]>u"\u007f":
|
||||||
@@ -987,7 +988,7 @@ if iswindows:
|
|||||||
found = True
|
found = True
|
||||||
print('Found K4PC 1.25+ kinf2018 file: ' + kinfopath.encode('ascii','ignore'))
|
print('Found K4PC 1.25+ kinf2018 file: ' + kinfopath.encode('ascii','ignore'))
|
||||||
kInfoFiles.append(kinfopath)
|
kInfoFiles.append(kinfopath)
|
||||||
|
|
||||||
# look for (K4PC 1.9.0 and later) .kinf2011 file
|
# look for (K4PC 1.9.0 and later) .kinf2011 file
|
||||||
kinfopath = path +'\\Amazon\\Kindle\\storage\\.kinf2011'
|
kinfopath = path +'\\Amazon\\Kindle\\storage\\.kinf2011'
|
||||||
if os.path.isfile(kinfopath):
|
if os.path.isfile(kinfopath):
|
||||||
@@ -1183,8 +1184,12 @@ elif isosx:
|
|||||||
|
|
||||||
libcrypto = find_library('crypto')
|
libcrypto = find_library('crypto')
|
||||||
if libcrypto is None:
|
if libcrypto is None:
|
||||||
raise DrmException(u"libcrypto not found")
|
libcrypto = '/usr/lib/libcrypto.dylib'
|
||||||
libcrypto = CDLL(libcrypto)
|
try:
|
||||||
|
libcrypto = CDLL(libcrypto)
|
||||||
|
except Exception as e:
|
||||||
|
raise DrmException(u"libcrypto not found: " % e)
|
||||||
|
|
||||||
|
|
||||||
# From OpenSSL's crypto aes header
|
# From OpenSSL's crypto aes header
|
||||||
#
|
#
|
||||||
@@ -1534,7 +1539,7 @@ elif isosx:
|
|||||||
try:
|
try:
|
||||||
DB = {}
|
DB = {}
|
||||||
items = data.split('/')
|
items = data.split('/')
|
||||||
|
|
||||||
# the headerblob is the encrypted information needed to build the entropy string
|
# the headerblob is the encrypted information needed to build the entropy string
|
||||||
headerblob = items.pop(0)
|
headerblob = items.pop(0)
|
||||||
encryptedValue = decode(headerblob, charMap1)
|
encryptedValue = decode(headerblob, charMap1)
|
||||||
|
|||||||
Reference in New Issue
Block a user