tools v6.0.2

This commit is contained in:
Apprentice Alf
2013-04-05 17:44:48 +01:00
parent a2f044e672
commit d586f74faa
72 changed files with 12418 additions and 13112 deletions

View File

@@ -9,7 +9,7 @@ If the downloaded file is encrypted, install and configure the ignoble plugin in
DOWNLOAD HIDDEN FILES FROM B&N
------------------------------
Some content is not downloadable from the B&N website, notably magazines. A Greasemonkey script (link below) modifies the myNook page of the Barnes and Noble website to show a download button for normally non-downloadable content. This will work until Barnes & Noble changes their website.
Some content is not downloadable from the B&N website, notably magazines. A Greasemonkey script (details below) modifies the myNook page of the Barnes and Noble website to show a download button for normally non-downloadable content. This will work until Barnes & Noble changes their website.
Prerequisites
-------------

View File

@@ -47,13 +47,14 @@ from __future__ import with_statement
# 5.7 - Unicode support added, renamed adobekey from ineptkey
# 5.8 - Added getkey interface for Windows DeDRM application
# 5.9 - moved unicode_argv call inside main for Windows DeDRM compatibility
# 6.0 - Work if TkInter is missing
"""
Retrieve Adobe ADEPT user key.
"""
__license__ = 'GPL v3'
__version__ = '5.9'
__version__ = '6.0'
import sys, os, struct, getopt
@@ -402,9 +403,11 @@ if iswindows:
aes = AES(keykey)
userkey = aes.decrypt(userkey)
userkey = userkey[26:-ord(userkey[-1])]
#print "found key:",userkey.encode('hex')
keys.append(userkey)
if len(keys) == 0:
raise ADEPTError('Could not locate privateLicenseKey')
print u"Found {0:d} keys".format(len(keys))
return keys
@@ -485,6 +488,8 @@ def usage(progname):
print u" {0:s} [-h] [<outpath>]".format(progname)
def cli_main():
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
argv=unicode_argv()
progname = os.path.basename(argv[0])
print u"{0} v{1}\nCopyright © 2009-2013 i♥cabbages and Apprentice Alf".format(progname,__version__)
@@ -541,10 +546,13 @@ def cli_main():
def gui_main():
import Tkinter
import Tkconstants
import tkMessageBox
import traceback
try:
import Tkinter
import Tkconstants
import tkMessageBox
import traceback
except:
return cli_main()
class ExceptionDialog(Tkinter.Frame):
def __init__(self, root, text):
@@ -577,7 +585,7 @@ def gui_main():
keyfileout.write(key)
success = True
tkMessageBox.showinfo(progname, u"Key successfully retrieved to {0}".format(outfile))
except DrmException, e:
except ADEPTError, e:
tkMessageBox.showerror(progname, u"Error: {0}".format(str(e)))
except Exception:
root.wm_state('normal')
@@ -591,7 +599,5 @@ def gui_main():
if __name__ == '__main__':
if len(sys.argv) > 1:
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
sys.exit(cli_main())
sys.exit(gui_main())

View File

@@ -32,13 +32,14 @@ from __future__ import with_statement
# 2.4 - Improvements to UI and now works in plugins
# 2.5 - Additional improvement for unicode and plugin support
# 2.6 - moved unicode_argv call inside main for Windows DeDRM compatibility
# 2.7 - Work if TkInter is missing
"""
Generate Barnes & Noble EPUB user key from name and credit card number.
"""
__license__ = 'GPL v3'
__version__ = "2.6"
__version__ = "2.7"
import sys
import os
@@ -216,6 +217,8 @@ def generate_key(name, ccn):
def cli_main():
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
argv=unicode_argv()
progname = os.path.basename(argv[0])
if AES is None:
@@ -233,10 +236,13 @@ def cli_main():
def gui_main():
import Tkinter
import Tkconstants
import tkFileDialog
import tkMessageBox
try:
import Tkinter
import Tkconstants
import tkMessageBox
import traceback
except:
return cli_main()
class DecryptionDialog(Tkinter.Frame):
def __init__(self, root):
@@ -320,7 +326,5 @@ def gui_main():
if __name__ == '__main__':
if len(sys.argv) > 1:
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
sys.exit(cli_main())
sys.exit(gui_main())

View File

