Skip to content
This repository was archived by the owner on Jan 9, 2026. It is now read-only.

Commit 09e0d3b

Browse files
committed
Merge branch 'v4' into no-phone
2 parents ca3d6c0 + 1267afc commit 09e0d3b

File tree

13 files changed

+2476
-1065
lines changed

13 files changed

+2476
-1065
lines changed

Cargo.toml

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
22
name = "wechat-dump-rs"
3-
version = "1.0.25-no-phone"
3+
version = "1.0.29-no-phone"
44
edition = "2021"
5+
repository = "https://github.com/0xlane/wechat-dump-rs"
56

67
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
78

@@ -12,31 +13,5 @@ lto = true
1213
codegen-units = 1
1314

1415
[dependencies]
15-
aes = "0.8.3"
16-
anyhow = "1.0.75"
17-
cbc = "0.1.2"
1816
clap = "4.4.3"
19-
hex = "0.4.3"
20-
hmac = "0.12.1"
21-
pbkdf2 = { version = "0.12.2", features = ["sha1", "sha2"] }
22-
sha1 = "0.10.5"
23-
windows = { version = "0.58.0", features = [
24-
"implement",
25-
"Win32_Security",
26-
"Win32_System_WindowsProgramming",
27-
"Win32_System_Com",
28-
"Win32_System_Memory",
29-
"Win32_System_Threading",
30-
"Win32_Foundation",
31-
"Win32_System_ProcessStatus",
32-
"Win32_System_Diagnostics_Debug",
33-
"Win32_System_Diagnostics_ToolHelp",
34-
"Wdk_System_Threading",
35-
"Win32_System_Kernel",
36-
"Win32_Storage_FileSystem"
37-
] }
38-
yara = { version = "0.29.0", features = ["yara-static", "vendored"] }
39-
rayon = "1.10"
40-
sha2 = "0.10.8"
41-
regex = "1.11.1"
42-
indicatif = { version = "0.17.9", features = ["rayon"] }
17+
wxdump= { path = "./wxdump/" }

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ wechat-dump-rs.exe -k xxxxxxxxxxxxxxxxx -f c:\users\xxxx\xxxx\contact.db -r --vv
6969
1. ~~微信登录设备类型基本只有 iphone、android,在内存中先搜到设备类型所在内存,key 就在它的前面,向前搜就行~~
7070
2. ~~key 的内存地址和登录设备类型据我观察是 16 字节对齐的,所以每次向前 16 字节~~
7171

