@@ -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