wechat-dump icon indicating copy to clipboard operation
wechat-dump copied to clipboard

SQLiteManager works, wechat-dump does not

Open msftsecurityteam opened this issue 4 years ago • 3 comments

Hi, as the issue is titled, I am running a Samsung S20 on Android 11, and the hardcoded 1234567890ABCDEF + UIN from system_config_prefs.xml generates a key "877f804" however I get the error "file is encrypted or is not a database" when running the decrypt-db.py script. If I use this same key with the SQLiteManager, it works.

msftsecurityteam avatar Nov 28 '20 20:11 msftsecurityteam

I don't want to still your thread but could you please describe precisely which steps you are doing and on which platform/version. I see strange things too and I'm trying to decrypt my database.

Also, regarding your issue, there are some reports of problem of sqlcipher on some Linux Ubuntu system. Are you on Ubuntu?

gregoiregentil avatar Nov 29 '20 06:11 gregoiregentil

One possibility is that wechat upgraded their sqlcipher compat version at some version. We set it to 1 here: https://github.com/ppwwyyxx/wechat-dump/blob/6b501914203c32bd3b7754ac4f96fea6f1a29e99/decrypt-db.py#L142

maybe worth trying other versions

ppwwyyxx avatar Nov 29 '20 07:11 ppwwyyxx

I can open the EnMicroMsg.db using sqlite database browser (Version2.1 - SQLCipher Version).

but cannot decrypt the data by decrypt_db_with_password.py, the error is database disk image is malformed

The output_db.db file is 2.7M, and the original file has 800M.

password is correct system is Ubuntu or debian uin is a negative number wechat version 8.0.2

decrypt_db_with_password.py param

    c.execute("PRAGMA key = '" + key + "';")
    c.execute("PRAGMA cipher_compatibility = 1;")
    c.execute("PRAGMA cipher_use_hmac = OFF;")
    c.execute("PRAGMA cipher_page_size = 1024;")
    c.execute("PRAGMA kdf_iter = 4000;")

@gregoiregentil @ppwwyyxx

It's my file that is missing, it's normal to copy it again

ellermister avatar Mar 20 '22 06:03 ellermister