@@ -16,6 +16,8 @@ from __future__ import with_statement
# Simplified some of the Kindle for Mac code.
# 1.4 - Remove dependency on alfcrypto
# 1.5 - moved unicode_argv call inside main for Windows DeDRM compatibility
# 1.6 - Fixed a problem getting the disk serial numbers
# 1.7 - Work if TkInter is missing
"""
@@ -23,7 +25,7 @@ Retrieve Kindle for PC/Mac user key.
"""
__license__ = 'GPL v3'
__version__ = '1.5'
__version__ = '1.7'
import sys, os, re
from struct import pack, unpack, unpack_from
@@ -1268,10 +1270,10 @@ elif isosx:
# uses a sub process to get the Hard Drive Serial Number using ioreg
# returns serial numbers of all internal hard drive drives
def GetVolumesSerialNumbers():
sernums = []
sernum = os.getenv('MYSERIALNUMBER')
if sernum != None:
return [sernum]
sernums = []
sernums.append(sernum.strip())
cmdline = '/usr/sbin/ioreg -w 0 -r -c AppleAHCIDiskDriver'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
@@ -1287,7 +1289,7 @@ elif isosx:
if pp >= 0:
sernum = resline[pp+19:-1]
sernums.append(sernum.strip())
return [sernum]
return sernums
def GetUserHomeAppSupKindleDirParitionName():
home = os.getenv('HOME')
@@ -1313,10 +1315,11 @@ elif isosx:
return disk
# uses a sub process to get the UUID of the specified disk partition using ioreg
def GetDiskPartitionUUID(diskpart):
def GetDiskPartitionUUIDs(diskpart):
uuids = []
uuidnum = os.getenv('MYUUIDNUMBER')
if uuidnum != None:
return uuidnum
uuids.append(strip(uuidnum))
cmdline = '/usr/sbin/ioreg -l -S -w 0 -r -c AppleAHCIDiskDriver'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
@@ -1359,14 +1362,15 @@ elif isosx:
uuidnest = -1
uuidnum = None
bsdname = None
if not foundIt:
uuidnum = ''
return uuidnum
if foundIt:
uuids.append(uuidnum)
return uuids
def GetMACAddressMunged():
def GetMACAddressesMunged():
macnums = []
macnum = os.getenv('MYMACNUM')
if macnum != None:
return macnum
macnums.append(macnum)
cmdline = '/sbin/ifconfig en0'
cmdline = cmdline.encode(sys.getfilesystemencoding())
p = subprocess.Popen(cmdline, shell=True, stdin=None, stdout=subprocess.PIPE, stderr=subprocess.PIPE, close_fds=False)
@@ -1401,9 +1405,9 @@ elif isosx:
macnum = '%0.2x%0.2x%0.2x%0.2x%0.2x%0.2x' % (mlst[0], mlst[1], mlst[2], mlst[3], mlst[4], mlst[5])
foundIt = True
break
if not foundIt:
macnum = ''
return macnum
if foundIt:
macnums.append(macnum)
return macnums
# uses unix env to get username instead of using sysctlbyname
@@ -1414,11 +1418,12 @@ elif isosx:
def GetIDStrings():
# Return all possible ID Strings
strings = []
strings.append(GetMACAddressMunged())
strings.extend(GetMACAddressesMunged())
strings.extend(GetVolumesSerialNumbers())
diskpart = GetUserHomeAppSupKindleDirParitionName()
strings.append(GetDiskPartitionUUID(diskpart))
strings.extend(GetDiskPartitionUUIDs(diskpart))
strings.append('9999999999')
#print strings
return strings
@@ -1800,6 +1805,8 @@ def usage(progname):
def cli_main():
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
argv=unicode_argv()
progname = os.path.basename(argv[0])
print u"{0} v{1}\nCopyright © 2010-2013 some_updates and Apprentice Alf".format(progname,__version__)
@@ -1841,10 +1848,13 @@ def cli_main():
def gui_main():
import Tkinter
import Tkconstants
import tkMessageBox
import traceback
try:
import Tkinter
import Tkconstants
import tkMessageBox
import traceback
except:
return cli_main()
class ExceptionDialog(Tkinter.Frame):
def __init__(self, root, text):
@@ -1891,7 +1901,5 @@ def gui_main():
if __name__ == '__main__':
if len(sys.argv) > 1:
sys.stdout=SafeUnbuffered(sys.stdout)
sys.stderr=SafeUnbuffered(sys.stderr)
sys.exit(cli_main())
sys.exit(gui_main())