mirror of https://github.com/jackwener/wx-cli.git
fix: handle exited PIDs and narrow message DB keys
parent
f9c338b48d
commit
872e3f58dc
|
|
@ -146,6 +146,9 @@ def main():
|
|||
except PermissionError:
|
||||
print(f"[WARN] 无法读取 /proc/{pid}/maps,权限不足,跳过")
|
||||
continue
|
||||
except (FileNotFoundError, ProcessLookupError):
|
||||
print(f"[WARN] PID {pid} 已退出,跳过")
|
||||
continue
|
||||
|
||||
total_bytes = sum(s for _, s in regions)
|
||||
total_mb = total_bytes / 1024 / 1024
|
||||
|
|
@ -157,6 +160,9 @@ def main():
|
|||
except PermissionError:
|
||||
print(f"[WARN] 无法打开 /proc/{pid}/mem,权限不足,跳过")
|
||||
continue
|
||||
except (FileNotFoundError, ProcessLookupError):
|
||||
print(f"[WARN] PID {pid} 已退出,跳过")
|
||||
continue
|
||||
|
||||
try:
|
||||
for reg_idx, (base, size) in enumerate(regions):
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ Based on FastMCP (stdio transport), reuses existing decryption.
|
|||
Runs on Windows Python (needs access to D:\ WeChat databases).
|
||||
"""
|
||||
|
||||
import os, sys, json, time, sqlite3, tempfile, struct, hashlib, atexit
|
||||
import os, sys, json, time, sqlite3, tempfile, struct, hashlib, atexit, re
|
||||
import hmac as hmac_mod
|
||||
from datetime import datetime
|
||||
from Crypto.Cipher import AES
|
||||
|
|
@ -335,8 +335,7 @@ def _parse_message_content(content, local_type, is_group):
|
|||
MSG_DB_KEYS = sorted([
|
||||
k for k in ALL_KEYS
|
||||
if any(v.startswith("message/") for v in key_path_variants(k))
|
||||
and any(v.endswith(".db") for v in key_path_variants(k))
|
||||
and "fts" not in k and "resource" not in k
|
||||
and any(re.search(r"message_\d+\.db$", v) for v in key_path_variants(k))
|
||||
])
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue