[PR #3099] [CLOSED] fix(frida): attach by PID when process lookup omits target #5614

Closed
opened 2026-10-31 01:07:59 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3099
Author: @LcokHcak
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: codex/frida-attach-pid-fix


📝 Commits (3)

  • 71b6706 fix(frida): attach by PID when process lookup omits target
  • cee3468 Merge remote-tracking branch 'origin/main' into HEAD
  • e592bc5 Merge remote-tracking branch 'origin/main' into HEAD

📊 Changes

2 files changed (+56 additions, -4 deletions)

View changed files

📝 src/application/frida/FridaInstrumentationManager.test.ts (+48 -1)
📝 src/frida/FridaInstrumentationManager.ts (+8 -3)

📄 Description

Problem

On a controlled Windows x64 Python fixture with Frida 17.23.2, enumerateProcesses() omitted the running PID and getProcessByPid(pid) returned Process not found, while device.attach(pid) succeeded. REA calls getProcessByPid before attach and therefore rejects a target that Frida can attach to.

Change

  • Keep the existing lookup-before-attach resource order, but treat a failed metadata lookup as nonfatal and use pid <PID> as the target label.
  • Attach the caller-selected PID even when Frida omits it from process enumeration.
  • Preserve real attach failures and the existing session cleanup path.

Verification

  • Two new manager regression tests first reproduced the false lookup failure, then verified the PID actually passed to attach() and preservation of a real attach error.
  • FridaInstrumentationManager.test.ts: 33/33 passed on the isolated branch based on upstream b3c5672c.
  • Full TypeScript typecheck, direct compile, targeted formatting, lint, and diff checks passed. Lint reports existing manager size/complexity warnings; compile reports two existing ineffective dynamic-import chunk warnings.
  • A real controlled Windows x64 run with the same production source at b7817bf8 attached the otherwise unlisted Python fixture, loaded two scripts, retained 20 attributed Frida messages, and observed the fixture's independent returns 42,17,42. The current 71b6706a adds only the test assertion that verifies the attach() argument. A separate local trace projection accepted 12 selected function/basic-block events; its saved-evidence verifier passed. This is one fixture and one host, not general Windows or target coverage.

No trace provider, script RPC, CLI/MCP operation, or target mutation workflow is added. The controlled raw capture remains local; no private binaries, credentials, or local paths are attached.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/3099 **Author:** [@LcokHcak](https://github.com/LcokHcak) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `codex/frida-attach-pid-fix` --- ### 📝 Commits (3) - [`71b6706`](https://github.com/morluto/rea/commit/71b6706a719c00e11e3df9c414ff76e6bc91ad1d) fix(frida): attach by PID when process lookup omits target - [`cee3468`](https://github.com/morluto/rea/commit/cee3468279976d46c9e5d634852aba1947e34739) Merge remote-tracking branch 'origin/main' into HEAD - [`e592bc5`](https://github.com/morluto/rea/commit/e592bc539ee84ea388f0dc8c2b7e27d85589d15c) Merge remote-tracking branch 'origin/main' into HEAD ### 📊 Changes **2 files changed** (+56 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/application/frida/FridaInstrumentationManager.test.ts` (+48 -1) 📝 `src/frida/FridaInstrumentationManager.ts` (+8 -3) </details> ### 📄 Description ## Problem On a controlled Windows x64 Python fixture with Frida 17.23.2, `enumerateProcesses()` omitted the running PID and `getProcessByPid(pid)` returned `Process not found`, while `device.attach(pid)` succeeded. REA calls `getProcessByPid` before `attach` and therefore rejects a target that Frida can attach to. ## Change - Keep the existing lookup-before-attach resource order, but treat a failed metadata lookup as nonfatal and use `pid <PID>` as the target label. - Attach the caller-selected PID even when Frida omits it from process enumeration. - Preserve real attach failures and the existing session cleanup path. ## Verification - Two new manager regression tests first reproduced the false lookup failure, then verified the PID actually passed to `attach()` and preservation of a real attach error. - `FridaInstrumentationManager.test.ts`: 33/33 passed on the isolated branch based on upstream `b3c5672c`. - Full TypeScript typecheck, direct compile, targeted formatting, lint, and diff checks passed. Lint reports existing manager size/complexity warnings; compile reports two existing ineffective dynamic-import chunk warnings. - A real controlled Windows x64 run with the same production source at `b7817bf8` attached the otherwise unlisted Python fixture, loaded two scripts, retained 20 attributed Frida messages, and observed the fixture's independent returns `42,17,42`. The current `71b6706a` adds only the test assertion that verifies the `attach()` argument. A separate local trace projection accepted 12 selected function/basic-block events; its saved-evidence verifier passed. This is one fixture and one host, not general Windows or target coverage. No trace provider, script RPC, CLI/MCP operation, or target mutation workflow is added. The controlled raw capture remains local; no private binaries, credentials, or local paths are attached. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-31 01:07:59 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#5614
No description provided.