tools v4.6

This commit is contained in:
Apprentice Alf 2011-08-06 07:12:41 +01:00
parent 297a9ddc66
commit ba5927a20d
14 changed files with 86 additions and 44 deletions

View File

@ -19,7 +19,7 @@ class K4DeDRM(FileTypePlugin):
description = 'Removes DRM from K4PC and Mac, Kindle Mobi and Topaz files. Provided by the work of many including DiapDealer, SomeUpdates, IHeartCabbages, CMBDTC, Skindle, DarkReverser, ApprenticeAlf, etc.'
supported_platforms = ['osx', 'windows', 'linux'] # Platforms this plugin will run on
author = 'DiapDealer, SomeUpdates' # The author of this plugin
version = (0, 3, 5) # The version number of this plugin
version = (0, 3, 6) # The version number of this plugin
file_types = set(['prc','mobi','azw','azw1','tpz']) # The file types that this plugin will be applied to
on_import = True # Run this plugin during the import
priority = 210 # run this plugin before mobidedrm, k4pcdedrm, k4dedrm

View File

@ -17,7 +17,7 @@ from __future__ import with_statement
# and many many others
__version__ = '3.5'
__version__ = '3.6'
class Unbuffered:
def __init__(self, stream):

View File

@ -49,11 +49,12 @@
# 0.27 - Correct pid metadata token generation to match that used by skindle (Thank You Bart!)
# 0.28 - slight additional changes to metadata token generation (None -> '')
# 0.29 - It seems that the ideas about when multibyte trailing characters were
# included in the encryption were wrong. They aren't for DOC compressed
# files, but they are for HUFF/CDIC compress files!
# included in the encryption were wrong. They are for DOC compressed
# files, but they are not for HUFF/CDIC compress files!
# 0.30 - Modified interface slightly to work better with new calibre plugin style
# 0.31 - The multibyte encrytion info is true for version 7 files too.
__version__ = '0.30'
__version__ = '0.31'
import sys
@ -198,8 +199,8 @@ class MobiBook:
if (self.mobi_length >= 0xE4) and (self.mobi_version >= 5):
self.extra_data_flags, = struct.unpack('>H', self.sect[0xF2:0xF4])
print "Extra Data Flags = %d" % self.extra_data_flags
if (self.mobi_version < 7) and (self.compression != 17480):
# multibyte utf8 data is included in the encryption for mobi_version 6 and below
if (self.compression != 17480):
# multibyte utf8 data is included in the encryption for PalmDoc compression
# so clear that byte so that we leave it to be decrypted.
self.extra_data_flags &= 0xFFFE

View File

@ -24,7 +24,7 @@
<key>CFBundleExecutable</key>
<string>droplet</string>
<key>CFBundleGetInfoString</key>
<string>DeDRM 2.8, Written 20102011 by Apprentice Alf and others.</string>
<string>DeDRM 2.9, Written 20102011 by Apprentice Alf and others.</string>
<key>CFBundleIconFile</key>
<string>droplet</string>
<key>CFBundleInfoDictionaryVersion</key>
@ -34,7 +34,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.8</string>
<string>2.9</string>
<key>CFBundleSignature</key>
<string>dplt</string>
<key>LSMinimumSystemVersion</key>

View File

@ -17,7 +17,7 @@ from __future__ import with_statement
# and many many others
__version__ = '3.5'
__version__ = '3.6'
class Unbuffered:
def __init__(self, stream):

View File

@ -49,11 +49,12 @@
# 0.27 - Correct pid metadata token generation to match that used by skindle (Thank You Bart!)
# 0.28 - slight additional changes to metadata token generation (None -> '')
# 0.29 - It seems that the ideas about when multibyte trailing characters were
# included in the encryption were wrong. They aren't for DOC compressed
# files, but they are for HUFF/CDIC compress files!
# included in the encryption were wrong. They are for DOC compressed
# files, but they are not for HUFF/CDIC compress files!
# 0.30 - Modified interface slightly to work better with new calibre plugin style
# 0.31 - The multibyte encrytion info is true for version 7 files too.
__version__ = '0.30'
__version__ = '0.31'
import sys
@ -198,8 +199,8 @@ class MobiBook:
if (self.mobi_length >= 0xE4) and (self.mobi_version >= 5):
self.extra_data_flags, = struct.unpack('>H', self.sect[0xF2:0xF4])
print "Extra Data Flags = %d" % self.extra_data_flags
if (self.mobi_version < 7) and (self.compression != 17480):
# multibyte utf8 data is included in the encryption for mobi_version 6 and below
if (self.compression != 17480):
# multibyte utf8 data is included in the encryption for PalmDoc compression
# so clear that byte so that we leave it to be decrypted.
self.extra_data_flags &= 0xFFFE

View File

