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
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)
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];
}
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);