72+
> **微信 4.0 的 key 借助了用户绑定的国内手机号定位,未绑定手机号的参考 [#41](https://github.com/0xlane/wechat-dump-rs/issues/41),绑定国外手机号的参考 [#29](https://github.com/0xlane/wechat-dump-rs/issues/29)**
73+
7274
还有其它一些小细节,直接看一下代码吧。
7375

7476
## 已测试版本列表
@@ -90,11 +92,16 @@ wechat-dump-rs.exe -k xxxxxxxxxxxxxxxxx -f c:\users\xxxx\xxxx\contact.db -r --vv
9092
- 4.0.0.35
9193
- 4.0.1.11
9294
- 4.0.1.13
95+
- 4.0.1.17
96+
- 4.0.1.21
97+
- 4.0.2.17
9398

9499
## 库表结构
95100

96101
- [4.0.0.26](docs/wechat_4_0_0_26_table_struct.md)
97102

103+
> 4.0 聊天记录内容解析参考示例 [导出聊天记录到TXT](./sample_scripts/导出聊天记录到TXT/)
104+
98105
## 微信分析记录
99106

100107
- [微信3.9手动寻找偏移](docs/wechat_3_9_analysis.md)

docs/wechat_4_0_0_26_table_struct.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,21 @@
44
55
## login
66

7+
用户登录相关
8+
79
### key_info.db
810

11+
用户认证信息相关
12+
913
```sql
1014
CREATE TABLE LoginKeyInfoTable(user_name_md5 TEXT, key_md5 TEXT, key_info_md5 TEXT, key_info_data BLOB)
1115
CREATE UNIQUE INDEX LoginKeyInfoTable_USER_KEYINFO ON LoginKeyInfoTable(user_name_md5, key_info_md5)
1216
```
1317

1418
## biz
1519

20+
公众号相关
21+
1622
### biz.db
1723

1824
```sql
@@ -21,8 +27,12 @@ CREATE TABLE biz_pay_status(url_id TEXT, is_charge_appmsg INTEGER, is_paid INTEG
2127

2228
## contact
2329

30+
联系人相关
31+
2432
### contact.db
2533

34+
联系人数据库,包括在微信里你能看到的各种群、群成员、通讯录、公众号的信息。
35+
2636
```sql
2737
CREATE TABLE biz_info(id INTEGER PRIMARY KEY, username TEXT, type INTEGER, accept_type INTEGER, child_type INTEGER, version INTEGER, external_info TEXT, brand_info TEXT, brand_icon_url TEXT, brand_list TEXT, brand_flag INTEGER, belong TEXT, ext_buffer BLOB)
2838
CREATE TABLE biz_profile(username TEXT, service_type INTEGER, article_count INTEGER, friend_sub_count INTEGER, is_subscribe INTEGER, offset TEXT, time_stamp INTEGER, is_end INTEGER, resp_buffer BLOB)
@@ -94,6 +104,8 @@ CREATE INDEX wacontact_APPID ON wacontact(app_id)
94104

95105
## emoticon
96106

107+
表情包相关
108+
97109
### emoticon.db
98110

99111
```sql
@@ -115,6 +127,8 @@ CREATE UNIQUE INDEX kStoreEmoticonPackageTable_PID ON kStoreEmoticonPackageTable
115127

116128
## favorite
117129

130+
收藏
131+
118132
### favorite.db
119133

120134
```sql
@@ -179,6 +193,8 @@ CREATE INDEX video_hardlink_info_v3_MODIFY_TIME ON video_hardlink_info_v3(modify
179193

180194
## head_image
181195

196+
用户头像相关
197+
182198
### head_image.db
183199

184200
```sql
@@ -195,8 +211,36 @@ CREATE TABLE ilink_voip(wx_chatroom_ TEXT PRIMARY KEY, millsecond_ INTEGER, grou
195211

196212
## message
197213

214+
存储聊天记录相关。聊天消息内容存储在 `message_[0-9].db` 数据库的 `Msg_md5(username)` 表的 `message_content` 字段,`username``contact` 表根据 `nickname` 查询。
215+
216+
`local_type``message_content` 对照关系:
217+
218+
|`local_type`|消息类型|`message_content`格式|
219+
|---|----|-----|
220+
|1|文本消息|plain|
221+
|3|图片消息|zstd_compress(xml)|
222+
|34|语音消息|zstd_compress|
223+
|42|名片消息|zstd_compress|
224+
|43|视频消息|zstd_compress|
225+
|47|动画表情|zstd_compress(xml)|
226+
|48|位置消息|zstd_compress|
227+
|244813135921|引用消息|zstd_compress(xml)|
228+
|17179869233|卡片式链接(带描述)|zstd_compress(xml)|
229+
|21474836529|卡片式链接/图文消息|zstd_compress(xml)|
230+
|154618822705|小程序分享|zstd_compress(xml)|
231+
|12884901937|音乐卡片|zstd_compress|
232+
|8594229559345|红包卡片|zstd_compress|
233+
|81604378673|聊天记录合并转发消息|zstd_compress|
234+
|266287972401|拍一拍消息|zstd_compress|
235+
|8589934592049|转账卡片|zstd_compress|
236+
|270582939697|视频号直播卡片|zstd_compress|
237+
|25769803825|文件消息|zstd_compress|
238+
|10000|系统消息(撤回、加入群聊、群管理、群语音通话等)|plain or zstd_compress(xml)|
239+
198240
### biz_message_0.db
199241

242+
公众号消息记录
243+
200244
```sql
201245
CREATE TABLE DeleteInfo(chat_name_id INTEGER, delete_table_name TEXT, CONSTRAINT UNIQUE_CHAT_DELETE UNIQUE(chat_name_id, delete_table_name))
202246
CREATE TABLE DeleteResInfo(local_id INTEGER PRIMARY KEY AUTOINCREMENT, session_name_id INTEGER, msg_create_time INTEGER, msg_local_id INTEGER, res_path TEXT)
@@ -216,6 +260,8 @@ CREATE INDEX Msg_02628fb4b062917ee2a9d4d7bde609ad_TYPE_SEQ ON Msg_02628fb4b06291
216260

217261
### media_0.db
218262

263+
语音消息内容
264+
219265
```sql
220266
CREATE TABLE Name2Id(user_name TEXT PRIMARY KEY)
221267
CREATE TABLE TimeStamp(timestamp INTEGER)
@@ -226,6 +272,8 @@ CREATE UNIQUE INDEX VoiceInfo_UNIQUE_INDEX ON VoiceInfo(chat_name_id, create_tim
226272

227273
### message_0.db
228274

275+
聊天记录
276+
229277
```sql
230278
CREATE TABLE DeleteInfo(chat_name_id INTEGER, delete_table_name TEXT, CONSTRAINT UNIQUE_CHAT_DELETE UNIQUE(chat_name_id, delete_table_name))
231279
CREATE TABLE DeleteResInfo(local_id INTEGER PRIMARY KEY AUTOINCREMENT, session_name_id INTEGER, msg_create_time INTEGER, msg_local_id INTEGER, res_path TEXT)
@@ -265,6 +313,8 @@ CREATE TABLE table_info(Key TEXT PRIMARY KEY, ValueInt64 INTEGER, ValueDouble RE
265313

266314
### message_revoke.db
267315

316+
该数据库只存储本人撤回的消息,不存其他人撤回的消息
317+
268318
```sql
269319
CREATE TABLE revokemessage(to_user_name TEXT, svr_id INTEGER, message_type INTEGER, revoke_time INTEGER, content TEXT, at_user_list TEXT)
270320
CREATE INDEX revokemessage_revoke_time ON revokemessage(revoke_time)
@@ -281,6 +331,8 @@ CREATE TABLE new_tips(unique_id TEXT PRIMARY KEY, disable INTEGER, new_tips_cont
281331

282332
## session
283333

334+
窗口会话
335+
284336
### session.db
285337

286338
```sql
@@ -292,6 +344,8 @@ CREATE INDEX SessionTable_TYPE ON SessionTable(type)
292344

293345
## sns
294346

347+
朋友圈相关
348+
295349
### sns.db
296350

297351
```sql

sample_scripts/readme.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 示例脚本
2+
3+
脚本只做示例参考使用,如需扩展请 fork 后自行修改。

0 commit comments

Comments
 (0)