]> xmof Git - DeDRM.git/commitdiff
Added debug print and fixed wrong path being used in tool
authorSatsuoni <satsuoni@gmail.com>
Fri, 26 Sep 2025 13:04:15 +0000 (22:04 +0900)
committerSatsuoni <satsuoni@gmail.com>
Fri, 26 Sep 2025 13:04:15 +0000 (22:04 +0900)
DeDRM_plugin/ion.py
Other_Tools/KRFKeyExtractor/KFXKeyExtractor28.cpp

index 6d6431c634e3e484c7520fe9bac0f63c0e66f4ef..e5d4123104ba6c89f2af72fee00d0eb84e0550ff 100644 (file)
@@ -1360,6 +1360,7 @@ class DrmIonVoucher(object):
         shared = ("PIDv3" + self.encalgorithm + self.enctransformation + self.hashalgorithm).encode('ASCII')
 
         self.lockparams.sort()
+        print("Lock parameters used: {}".format(self.lockparams))
         for param in self.lockparams:
             if param == "ACCOUNT_SECRET":
                 shared += param.encode('ASCII') + self.secret
@@ -1379,7 +1380,6 @@ class DrmIonVoucher(object):
         lastexception = None # type: Exception | None
         keycandidates=self.keycandidates+[hmac.new(sharedsecret, b"PIDv3", digestmod=hashlib.sha256).digest() for sharedsecret in sharedsecrets]
         for key in keycandidates:
-            print(f"{key.hex()} {self.cipheriv[:16].hex()}")
             aes = AES.new(key[:32], AES.MODE_CBC, self.cipheriv[:16])
             try:
                 b = aes.decrypt(self.ciphertext)
index f555bc3b7dd3a1ee25bc9f985ab91778f33e0c82..ed562b74302a6bb916fad5cd903c2011d50576f4 100644 (file)
@@ -1988,8 +1988,7 @@ int main(int argc, char* argv[])
        
        wchar_t kindle_local_path[MAX_PATH];
        PathCombineW(kindle_local_path, localcappdata, amazon_app);
-       wchar_t kindle_global_path[MAX_PATH];
-       PathCombineW(kindle_global_path, programfiles, amazon_app);
+       
        
        
        wchar_t kindle_path[MAX_PATH];
@@ -2003,8 +2002,20 @@ int main(int argc, char* argv[])
        }
        else
        {
-               PathCombineW(kindle_path, programfiles, L"Kindle.exe");
-               PathCombineW(qt_path, programfiles, L"Qt5Core.dll");
+        wchar_t kindle_global_path[MAX_PATH];
+        PathCombineW(kindle_global_path, programfiles, amazon_app);
+
+        amazon_app = L"Amazon\\Kindle\\application";
+
+               PathCombineW(kindle_path, kindle_global_path, L"Kindle.exe");
+               PathCombineW(qt_path, kindle_global_path, L"Qt5Core.dll");
+        if (!PathFileExists(kindle_path))
+        {
+            PathCombineW(kindle_global_path, programfiles, L"Amazon\\Kindle\\");
+            PathCombineW(kindle_path, kindle_global_path, L"Kindle.exe");
+            PathCombineW(qt_path, kindle_global_path, L"Qt5Core.dll");
+        }
+
                std::cout<<"Kindle4PC appears to be installed globally, this is not tested and the utility might not work" << std::endl;
        }
        PathCombineW(kindle_storage, localcappdata, amazon_storage);