ppwwyyxx / wechat-dump

Cracking encrypted wechat message history from android
GNU General Public License v3.0
1.65k stars 309 forks source link

decrypt-db.py fails when cipher_version contains non-digit strings #86

Open cuihaoleo opened 3 years ago

cuihaoleo commented 3 years ago

decrypt-db.py failed silently after "Trying key..." I let it raise the exception and found:

Traceback (most recent call last):
  File "./decrypt-db.py", line 184, in <module>
    do_decrypt(args.input, output_file, key)
  File "./decrypt-db.py", line 142, in do_decrypt
    version = tuple([int(x) for x in version_str.split(".")])
  File "./decrypt-db.py", line 142, in <listcomp>
    version = tuple([int(x) for x in version_str.split(".")])
ValueError: invalid literal for int() with base 10: '3 community'

This is the version_str I got before line 142: 4.4.3 community

Android 10 + WeChat version 8.0.2 from Google Play.

ppwwyyxx commented 3 years ago

Thanks! Could you send a fix?

It would also be a good idea to always print the errors about the failure, instead of failing silently.