mirror of
https://github.com/KnugiHK/WhatsApp-Chat-Exporter.git
synced 2026-05-27 11:26:22 +00:00
Clearer error message in decompressing decrypted backup
This commit is contained in:
@@ -59,7 +59,10 @@ def decrypt_backup(database, key, output, crypt14=True):
|
|||||||
main_key = key[126:]
|
main_key = key[126:]
|
||||||
cipher = AES.new(main_key, AES.MODE_GCM, iv)
|
cipher = AES.new(main_key, AES.MODE_GCM, iv)
|
||||||
db_compressed = cipher.decrypt(db_ciphertext)
|
db_compressed = cipher.decrypt(db_ciphertext)
|
||||||
db = zlib.decompress(db_compressed)
|
try:
|
||||||
|
db = zlib.decompress(db_compressed)
|
||||||
|
except zlib.error:
|
||||||
|
print("Decompressing failed. Possibly incorrect offsets used in decryption.")
|
||||||
if db[0:6].upper() == b"SQLITE":
|
if db[0:6].upper() == b"SQLITE":
|
||||||
with open(output, "wb") as f:
|
with open(output, "wb") as f:
|
||||||
f.write(db)
|
f.write(db)
|
||||||
|
|||||||
Reference in New Issue
Block a user