From 481656fdeb9b8eea96062098323125922427ea8c Mon Sep 17 00:00:00 2001 From: KnugiHK <24708955+KnugiHK@users.noreply.github.com> Date: Sun, 17 Dec 2023 14:40:08 +0800 Subject: [PATCH] Bug fix for the different between key file and hex key --- Whatsapp_Chat_Exporter/__main__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Whatsapp_Chat_Exporter/__main__.py b/Whatsapp_Chat_Exporter/__main__.py index dab039b..0a67026 100644 --- a/Whatsapp_Chat_Exporter/__main__.py +++ b/Whatsapp_Chat_Exporter/__main__.py @@ -1,5 +1,6 @@ #!/usr/bin/python3 +import io import os import sqlite3 import shutil @@ -267,7 +268,8 @@ def main(): if args.wab: wab = open(args.wab, "rb").read() error_wa = extract.decrypt_backup(wab, key, contact_db, crypt, args.showkey, DbType.CONTACT) - key.seek(0) + if isinstance(key, io.IOBase): + key.seek(0) else: error_wa = 0 error_message = extract.decrypt_backup(db, key, msg_db, crypt, args.showkey, DbType.MESSAGE)