All Projects → ppwwyyxx → Wechat Dump

ppwwyyxx / Wechat Dump

Licence: gpl-3.0
Cracking encrypted wechat message history from android

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Wechat Dump

Lxspider
爬虫案例合集。包括但不限于《淘宝、京东、天猫、豆瓣、抖音、快手、微博、微信、阿里、头条、pdd、优酷、爱奇艺、携程、12306、58、搜狐、百度指数、维普万方、Zlibraty、Oalib、小说、招标网、采购网、小红书》
Stars: ✭ 60 (-94.98%)
Mutual labels:  wechat
Wechat
Wechat API wrapper in Elixir
Stars: ✭ 70 (-94.14%)
Mutual labels:  wechat
Hera
A framework for running WeChat applet. (小程序 SDK,小程序转 H5,小程序转安卓、iOS 原生应用、小程序渲染引擎)
Stars: ✭ 1,186 (-0.75%)
Mutual labels:  wechat
Miniweather
基于koa的微信公众号开发
Stars: ✭ 67 (-94.39%)
Mutual labels:  wechat
Wemark
微信小程序Markdown渲染库
Stars: ✭ 1,159 (-3.01%)
Mutual labels:  wechat
Qy Wechat Notification Plugin
企业微信Jenkins构建通知插件
Stars: ✭ 72 (-93.97%)
Mutual labels:  wechat
Revokemsgpatcher
A hex editor for WeChat/QQ/TIM - PC版微信/QQ/TIM防撤回补丁(我已经看到了,撤回也没用了)
Stars: ✭ 12,482 (+944.52%)
Mutual labels:  wechat
Fitness
Flutter 仿微博客户端!A Weibo client application developed with Flutter, which supports both Android and iOS.
Stars: ✭ 75 (-93.72%)
Mutual labels:  wechat
Wx
微信小程序摄影简介模块
Stars: ✭ 68 (-94.31%)
Mutual labels:  wechat
Mojo Weixin
使用Perl语言(不会没关系)编写的个人账号微信/weixin/wechat客户端框架(非GUI),可通过插件提供基于HTTP协议的api接口供其他语言或系统调用
Stars: ✭ 1,181 (-1.17%)
Mutual labels:  wechat
Offiaccount
[微信公众号] A fast wechat offiaccount development sdk written in Golang
Stars: ✭ 68 (-94.31%)
Mutual labels:  wechat
Gulp Wechat Webapp
基于gulp,以scss的方式写wxss,、提高开发效率的一个入门示例
Stars: ✭ 68 (-94.31%)
Mutual labels:  wechat
Wechatstepchanger
微信运动步数修改器
Stars: ✭ 72 (-93.97%)
Mutual labels:  wechat
Tinker app
Android热更新Tinker + 多渠道打包 + 加固的流程详解demo
Stars: ✭ 67 (-94.39%)
Mutual labels:  wechat
Wechat Pc Hook Ws
微信PcHooker websocket api
Stars: ✭ 74 (-93.81%)
Mutual labels:  wechat
Matrix
Matrix is a plugin style, non-invasive APM system developed by WeChat.
Stars: ✭ 9,357 (+683.01%)
Mutual labels:  wechat
Friendcircle
// 一起来撸个朋友圈吧
Stars: ✭ 1,167 (-2.34%)
Mutual labels:  wechat
Agora Miniapp Tutorial
Hello world for Agora SDK running in https://en.wikipedia.org/wiki/WeChat#WeChat_Mini_Program
Stars: ✭ 75 (-93.72%)
Mutual labels:  wechat
Wxapp Mall
微信小程序 商城demo
Stars: ✭ 1,190 (-0.42%)
Mutual labels:  wechat
Supermarketmini
基于wepy2.x 仿苏宁小店小程序,API采用go开发(已开源),项目正在开发中,欢迎加群:160301726
Stars: ✭ 73 (-93.89%)
Mutual labels:  wechat

Dump WeChat Messages from Android

