wx_core/wx_scanner/
mod.rs1use std::fmt::{Debug, Formatter};
2
3#[cfg(windows)]
4mod on_windows;
5#[cfg(target_os = "macos")]
6mod on_macos;
7#[cfg(target_os = "linux")]
8mod on_linux;
9
10#[derive(Default)]
12pub struct WeChatProfile {
13 pub version: String,
15 pub user_name: String,
17 pub nick_name: String,
19 pub mobile: String,
21 pub email: String,
23 pub aes256: [u8; 32],
25}
26
27#[cfg(windows)]
29#[derive(Debug, Default)]
30pub struct WxScanner {
31 pub profile: WeChatProfile,
33 process: windows::Win32::System::Diagnostics::ToolHelp::PROCESSENTRY32,
34 handle: windows::Win32::Foundation::HANDLE,
35 module: windows::Win32::System::Diagnostics::ToolHelp::MODULEENTRY32,
36}
37
38#[cfg(target_os = "macos")]
39#[derive(Debug, Default)]
40pub struct WxScanner {
41 pub profile: WeChatProfile,
43}
44
45
46#[cfg(target_os = "linux")]
47#[derive(Debug, Default)]
48pub struct WxScanner {
49 pub profile: WeChatProfile,
51}
52
53impl Debug for WeChatProfile {
54 fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
55 let hex_string: String = self.aes256.iter().map(|byte| format!("{:02X}", byte)).collect();
56 f.debug_struct("WeChatProfile")
57 .field("version", &self.version)
58 .field("user_name", &self.user_name)
59 .field("nick_name", &self.nick_name)
60 .field("mobile", &self.mobile)
61 .field("email", &self.email)
62 .field("key", &hex_string)
63 .finish()
64 }
65}