@ -17,7 +17,7 @@ from __future__ import with_statement
# and many many others
__version__ = '3.5'
__version__ = '3.6'
class Unbuffered:
def __init__(self, stream):

View File

@ -49,11 +49,12 @@
# 0.27 - Correct pid metadata token generation to match that used by skindle (Thank You Bart!)
# 0.28 - slight additional changes to metadata token generation (None -> '')
# 0.29 - It seems that the ideas about when multibyte trailing characters were
# included in the encryption were wrong. They aren't for DOC compressed
# files, but they are for HUFF/CDIC compress files!
# included in the encryption were wrong. They are for DOC compressed
# files, but they are not for HUFF/CDIC compress files!
# 0.30 - Modified interface slightly to work better with new calibre plugin style
# 0.31 - The multibyte encrytion info is true for version 7 files too.
__version__ = '0.30'
__version__ = '0.31'
import sys
@ -198,8 +199,8 @@ class MobiBook:
if (self.mobi_length >= 0xE4) and (self.mobi_version >= 5):
self.extra_data_flags, = struct.unpack('>H', self.sect[0xF2:0xF4])
print "Extra Data Flags = %d" % self.extra_data_flags
if (self.mobi_version < 7) and (self.compression != 17480):
# multibyte utf8 data is included in the encryption for mobi_version 6 and below
if (self.compression != 17480):
# multibyte utf8 data is included in the encryption for PalmDoc compression
# so clear that byte so that we leave it to be decrypted.
self.extra_data_flags &= 0xFFFE

View File

@ -17,7 +17,7 @@ from __future__ import with_statement
# and many many others
__version__ = '3.5'
__version__ = '3.6'
class Unbuffered:
def __init__(self, stream):

View File

@ -49,11 +49,12 @@
# 0.27 - Correct pid metadata token generation to match that used by skindle (Thank You Bart!)
# 0.28 - slight additional changes to metadata token generation (None -> '')
# 0.29 - It seems that the ideas about when multibyte trailing characters were
# included in the encryption were wrong. They aren't for DOC compressed
# files, but they are for HUFF/CDIC compress files!
# included in the encryption were wrong. They are for DOC compressed
# files, but they are not for HUFF/CDIC compress files!
# 0.30 - Modified interface slightly to work better with new calibre plugin style
# 0.31 - The multibyte encrytion info is true for version 7 files too.
__version__ = '0.30'
__version__ = '0.31'
import sys
@ -198,8 +199,8 @@ class MobiBook:
if (self.mobi_length >= 0xE4) and (self.mobi_version >= 5):
self.extra_data_flags, = struct.unpack('>H', self.sect[0xF2:0xF4])
print "Extra Data Flags = %d" % self.extra_data_flags
if (self.mobi_version < 7) and (self.compression != 17480):
# multibyte utf8 data is included in the encryption for mobi_version 6 and below
if (self.compression != 17480):
# multibyte utf8 data is included in the encryption for PalmDoc compression
# so clear that byte so that we leave it to be decrypted.
self.extra_data_flags &= 0xFFFE

View File

@ -49,11 +49,12 @@
# 0.27 - Correct pid metadata token generation to match that used by skindle (Thank You Bart!)
# 0.28 - slight additional changes to metadata token generation (None -> '')
# 0.29 - It seems that the ideas about when multibyte trailing characters were
# included in the encryption were wrong. They aren't for DOC compressed
# files, but they are for HUFF/CDIC compress files!
# included in the encryption were wrong. They are for DOC compressed
# files, but they are not for HUFF/CDIC compress files!
# 0.30 - Modified interface slightly to work better with new calibre plugin style
# 0.31 - The multibyte encrytion info is true for version 7 files too.
__version__ = '0.30'
__version__ = '0.31'
import sys
@ -198,8 +199,8 @@ class MobiBook:
if (self.mobi_length >= 0xE4) and (self.mobi_version >= 5):
self.extra_data_flags, = struct.unpack('>H', self.sect[0xF2:0xF4])
print "Extra Data Flags = %d" % self.extra_data_flags
if (self.mobi_version < 7) and (self.compression != 17480):
# multibyte utf8 data is included in the encryption for mobi_version 6 and below
if (self.compression != 17480):
# multibyte utf8 data is included in the encryption for PalmDoc compression
# so clear that byte so that we leave it to be decrypted.
self.extra_data_flags &= 0xFFFE

View File

