Skip to content

Commit

Permalink
fix #16
Browse files Browse the repository at this point in the history
  • Loading branch information
REInject committed May 6, 2024
1 parent fc23716 commit b41ea2c
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,16 @@ fn read_bytes(pid: u32, addr: usize, size: usize) -> Result<Vec<u8>> {
}
}

fn get_proc_file_version(pid: u32) -> String {
fn get_proc_file_version(pid: u32) -> Option<String> {
unsafe {
tasklist::get_proc_file_info(pid)
.get("FileVersion")
.expect("read file version failed")
.to_string()
.cloned()
}
}

fn dump_wechat_info(pid: u32, special_data_dir: Option::<&PathBuf>) -> WechatInfo {
let version = get_proc_file_version(pid);
let version = get_proc_file_version(pid).unwrap_or_else(|| "unknown".to_owned());
println!("[+] wechat version is {}", version);

let pmis = procmem::get_mem_list(pid);
Expand Down Expand Up @@ -523,7 +522,7 @@ fn cli() -> clap::Command {
use clap::{arg, value_parser, Command};

Command::new("wechat-dump-rs")
.version("1.0.5")
.version("1.0.6")
.about("A wechat db dump tool")
.author("REinject")
.help_template("{name} ({version}) - {author}\n{about}\n{all-args}")
Expand Down

0 comments on commit b41ea2c

Please sign in to comment.