8000 windows: Report exited processes without the mapper too by kkuehl · Pull Request #1302 · frida/frida-core · GitHub
[go: up one dir, main page]

Skip to content

windows: Report exited processes without the mapper too - #1302

Merged
oleavr merged 1 commit into
frida:mainfrom
kkuehl:fix/windows-exited-process-file-injection
Nov 23, 2026
Merged

oleavr merged 1 commit into
frida:mainfrom
kkuehl:fix/windows-exited-process-file-injection

Conversation

@kkuehl
@kkuehl kkuehl commented Nov 23, 2026
Copy link
Copy Markdown
Contributor

Follow-up to #1301, which I only tested with the mapper enabled. With --disable-mapper, the test it added fails:

not ok /HostSession/Windows/attach-to-exited-process - ... 'g_error_matches (_data_->e, FRIDA_ERROR, FRIDA_ERROR_PROCESS_NOT_FOUND)' should be TRUE

inject_library_file() has no check for a target that has exited, so attach() returns NOT_SUPPORTED, "Unexpected error allocating memory in target process (VirtualAllocEx returned 0x00000005)".

Fix

The same check inject_library_section() got in #1301: once the process is open, fail with PROCESS_NOT_FOUND if it has exited.

Verification

Windows Server 2025 x86_64, MSVC, --enable-tests --with-compat=disabled:

Build /HostSession/Windows/attach-to-exited-process Whole suite
--disable-mapper, main fails, with the error above 1 not ok, then bails out
--disable-mapper, this change passes, 25 runs out of 25 187 ok, 0 not ok
mapper enabled, this change passes, 10 runs out of 10 187 ok, 0 not ok

Not tested: x86 and arm64 targets, MinGW builds.

inject_library_file() still went on to allocate in a process that had
exited, and failed with "Unexpected error allocating memory in target
process". Only inject_library_section() checked for it, so
/HostSession/Windows/attach-to-exited-process fails when the mapper is
disabled.

Do the same check here.
@oleavr
oleavr force-pushed the fix/windows-exited-process-file-injection branch from d080ea4 to 4299608 Compare November 23, 2026 19:08
@oleavr
oleavr merged commit 4299608 into frida:main Nov 23, 2026
@oleavr
oleavr commented Nov 23, 2026
Copy link
Copy Markdown
Member

Thanks! 🙌

@kkuehl
kkuehl commented Nov 23, 2026 via email
Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

0