The host can now inject coop_hook.dll into a running game and forward controller state to it over shared memory, so the game reads the host's (eventually the guest's) input and nothing else. - hook/: coop_hook.dll. DllMain spawns a worker that opens the shared-memory channel (named by the game's pid) and installs SafetyHook inline hooks on XInputGetState/GetStateEx/GetCapabilities/SetState. Detours synthesize state from shared memory; unmanaged slots report disconnected, hiding physical pads. - host/: process picker (Toolhelp32), CreateRemoteThread(LoadLibraryW) injector with an IsWow64Process2 bitness guard, IPC server publishing pads each frame, and an ImGui Injection panel wiring it together. - tests/: hook_selftest exercises the IPC seqlock + hook detours in-process (no game/controller needed); passes. Build: SafetyHook wired in (COOP_BUILD_HOOK=ON), Zydis via FetchContent. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
23 lines
455 B
CMake
23 lines
455 B
CMake
add_executable(coop_host WIN32
|
|
src/main.cpp
|
|
src/d3d11_window.cpp
|
|
src/imgui_layer.cpp
|
|
src/debug_overlay.cpp
|
|
src/injection_panel.cpp
|
|
src/input/xinput_source.cpp
|
|
src/inject/process_list.cpp
|
|
src/inject/injector.cpp
|
|
src/ipc/ipc_server.cpp)
|
|
|
|
target_include_directories(coop_host PRIVATE src)
|
|
|
|
target_link_libraries(coop_host PRIVATE
|
|
coop_common
|
|
imgui
|
|
d3d11
|
|
dxgi
|
|
dwmapi
|
|
xinput)
|
|
|
|
set_target_properties(coop_host PROPERTIES OUTPUT_NAME "coop_host")
|