MobiDeDRM 0.09 and AppleScript

pull/6/head
Apprentice Alf 16 years ago
parent d35dd536c7
commit 16fbfcdba9

@ -20,6 +20,7 @@
# 0.06 - And that low bit does mean something after all :-) # 0.06 - And that low bit does mean something after all :-)
# 0.07 - The extra data flags aren't present in MOBI header < 0xE8 in size # 0.07 - The extra data flags aren't present in MOBI header < 0xE8 in size
# 0.08 - ...and also not in Mobi header version < 6 # 0.08 - ...and also not in Mobi header version < 6
# 0.09 - ...but they are there with Mobi header version 6, header size 0xE4!
import sys,struct,binascii import sys,struct,binascii
@ -157,7 +158,7 @@ class DrmStripper:
extra_data_flags = 0 extra_data_flags = 0
print "MOBI header length = %d" %mobi_length print "MOBI header length = %d" %mobi_length
print "MOBI header version = %d" %mobi_version print "MOBI header version = %d" %mobi_version
if (mobi_length >= 0xE8) and (mobi_version > 5): if (mobi_length >= 0xE4) and (mobi_version > 5):
extra_data_flags, = struct.unpack('>H', sect[0xF2:0xF4]) extra_data_flags, = struct.unpack('>H', sect[0xF2:0xF4])
print "Extra Data Flags = %d" %extra_data_flags print "Extra Data Flags = %d" %extra_data_flags
@ -205,7 +206,7 @@ if not __name__ == "__main__":
description = 'Removes DRM from secure Mobi files' description = 'Removes DRM from secure Mobi files'
supported_platforms = ['linux', 'osx', 'windows'] # Platforms this plugin will run on supported_platforms = ['linux', 'osx', 'windows'] # Platforms this plugin will run on
author = 'The Dark Reverser' # The author of this plugin author = 'The Dark Reverser' # The author of this plugin
version = (0, 0, 8) # The version number of this plugin version = (0, 0, 9) # The version number of this plugin
file_types = set(['prc','mobi','azw']) # The file types that this plugin will be applied to file_types = set(['prc','mobi','azw']) # The file types that this plugin will be applied to
on_import = True # Run this plugin during the import on_import = True # Run this plugin during the import
@ -232,7 +233,7 @@ if not __name__ == "__main__":
return 'Enter PID (separate multiple PIDs with comma)' return 'Enter PID (separate multiple PIDs with comma)'
if __name__ == "__main__": if __name__ == "__main__":
print "MobiDeDrm v0.08. Copyright (c) 2008 The Dark Reverser" print "MobiDeDrm v0.09. Copyright (c) 2008 The Dark Reverser"
if len(sys.argv)<4: if len(sys.argv)<4:
print "Removes protection from Mobipocket books" print "Removes protection from Mobipocket books"
print "Usage:" print "Usage:"

@ -28,7 +28,7 @@
<key>CFBundleInfoDictionaryVersion</key> <key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string> <string>6.0</string>
<key>CFBundleName</key> <key>CFBundleName</key>
<string>Mobipocket Unlocker 4</string> <string>Mobipocket Unlocker 9</string>
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
@ -40,9 +40,9 @@
<key>name</key> <key>name</key>
<string>ScriptWindowState</string> <string>ScriptWindowState</string>
<key>positionOfDivider</key> <key>positionOfDivider</key>
<real>435</real> <real>422</real>
<key>savedFrame</key> <key>savedFrame</key>
<string>53 78 661 691 0 0 1280 778 </string> <string>91 171 1059 678 0 0 1440 878 </string>
<key>selectedTabView</key> <key>selectedTabView</key>
<string>result</string> <string>result</string>
</dict> </dict>