@ -6,17 +6,17 @@ The set includes tools to remove DRM from eReader PDB books, Barnes and Noble eP
This ReadMe_First.txt is meant to give users a quick overview of what is available and how to get started.
Calibre Users (Mac OS X, Linux, Windows)
Calibre Users (Mac OS X, Windows)
-------------
If you are a calibre user, the quickest and easiest way to remove DRM from your ebooks is to open the Calibre_Plugins folder and install each of the plugins following the instructions and configuration directions provided in each plugins README file.
Once installed and configured, you can simply import a DRM book into Calibre and end up with the DeDRM version in the Calibre database.
These plugins work for Windows, Mac OS X, and Linux
These plugins work for Windows and Mac OS X
Mac OS X Users (Mac OS X 10.5 and 10.6)
Mac OS X Users (Mac OS X 10.5, 10.6, and 10.7)
--------------
From the DeDRM_for_Mac_and_Win folder, drag the DeDRM_X.X.app.zip droplet to your Desktop. Double-click on it once to unzip it to create the DeDRM X.X.app droplet. Double-click on the droplet once and it will guide you through collecting the data it needs to remove the DRM.
@ -33,16 +33,12 @@ From the DeDRM_for_Mac_and_Win folder, fully extract the DeDRM_WinApp_vX.X.zip.
To use it simply drag ebooks or folders onto the DeDRM_Drop_Target short-cut, and it will process the ebooks.
Linux Users
-----------
Since the state of the Linux Desktop is so jumbled and sad with so many different ways to set it up and different configuration files that depend on your version of Linux, making a DeDRM drag and drop tool for multiple versions of Linux is simply an exercise in futility. That said, you should have no problems running the gui tools (or their command line equivalents) described next.
Not a Calibre or a DeDRM User?
------------------------------
There are a number of python based tools that have graphical user interfaces to make them easy to use. To use any of these tools, you need to have Python 2.5, 2.6, or 2.7 for 32 bits installed on your machine as well as a matching PyCrypto or OpenSSL for some tools.
On Mac OS X (10.5 and 10.6) and Linux (recent versions), your systems already have the proper Python and OpenSSL installed. So nothing need be done, you can already run these tools by double-clicking on the .pyw python scripts.
On Mac OS X (10.5, 10.6 and 10.7), your systems already have the proper Python and OpenSSL installed. So nothing need be done, you can already run these tools by double-clicking on the .pyw python scripts.
Users of Mac OS X 10.3 and 10.4, need to download and install the "32-bit Mac Installer disk Image (2.7.X) for OS X 10.3 and later from http://www.python.org/download/releases/2.7.1/
@ -54,14 +50,11 @@ The scripts are organized by type of ebook you need to remove the DRM from. Cho
"Adobe_PDF_Tools"
"Barnes_and_Noble_ePub_Tools"
"eReader_PDB_Tools"
"KindleBooks_Tools"
"KindleBooks"
"Kindle_for_Android_Patch"
by simply opening that folder.
In the "KindleBooks_Tools" folder the primary tool is in the "KindleBooks" folder.
If you are a Windows user, or a Linux platform using Wine, or Mac OS X or have trouble running the KindleBooks tools, there are two other tools provided. These are called "Kindle_4_Mac_Unswindle" and "Kindle_4_PC_Unswindle".
Look for a README inside of the relevant folder to get you started.
@ -109,3 +102,47 @@ For PyCrypto:
Once Windows users have installed Python 2.X for 32 bits, and the matching OpenSSL OR PyCrypto pieces, they too are ready to run the scripts.
Linux Users
-----------
Unfortuantely, the Calibre Plugins do not really work well on Linux because of issues running Calibre under Wine. Native versions of Calibre can not be used with the K4MobiDeDRM plugin because the plugin will not be able to find the information it needs to remove the DRM.
Although some of the scripts do work on native Linux, others require the use of a recent version of Wine.
Here are the instructions for using KindleBooks.pyw on Linux under Wine.
1. upgrade to very recent versions of Wine; This has been tested with Wine 1.3.18 1.3.22. It may work with earlier versions but no promises.
2. Some versions of winecfg have a bug in setting the volume serial number, so create a .windows-serial file at root of drive_c to set a proper windows volume serial number (8 digit hex value for unsigned integer).
cd ~
cd .wine
cd drive_c
echo deadbeaf > .windows-serial
Replace deadbeef with whatever you want but I would stay away from the default setting of ffffffff
3. Only ***after*** setting the volume serial number properly download and install under wine K4PC version for Windows. Register it and download from your Archive one of your Kindle ebooks. Versions known to work are K4PC 1.4.1 and earlier. Later version may work but no promises.
4. Download and install under wine ActiveState Active Python 2.7 for Windows 32bit
5. Download and unzip tools_v4.5.zip
6. Then run KindleBook.pyw ***under python running on wine*** using one of the following methods:
From a Linux shell:
wine python KindleBooks.pyw
Or to get a Windows (wine) command prompt
wine cmd
python KindleBooks.pyw
Or to get a "Windows" file explorer:
winefile
and then double-click on any .pyw files to run them in the wine environment