ppwwyyxx / wechat-dump

Cracking encrypted wechat message history from android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TypeError: can't concat JavaInt to bytes

opened this issue · comments

Hello, friends!

I am trying to decrypt the database. At the moment I am trying the automatic mode:

There is some error in converting uin to bytes, or vice-versa:

[09:42:48 39@decrypt-db.py:wechat] found uin=123 in system_config_prefs.xml
[09:42:48 54@decrypt-db.py:wechat] found uin=123 in com.tencent.mm_preferences.xml
[09:42:48 69@decrypt-db.py:wechat] found uin=123 in auth_info_key_prefs.xml
[09:42:48 78@decrypt-db.py:wechat] found uin=123 in systemInfo.cfg
[09:42:48 82@decrypt-db.py:wechat] Possible uin: ['123', 123]
[09:42:48 106@decrypt-db.py:wechat] found imei=567 from iphonesubinfo
[09:42:48 118@decrypt-db.py:wechat] found imei=1234567890ABCDEF in CompatibleInfo.cfg
[09:42:48 120@decrypt-db.py:wechat] Possible imei: ['567', '1234567890ABCDEF', '1234567890ABCDEF']
imei= b'567'
uin = b'123'
[09:42:48 179@decrypt-db.py:wechat] Trying key X ...
[09:42:48 148@decrypt-db.py:wechat] Decryption failed: 'file is encrypted or is not a database'
imei= b'1234567890ABCDEF'
uin = b'123'
[09:42:48 179@decrypt-db.py:wechat] Trying key Y ...
[09:42:48 148@decrypt-db.py:wechat] Decryption failed: 'file is encrypted or is not a database'
imei= b'868717039481775'
uin = 123
Traceback (most recent call last):
  File "/home/lockywolf/OfficialRepos/wechat-dump/decrypt-db.py", line 178, in <module>
    key = get_key(imei, uin)
  File "/home/lockywolf/OfficialRepos/wechat-dump/decrypt-db.py", line 135, in get_key
    a = md5(imei + uin)
TypeError: can't concat JavaInt to bytes

What is really expected here? Byte-to-byte concatenation, or addition?

concatenation is expected

changing

        uin = javaobj.loads(out).get(1, 0)

to

        uin = int(javaobj.loads(out).get(1, 0))

might solve it. Can you give it a try?

Yes, did it. Seems to solve this particular problem.
(Decryption still fails though)

Fixed, afaiu.