@ -20,6 +20,7 @@
# 0.06 - And that low bit does mean something after all :-) # 0.06 - And that low bit does mean something after all :-)
# 0.07 - The extra data flags aren't present in MOBI header < 0xE8 in size # 0.07 - The extra data flags aren't present in MOBI header < 0xE8 in size
# 0.08 - ...and also not in Mobi header version < 6 # 0.08 - ...and also not in Mobi header version < 6
# 0.09 - ...but they are there with Mobi header version 6, header size 0xE4!
import sys,struct,binascii import sys,struct,binascii
@ -157,7 +158,7 @@ class DrmStripper:
extra_data_flags = 0 extra_data_flags = 0
print "MOBI header length = %d" %mobi_length print "MOBI header length = %d" %mobi_length
print "MOBI header version = %d" %mobi_version print "MOBI header version = %d" %mobi_version
if (mobi_length >= 0xE8) and (mobi_version > 5): if (mobi_length >= 0xE4) and (mobi_version > 5):
extra_data_flags, = struct.unpack('>H', sect[0xF2:0xF4]) extra_data_flags, = struct.unpack('>H', sect[0xF2:0xF4])
print "Extra Data Flags = %d" %extra_data_flags print "Extra Data Flags = %d" %extra_data_flags
@ -205,7 +206,7 @@ if not __name__ == "__main__":
description = 'Removes DRM from secure Mobi files' description = 'Removes DRM from secure Mobi files'
supported_platforms = ['linux', 'osx', 'windows'] # Platforms this plugin will run on supported_platforms = ['linux', 'osx', 'windows'] # Platforms this plugin will run on
author = 'The Dark Reverser' # The author of this plugin author = 'The Dark Reverser' # The author of this plugin
version = (0, 0, 8) # The version number of this plugin version = (0, 0, 9) # The version number of this plugin
file_types = set(['prc','mobi','azw']) # The file types that this plugin will be applied to file_types = set(['prc','mobi','azw']) # The file types that this plugin will be applied to
on_import = True # Run this plugin during the import on_import = True # Run this plugin during the import
@ -232,7 +233,7 @@ if not __name__ == "__main__":
return 'Enter PID (separate multiple PIDs with comma)' return 'Enter PID (separate multiple PIDs with comma)'
if __name__ == "__main__": if __name__ == "__main__":
print "MobiDeDrm v0.08. Copyright (c) 2008 The Dark Reverser" print "MobiDeDrm v0.09. Copyright (c) 2008 The Dark Reverser"
if len(sys.argv)<4: if len(sys.argv)<4:
print "Removes protection from Mobipocket books" print "Removes protection from Mobipocket books"
print "Usage:" print "Usage:"

@ -1,10 +1,12 @@
on unlockfile(encryptedFile, MobiDeDRMPath, encryptionKey) on unlockfile(encryptedFile, MobiDeDRMPath, encryptionKey)
set encryptedFilePath to POSIX path of file encryptedFile set encryptedFilePath to POSIX path of file encryptedFile
-- display dialog "filepath " & encryptedFilePath buttons {"OK"} default button 1 giving up after 10
tell application "Finder" to  tell application "Finder" to Â
set parent_folder to (container of file encryptedFile) as text set parent_folder to (container of file encryptedFile) as text
tell application "Finder" to set fileName to (name of file encryptedFile) as text tell application "Finder" to set fileName to (name of file encryptedFile) as text
set unlockedFilePath to POSIX path of file (parent_folder & "Unlocked_" & fileName) set unlockedFilePath to POSIX path of file (parent_folder & "Unlocked_" & fileName)
set shellcommand to "python \"" & MobiDeDRMPath & "\" \"" & encryptedFilePath & "\" \"" & unlockedFilePath & "\" '" & encryptionKey & "'" set shellcommand to "python '" & MobiDeDRMPath & "' '" & encryptedFilePath & "' '" & unlockedFilePath & "' '" & encryptionKey & "'"
-- display dialog "shellcommand: " & shellcommand buttons {"OK"} default button 1 giving up after 10
try try
--with timeout of 5 seconds --with timeout of 5 seconds
-- display dialog "About to Unlock " & fileName buttons {"Unlock"} default button 1 giving up after 1 -- display dialog "About to Unlock " & fileName buttons {"Unlock"} default button 1 giving up after 1

@ -1,4 +1,4 @@
{\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf330 {\rtf1\ansi\ansicpg1252\cocoartf949\cocoasubrtf540
{\fonttbl} {\fonttbl}
{\colortbl;\red255\green255\blue255;} {\colortbl;\red255\green255\blue255;}
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 362 B

After

Width:  |  Height:  |  Size: 336 B

Loading…
Cancel
Save