]> xmof Git - DeDRM.git/commitdiff
ineptkey 4.1
authorAnonymous <anon@anon>
Sat, 13 Feb 2010 22:14:11 +0000 (22:14 +0000)
committerApprentice Alf <apprenticealf@gmail.com>
Mon, 2 Mar 2015 18:14:33 +0000 (18:14 +0000)
Adobe_EPUB_Tools/ineptkey.pyw

index 9c83681bfb7e846e4cb29630a8d2590145d55f75..f8eb4a1fc90da4335f11a3c3d2f33ed584708ef3 100644 (file)
@@ -12,8 +12,7 @@
 #   1 - Initial release, for Adobe Digital Editions 1.7
 #   2 - Better algorithm for finding pLK; improved error handling
 #   3 - Rename to INEPT
-#   4 - quick beta fix for ADE 1.7.3 - for older versions use ineptkey v3
-#       or upgrade to ADE 1.7.3 (anon)
+#   4 - quick beta fix for ADE 1.7.2 (anon) 
 
 """
 Retrieve Adobe ADEPT user key under Windows.
@@ -43,6 +42,7 @@ except ImportError:
 
 DEVICE_KEY = 'Software\\Adobe\\Adept\\Device'
 PRIVATE_LICENCE_KEY_KEY = 'Software\\Adobe\\Adept\\Activation\\%04d\\%04d'
+ADE_VERSION = 'Software\\Adobe\\Digital Editions\\'
 
 MAX_PATH = 255
 
@@ -150,9 +150,21 @@ def retrieve_key(keypath):
         raise ADEPTError("Adobe Digital Editions not activated")
     device = winreg.QueryValueEx(regkey, 'key')[0]
     keykey = CryptUnprotectData(device, entropy)
+    try:
+        adeversion = winreg.OpenKey(cuser, ADE_VERSION)
+    except WindowsError:
+        raise ADEPTError("Adobe Digital Editions Version could not read")
+    adev = winreg.QueryValueEx(adeversion, 'FileVersion')[0]
+    adev = int(adev.replace(".",""))
     userkey = None
     pkcs = None
-    for i in xrange(4, 16):
+    srange = None
+    # differentiate ADE versions
+    if adev < 90108527:
+        srange = 0
+    else:
+        srange = 4
+    for i in xrange(srange, 16):
         for j in xrange(0, 16):
             plkkey = PRIVATE_LICENCE_KEY_KEY % (i, j)
             try:
@@ -167,7 +179,7 @@ def retrieve_key(keypath):
         if pkcs is not None:
             break
         
-    for i in xrange(4, 16):
+    for i in xrange(srange, 16):
         for j in xrange(0, 16):
             plkkey = PRIVATE_LICENCE_KEY_KEY % (i, j)
             try: