[platform] fix linux findWmpfProcess to select root process - #271
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new loop does repeated linear parent lookups and depends on the parent process being present in the enumerated list, which can be avoided with a PID set-based root check for better reliability and efficiency.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR updates the Linux platform process-selection logic to reliably identify the root WeChatAppEx process in newer WeChat (4.1.1.4) process trees, preventing frida.attach() from targeting a non-root subprocess and failing with “Process not found”.
Changes:
- Replaces the prior PPID-frequency heuristic with a parent-process-based root selection for
WeChatAppExon Linux. - Computes the WMPF version from the selected process’ executable path and returns
{ pid, version }.
File summaries
| File | Description |
|---|---|
| src/platform/linux.ts | Updates Linux findWmpfProcess() root PID selection logic for multi-process WeChatAppEx trees. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
感谢指出,看来 Windows 和 Linux 这边不太一样。Linux 这边还有一个 flatpak 的分发途径可能需要处理一下。我先 merge 你这个 PR 然后再让那边 rebase 一下。感谢🙏 |
在 Linux 微信 4.1.1.4 中,
WeChatAppEx的进程树包含 renderer、GPU、utility、zygote、broker 等子进程,其 PPID 指向各种中间WeChatAppEx节点。原有的频率启发式方法会选错,而父进程名检查能正确选中PID → wechat的根进程,避免frida.attach()报 "Process not found" 错误。修复后在 Ubuntu 22.04,微信 4.1.1.4(14910)可用(同时建议尽快合并#264)