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

Commit 8396e10

Browse files
committed
fix #46.
1 parent c80dd0b commit 8396e10

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
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.23"
3+
version = "1.0.24"
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: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ const RULES_V3: &str = r#"
4848
rule GetDataDir_v3
4949
{
5050
strings:
51-
$a = /[a-zA-Z]:\\(.{1,100}?\\){0,1}?WeChat Files\\[0-9a-zA-Z_-]{6,20}?\\/
51+
$a = /([a-zA-Z]:\\|\\\\)([^\\:]{1,100}?\\){0,10}?WeChat Files\\[0-9a-zA-Z_-]{6,20}?\\/
5252
5353
condition:
5454
$a
@@ -59,7 +59,7 @@ const RULES_V4: &str = r#"
5959
rule GetDataDir
6060
{
6161
strings:
62-
$a = /[a-zA-Z]:\\(.{1,100}?\\){0,1}?xwechat_files\\[0-9a-zA-Z_-]{6,24}?\\db_storage\\/
62+
$a = /([a-zA-Z]:\\|\\\\)([^\\:]{1,100}?\\){0,10}?xwechat_files\\[0-9a-zA-Z_-]{6,24}?\\db_storage\\/
6363
6464
condition:
6565
$a
@@ -389,9 +389,10 @@ fn dump_wechat_info_v3(
389389
const AES_BLOCK_SIZE: usize = 16;
390390
const SALT_SIZE: usize = 16;
391391
const PAGE_SIZE: usize = 4096;
392-
let db_file_path = data_dir.clone() + "Msg\\Misc.db";
392+
let mut db_file_path = PathBuf::from(data_dir.clone());
393+
db_file_path.push(r"Msg\Misc.db");
393394
let mut db_file = std::fs::File::open(&db_file_path)
394-
.expect(format!("{} is not exsit", &db_file_path).as_str());
395+
.expect(format!("{} is not exsit", db_file_path.display()).as_str());
395396
let mut buf = [0u8; PAGE_SIZE];
396397
db_file.read(&mut buf[..]).expect("read Misc.db is failed");
397398

@@ -1079,7 +1080,7 @@ fn cli() -> clap::Command {
10791080
use clap::{arg, value_parser, Command};
10801081

10811082
Command::new("wechat-dump-rs")
1082-
.version("1.0.23")
1083+
.version("1.0.24")
10831084
.about("A wechat db dump tool")
10841085
.author("REinject")
10851086
.help_template("{name} ({version}) - {author}\n{about}\n{all-args}")

0 commit comments

Comments
 (0)