- Add Linux memory scanner (`find_all_keys_linux.py`) using `/proc/<pid>/mem`, same approach as Windows/macOS — no GDB, no function offsets, no restart needed - Extract Windows-specific code to `find_all_keys_windows.py` - Make `find_all_keys.py` a platform dispatcher (Windows / Linux) - Add `key_utils.py` for cross-platform path matching (`/` vs `\` in all_keys.json) - Update `config.py` with Linux auto-detection of db_storage paths - Update all consumers (decrypt_db, monitor, monitor_web, mcp_server) to use `get_key_info()` for platform-agnostic key lookup Tested on remote Linux container: 15/15 DBs scanned, decrypted, and verified.
30 lines
614 B
Python
30 lines
614 B
Python
import platform
|
|
import sys
|
|
|
|
|
|
def _load_impl():
|
|
system = platform.system().lower()
|
|
if system == "windows":
|
|
import find_all_keys_windows as impl
|
|
return impl
|
|
if system == "linux":
|
|
import find_all_keys_linux as impl
|
|
return impl
|
|
raise RuntimeError(f"当前平台暂不支持通过 find_all_keys.py 提取密钥: {platform.system()}")
|
|
|
|
|
|
def get_pids():
|
|
return _load_impl().get_pids()
|
|
|
|
|
|
def main():
|
|
return _load_impl().main()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
try:
|
|
main()
|
|
except RuntimeError as exc:
|
|
print(f"\n[ERROR] {exc}")
|
|
sys.exit(1)
|