ppwwyyxx / wechat-dump

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

Stickers/emojis don't show up #28

Closed alexandru-grigoras closed 8 years ago

alexandru-grigoras commented 8 years ago

Amazing job with this tool! I truly appreciate your effort, this was really nicely done. (By the way, used it on Windows 10 + Bash, worked perfectly.)

Now, about the issue. In my conversations, only the internal_emoji stickers work, all the others fail to load. The reason is that they show up as "data:image/None" in HTML, which I traced back to the imghdr library which seems to be unable to identify the type of these files.

All of these stickers do have a base64 encoding present, so everything else in your code seems to be working fine (or at least as expected). However, I don't know if the encoding is actually good. I attempted to decode as PNG/JPEG/GIF and it was all without luck. My guess is that the sticker files need further preprocessing done on them before encoding them to base64.

Unfortunately, I know nothing about the way WeChat stores its stickers, and the binary files were of little help to me, since I could not find any documentation online. From your code, it seems that you understand them and I also noticed a TODO there. So, do you know how to fix this issue? Do any stickers work for you? Is it possible that some packages work and others do not?

I am very curious to find out more. Once again, great job! These tools are amazing.

ppwwyyxx commented 8 years ago

It's possible they change the format. I will take at look at this soon.

ppwwyyxx commented 8 years ago

Just curious, does android-interact.sh (fetch and decrypt data) work on Win10+Bash as well?

ppwwyyxx commented 8 years ago

I couldn't figure out the file format of the animated sticker at the moment. The recent commit 049e3c3387cc35188261c6925aaf94cacdbc149c use a static version of the sticker instead. But some emoji doesn't have that either.

I'm attaching two files here if someone would like to help investigate.

sticker.zip

alexandru-grigoras commented 8 years ago

Yes, everything worked perfectly fine :) The dependencies were a tiny bit problematic, but not too big of an issue. One small problem is the fact that some people's names contain strange characters, or extra spaces at the end, so it was a bit difficult to type them directly in bash in order to dump the HTML. A quick fix was by typing the command in a .sh file and then running it.  I'll take a look at what you sent me :)

On Wednesday, June 1, 2016 9:34 PM, Yuxin Wu <notifications@github.com> wrote:

I couldn't figure out the file format of the animated sticker at the moment. The recent commit 049e3c3 use a static version of the sticker instead. But some emoji doesn't have that either.I'm attaching two files here if someone would like to help investigate.sticker.zip— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

ppwwyyxx commented 8 years ago

I'm certain that those files are plain gif/png files, but with the first 1KB encrypted somehow. One solution is to use the filename (a md5) to query the EmojiInfo table for the cdnUrl field, and then use that url to download the emoji.

ppwwyyxx commented 8 years ago

Fixed by recent commits. Now it will download the emojis by cdnUrl. You can avoid most download by using a cache I put in release . Details in README.