ttttupup / wxhelper

Hook WeChat / 微信逆向
MIT License
2.22k stars 605 forks source link

v3.9.5.81 downloadAttach code -2 #384

Closed HyperClockUp closed 6 months ago

HyperClockUp commented 6 months ago

Describe the bug

$ curl -X POST -H "Content-Type: application/json" -d '{"msgId":853169676348430208}' http://127.0.0.1:19088/api/downloadAttach
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    68  100    40  100    28  44150  30905 --:--:-- --:--:-- --:--:-- 68000
{"code":-2,"data":null,"msg":"success"}

To Reproduce Steps to reproduce the behavior:

  1. inject and run code
  2. send image/file to robot
  3. call downloadAttach
  4. get error code -2

Screenshots image

Question How to download image successfully? Or what is the correct process for downloading images?

ttttupup commented 6 months ago

msgid not found .the msgid in your example is incorrect.it is a 64-bit integer.

HyperClockUp commented 6 months ago

thank you!! you are right, i checked raw message and found that msgId is "8355831940407814566", but when parsing into json in nodejs, BigInt still lost some bits, so i got "8355831940407814144n". And then when i called toString, it became "8355831940407814144"!