whatsapp-web-reveng icon indicating copy to clipboard operation
whatsapp-web-reveng copied to clipboard

whatsappWriteBinary error

Open likeforreal opened this issue 5 years ago • 2 comments
trafficstars

Traceback (most recent call last): File "send.py", line 437, in sendTextMessage("xxxxxxxx","hello"); File "send.py", line 428, in sendTextMessage first = base64.b64encode(whatsappWriteBinary(msgData)); File "send.py", line 374, in whatsappWriteBinary stream.writeNode(node); File "send.py", line 245, in writeNode self.writeChildren(node[2]); File "send.py", line 314, in writeChildren self.writeNode(c); File "send.py", line 239, in writeNode raise ValueError("invalid node"); ValueError: invalid node

["action", {"epoch": "14", "type": "relay"},[{"status": "PENDING", "message": {"conversation": "hello"}, "key": {"remoteJid": "[email protected]", "fromMe": True, "id": "3EB06FD60499245EBD85"}, "messageTimestamp": "1577523727"}]]

i can't make whatsappWriteBinary() for this json ????

likeforreal avatar Dec 28 '19 09:12 likeforreal

messageTag = str(getTimestamp()) param = {"status": "PENDING", "message": {"conversation": "hello"}, "key": {"remoteJid": "[email protected]", "fromMe": True, "id": "3EB05581DCD50E0A5B89"}, "messageTimestamp": "1577532498"} TXT = ["action", {"epoch": "11", "type": "relay"}, [WAWebMessageInfo.encode(param)]] payload = bytearray(to_bytes(16, 1)) + bytearray([0x80]) first = base64.b64encode(whatsappWriteBinary(TXT));

im used this code

likeforreal avatar Dec 28 '19 12:12 likeforreal

I have the same issue, it looks like some data is not supported, for example when loading or sending messages (I tested in a group). Here is an example of the data when sending a message to a group: ['action', {'epoch': '2', 'type': 'relay'}, [{u'status': u'PENDING', u'message': {u'conversation': u'test 0123456789'}, u'key': {u'remoteJid': u'[email protected]', u'fromMe': True, u'id': u'XXX'}, u'messageTimestamp': u'XXX'}]] I have a test script here (you just need to configure the variables at the top of the file, comment the decryptedMessage lines and uncomment the encryptedMessage lines at the end of the file): https://pastebin.com/hNBeEqgv

Does someone have an idea how to fix the issue? Maybe this other project does not have the issue in libs/whatsapp_write.py, I did not test yet: https://github.com/romanzaikin/BurpExtension-WhatsApp-Decryption-CheckPoint/tree/master/helper I noticed that the data that fails is like u'XXX', the u is maybe what is causing the problem in my case and the other project is doing something like .replace("u'","'") (doing just this is not enough but they are using a variable char_diff also).

baptx avatar Jul 02 '21 19:07 baptx