导出安卓微信消息记录

WeChat, as the most popular mobile IM app in China, doesn't provide any options to export structured message history. This tool can decrypt and parse WeChat messages on a rooted android phone, and dump messages into self-contained html files including voice messages, images, emojis, videos, etc.

If the tool works for you, please take a moment to add your phone/OS to the wiki.

How to use:

Dependencies:

  • adb and rooted android phone connected to a Linux/Mac OSX/Win10+Bash. If the phone does not come with adb support, you can download an app such as https://play.google.com/store/apps/details?id=eu.chainfire.adbd
  • Python >= 3.6
  • sqlcipher >= 4.1
  • sox (command line tools)
  • Silk audio decoder (included; build it with ./third-party/compile_silk.sh)
  • Other python dependencies: pip install -r requirements.txt.

Get Necessary Data:

  1. Pull database file and (for older wechat versions) avatar index:
  • Automatic: ./android-interact.sh db. It may use an incorrect userid.
  • Manual:
    • Figure out your ${userid} by inspecting the contents of /data/data/com.tencent.mm/MicroMsg on the root filesystem of the device. It should be a 32-character-long name consisting of hexadecimal digits.
    • Get /data/data/com.tencent.mm/MicroMsg/${userid}/EnMicroMsg.db from the device.
  1. Decrypt database file:
  • Automatic: ./decrypt-db.py decrypt --input EnMicroMsg.db
  • Manual:
    • Get WeChat uin (an integer), possible ways are:

      • ./decrypt-db.py uin, which looks for uin in /data/data/com.tencent.mm/shared_prefs/
      • Login to web wechat, get wxuin=1234567 from document.cookie
    • Get your device id (a positive integer), possible ways are:

      • ./decrypt-db.py imei implements some ways to find device id.
      • Call *#06# on your phone
      • Find IMEI in system settings
    • Decrypt database with combination of uin and device id:

      ./decrypt-db.py decrypt --input EnMicroMsg.db --imei <device id> --uin <uin>
      

      NOTE: you may need to try different ways to get device id and find one that can decrypt the database. Some phones may have multiple IMEIs, you may need to try them all. See #33. The command will dump decrypted database at EnMicroMsg.db.decrypted.

If decryption doesn't work, you can also try the password cracker to brute-force the password.

  1. Copy the WeChat user resource directory /mnt/sdcard/tencent/MicroMsg/${userid}/{avatar,emoji,image2,sfs,video,voice2} from the phone to the resource directory:

    • ./android-interact.sh res
    • Change RES_DIR in the script if the location of these directories is different on your phone.
    • This can take a while. Can be faster to first archive it with tar with or without compression, and then copy the archive, busybox tar is recommended as the Android system's tar may choke on long paths.
    • In the end, we need a resource directory with the following subdir: avatar,emoji,image2,sfs,video,voice2.
  2. (Optional) Download the emoji cache from here and decompress it under wechat-dump. This will avoid downloading too many emojis during rendering.

     wget -c https://github.com/ppwwyyxx/wechat-dump/releases/download/0.1/emoji.cache.tar.bz2
     tar xf emoji.cache.tar.bz2
    

Run:

  • Parse and dump text messages of every chat (requires decrypted database):

    ./dump-msg.py decrypted.db output_dir
    
  • List all chats (required decrypted database):

    ./list-chats.py decrypted.db
    
  • Generate statistics report on text messages (requires output_dir from ./dump-msg.py):

    ./count-message.sh output_dir
    
  • Dump messages of one contact to html, containing voice messages, emojis, and images (requires decrypted database and resource):

    ./dump-html.py "<contact_display_name>"
    

    The output file is output.html.

    Check ./dump-html.py -h to use different paths.

Examples:

Screenshots of generated html:

byvoid

See here for an example html.

TODO List

  • Fix rare unhandled message types: > 10000 and < 0
  • Better user experiences... see grep 'TODO' wechat -R

Donate!

[paypal]
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].