ElDavoo / wa-crypt-tools

Manage WhatsApp .crypt12, .crypt14 and .crypt15 files.
GNU General Public License v3.0
583 stars 78 forks source link

WhatsApp-Crypt14: AttributeError: 'NoneType' object has no attribute 'message_types_by_name' #21

Closed UeliDragutin closed 2 years ago

UeliDragutin commented 2 years ago

Using the following command:

python ./decrypt14_15.py ./key ./msgstore.db.crypt14 ./msgstore.db

and was greet with the following error message:

File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\proto\C14_cipher_version_pb2.py", line 21, in _C14_CIPHER_VERSION = DESCRIPTOR.message_types_by_name['C14_cipher_version'] AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

The full details are as follows:

C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter>python ./decrypt14_15.py ./key ./msgstore.db.crypt14 ./msgstore.db [I] Crypt12/14 key loaded Traceback (most recent call last): File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\decrypt14_15.py", line 682, in main() File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\decrypt14_15.py", line 664, in main cipher = parse_protobuf(key=key, encrypted=args.encrypted) File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\decrypt14_15.py", line 470, in parse_protobuf import proto.prefix_pb2 as prefix File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\proto\prefix_pb2.py", line 15, in import proto.C14_cipher_pb2 as C14cipherpb2 File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\proto\C14_cipher_pb2.py", line 15, in import proto.C14_cipher_version_pb2 as C14cipherversion__pb2 File "C:\PyPortable\WhatsApp-Crypt14-Crypt15-Decrypter\proto\C14_cipher_version_pb2.py", line 21, in _C14_CIPHER_VERSION = DESCRIPTOR.message_types_by_name['C14_cipher_version'] AttributeError: 'NoneType' object has no attribute 'message_types_by_name'

Help needed, thanks.

ElDavoo commented 2 years ago

Hmmm, that's interesting. Which whatsapp version do you have? It looks like you have some issue with your protobuf library installation, so don't use protobuf parse mode: What happens when you use -np -v ?

ElDavoo commented 2 years ago

It looks like you have an old version of the protobuf library. As in requirements.txt, check if you have at least version 3.19.4.
From what i've read the program should work with at least protobuf 3.12.

UeliDragutin commented 2 years ago

Thanks, ElDavoo, will check on the library, hopefully can get back soon later before end of this month.

ElDavoo commented 2 years ago

I made some experiments, you need at least version 3.19.0 of the protobuf library. I added an exception handler for this case.