Injection: session-only auto re-attach on relaunch

Add an "Auto re-attach this game on relaunch" checkbox (default off, never
persisted, shown while attached or terminated). While on and the target has
terminated, the host polls the process list for the same image name and
re-injects the moment it reappears -- built on the existing
re-attach-by-image-name path, so there's no target to pick. The kill+relaunch
recovery for a wrong audio format: re-attaching early catches
IAudioClient::Initialize and reads the exact format.

Validated live (harness): inject coop_tone -> kill -> relaunch -> auto
re-injected into the new pid, and early enough that the format came back as
Exact. Trim README.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 02:03:13 +02:00
parent 32028cb286
commit b00b516cdb
4 changed files with 59 additions and 9 deletions

View File

@@ -144,6 +144,11 @@ std::string apply_test_command(const std::string& cmd, coop::UiState& ui, coop::
ui.debug_details = (arg(1) == "on");
return "ok";
}
if (v == "autoattach")
{
injection.dev_set_auto_reattach(arg(1) == "on");
return "ok";
}
if (v == "remeasure")
{
audio.dev_request_op(num(1), coop::AudioRingOp_Remeasure, 0, 0, 0, 0);