Skip to content

feat: add Diversion shadow module and ensure CloudRedirect compatibility - #193

Closed
mmxlyo wants to merge 4 commits into
OpenSteam001:mainfrom
mmxlyo:sy
Closed

mmxlyo wants to merge 4 commits into
OpenSteam001:mainfrom
mmxlyo:sy

Conversation

@mmxlyo

@mmxlyo mmxlyo commented Sep 8, 2026

Copy link
Copy Markdown

Fixes #191

  • Clone steamclient64.dll into bin\diversion64.dll and load as client_hModule with fallback
  • Transparently redirect GetModuleHandleA/W/ExA/ExW to diversion64.dll for CR compatibility
  • Hook LoadModuleWithPath with g_HooksInstalled atomic synchronization barrier
  • Enhance CloudRedirectHost library lookup order and logging

- Clone steamclient64.dll into bin\diversion64.dll and load as client_hModule with fallback
- Transparently redirect GetModuleHandleA/W/ExA/ExW to diversion64.dll for CR compatibility
- Hook LoadModuleWithPath with g_HooksInstalled atomic synchronization barrier
- Enhance CloudRedirectHost library lookup order and logging
@Iwf10310

Iwf10310 commented Sep 9, 2026

Copy link
Copy Markdown

Can this prevent the latest Capcom games from crashing on launch?

@mmxlyo

mmxlyo commented Sep 9, 2026

Copy link
Copy Markdown
Author

Can this prevent the latest Capcom games from crashing on launch?

Onimusha and Dragon's Dogma 2 are working fine now. The others still need to be tested.

…timeout

- Prioritize loading <sha256>.toml local cache before attempting remote download
- Eliminate 24s network timeout blocking SteamUI from loading unhooked steamclient64.dll
- Update PatternLoader and IPCLoader logs from 'cache fallback' to 'cache'
aitronz added a commit to aitronz/OpenSteamTool-exp that referenced this pull request Sep 13, 2026
…he atomicity

- SteamUI hooks:
  - Fix string length matching in IsSteamClientPath/W (17 for steamclient64.dll, 15 for steamclient.dll)
  - Abort diversion and return original handle on LoadModuleWithPath timeout to prevent race conditions
  - Lower hook initialization polling interval from 100ms to 10ms to reduce startup latency
  - Implement Win32 contract validation and refcount management in hkGetModuleHandleExA/W
  - Add lock-free atomic guard for pending removals in RunFrame to eliminate UI thread lock contention
  - Ensure idempotent system Detour attach/detach and synchronize with transaction commit

- Runtime & DllMain:
  - Clone and inspect diversion module using wide Win32 APIs (CopyFileW, GetFileAttributesExW)
  - Break diversion copy retry loop early on non-sharing errors
  - Pin module in memory via GetModuleHandleExA PIN flag to prevent premature unloading
  - Skip thread joins and Detour cleanup on process termination (pvReserved check) to avoid loader-lock deadlocks
  - Use explicit memory_order acquire/release semantics for runtime atomic state flags

- RemoteToml cache:
  - Implement atomic cache writes using PID-isolated temp files and MoveFileExW replacement
  - Defer cache directory creation until HTTP 200 is confirmed to prevent empty directories
  - Clean up temporary files on rename failure

- CloudRedirectHost:
  - Safe error-code based library existence checks and path resolution
  - Null out all function pointers and module handles on shutdown to prevent dangling calls
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