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

Commit 05bc8a1

Browse files
committed
Support to finding weixin4.0 key when no bind phone.
1 parent d7f6f48 commit 05bc8a1

File tree

2 files changed

+5
-59
lines changed

2 files changed

+5
-59
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "wechat-dump-rs"
3-
version = "1.0.22"
3+
version = "1.0.22-no-phone"
44
edition = "2021"
55

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

src/main.rs

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -494,56 +494,6 @@ fn dump_wechat_info_v4(
494494
.expect("Should have compiled rules");
495495
let results = rules.scan_process(pid, 0).expect("Should have scanned");
496496

497-
let phone_str_match = results
498-
.iter()
499-
.filter(|x| x.identifier == "GetPhoneNumberOffset")
500-
.next()
501-
.expect("unbale to find phone string")
502-
.strings
503-
.iter()
504-
.filter(|x| {
505-
x.matches.iter().any(|y| {
506-
wechat_writeable_private_mem_infos
507-
.iter()
508-
.any(|z| y.base == z.base)
509-
})
510-
})
511-
.next()
512-
.expect("unbale to find phone string")
513-
.matches
514-
.iter()
515-
.filter(|x| {
516-
wechat_writeable_private_mem_infos
517-
.iter()
518-
.any(|y| x.base == y.base)
519-
})
520-
.next()
521-
.expect("unable to find phone string");
522-
523-
// let key_memory_info = wechat_writeable_private_mem_infos
524-
// .iter()
525-
// .find(|v| v.base == phone_str_match.base)
526-
// .unwrap();
527-
// let key_search_range = 0..key_memory_info.base + key_memory_info.region_size;
528-
529-
let nick_name_length = u64::from_le_bytes(phone_str_match.data[..8].try_into().unwrap());
530-
let phone_str_address = phone_str_match.base + phone_str_match.offset + 0x10;
531-
let phone_str = read_string(pid, phone_str_address, 11).unwrap();
532-
println!("[+] found phone at 0x{:x} --> {}********", phone_str_address, &phone_str[..3]);
533-
let nick_name =
534-
read_string_or_ptr(pid, phone_str_address - 0x20, nick_name_length as usize).unwrap();
535-
536-
let account_name_length = read_number::<u64>(pid, phone_str_address - 0x30).unwrap();
537-
let mut account_name =
538-
read_string_or_ptr(pid, phone_str_address - 0x40, account_name_length as _).unwrap();
539-
540-
// No account name
541-
if account_name.is_empty() {
542-
let wxid_length = read_number::<u64>(pid, phone_str_address - 0x50).unwrap();
543-
let wxid = read_string_or_ptr(pid, phone_str_address - 0x60, wxid_length as _).unwrap();
544-
account_name = wxid;
545-
}
546-
547497
let data_dir = if special_data_dir.is_some() {
548498
special_data_dir
549499
.unwrap()
@@ -634,10 +584,6 @@ rule GetKeyAddrStub
634584
}
635585

636586
let mut pre_addresses: HashSet<u64> = HashSet::new();
637-
key_stub_str_addresses.sort_by(|&a, &b| {
638-
a.abs_diff(phone_str_address as _)
639-
.cmp(&b.abs_diff(phone_str_address as _))
640-
});
641587
for cur_stub_addr in key_stub_str_addresses {
642588
// if cur_stub_addr < key_search_range.end as _ {
643589
if wechat_writeable_private_mem_infos.iter().any(|v| {
@@ -754,9 +700,9 @@ rule GetKeyAddrStub
754700
WechatInfo {
755701
pid,
756702
version,
757-
account_name,
758-
nick_name: Some(nick_name),
759-
phone: Some(phone_str),
703+
account_name: "Unknown".to_owned(),
704+
nick_name: Some("Unknown".to_owned()),
705+
phone: Some("Unknown".to_owned()),
760706
data_dir,
761707
key: key,
762708
}
@@ -1077,7 +1023,7 @@ fn cli() -> clap::Command {
10771023
use clap::{arg, value_parser, Command};
10781024

10791025
Command::new("wechat-dump-rs")
1080-
.version("1.0.22")
1026+
.version("1.0.22-no-phone")
10811027
.about("A wechat db dump tool")
10821028
.author("REinject")
10831029
.help_template("{name} ({version}) - {author}\n{about}\n{all-args}")

0 commit comments

Comments
 (0)