CloudRedirect Documentation
repository·master·Indexed 18 days ago
https://github.com/selectively11/cloudredirectCloudRedirect provides cloud save synchronization for 'lua' games (non-owned AppIDs) by redirecting Steam Cloud RPC calls to external providers including Google Drive, OneDrive, Cloudflare R2, S3-Compatible storage, and local folders. It includes the cloudredirect-cli (STFixer) Rust port for applying patches to SteamTools.exe and managing core DLLs, as well as a C++ and WPF-based implementation for Windows and a Flatpak-based configuration for Linux.
What's inside CloudRedirect
- CloudRedirect provides "Steam Cloud" functionality for 'lua' games (games that use Steam's Lua-based AppID system, often used for DLC unlocking). It redirects Steam Cloud requests for these games to external cloud providers like Google Drive or OneDrive, including support for Steam AutoCloud games. This allows users to sync saves for games that do not natively support Steam Cloud.
How CloudRedirect works
masterCloudRedirect operates by intercepting Steam's internal cloud save RPC handlers.
On Windows: It uses a C++ DLL and a WPF companion app. The companion app copies the DLL to your Steam folder and handles cloud provider authentication. The DLL hooks Steam's internal handlers to intercept read/write calls. If a game is owned, it uses standard Steam Cloud; if it is a 'lua' game, the DLL redirects the data to your chosen cloud provider.
On Linux: It uses a library loaded at Steam startup and a Flatpak application for configuration.
Setup and usage on Linux
master- Install the necessary components using the following command:
curl -fsSL headcrab.pages.dev | bash - Open the CloudRedirect app and sign into your chosen provider.
- Edit your
SLSsteamconfig file:- Set
DisableCloudtoNo. - Specify the games you want to sync under the
AdditionalAppskey.
- Set
- Launch Steam.
- Install the necessary components using the following command:
Setup and usage on Windows
master- Download the latest release from the GitHub Releases page.
- Run the
CloudRedirect.exe. - Select your mode:
STfixermode: For fixing SteamTools bugs.CloudRedirectmode: For standard cloud redirection.
- In the Setup tab, click 'Run All Patches'.
- Go to the Cloud Provider tab, select your provider, and sign in.
- Launch Steam.
Build CloudRedirect on Linux from source
masterBuilding on Linux requires specific environment constraints:
- glibc requirement: You must build against
glibc 2.31or older (e.g., Ubuntu 20.04, Debian 11). - Toolchain: GCC 12 and 32-bit multilib are required if building on Ubuntu 20.04.
- CMake: A modern version of CMake is required (system versions may be too old).
Build Command: When running CMake, you must specify the 32-bit flag:
-DLINUX_32BIT=ONNote: It is highly recommended to use Distrobox to manage these specific environment requirements.
- glibc requirement: You must build against
Build CloudRedirect on Windows from source
masterPrerequisites
- Visual Studio 2022 (or Build Tools) with C++ and .NET 8 workloads
- CMake 3.20+
Build Steps
Run the following commands to build the C++ DLL and the WPF application:
cmake -B build -G "Visual Studio 17 2022" -A x64 cmake --build build --config ReleaseOutputs:
- C++ DLL:
build/Release/cloud_redirect.dll - WPF App:
ui/bin/publish/CloudRedirect.exe(The DLL is automatically embedded into this executable).
How CloudRedirect manages cloud providers
masterCloudRedirect uses a provider-based model to abstract different cloud storage services.
Key Concepts
- Active Provider: The provider currently configured in
config.json. If no cloud provider is selected, it defaults tolocal. - Provider Labels: While internal keys might be short (e.g.,
gdrive), theproviderLabel(provider)method returns human-readable names (e.g.,Google Drive). - Authentication: Providers can be authenticated via OAuth (using
startOAuth(provider)) or via direct credential files (S3/R2). TheproviderAuthenticatedproperty indicates if the current provider is ready for use. - Scanning: The
scanProvider(provider)method triggers a full scan of a provider's cloud storage via the CLIscan-allcommand to identify existing cloud backups.
- Active Provider: The provider currently configured in
Google Drive path mapping and structure
masterWhen using the Google Drive provider, CloudRedirect maps flat logical paths to a specific folder hierarchy within Google Drive.
Logical Path Format:
{accountId}/{appId}/blobs/{filename}Google Drive Hierarchy:
CloudRedirect/{accountId}/{appId}/...This mapping ensures that files are organized under a root
CloudRedirectfolder, subdivided by account and application IDs.How the STFixer patching flow works
masterThe
Patcherimplements a multi-stage workflow to ensure SteamTools operates correctly in an offline-setup environment:- Core DLL Discovery & Repair: It scans the Steam directory for
xinput1_4.dllordwmapi.dll. If they are missing or have incorrect hashes, it downloads verified versions fromcatbox.moe(with anaaasn.comfallback). - Steam Version Validation: It uses
steam_detectorto ensure the installed Steam version is supported to prevent corruption ofsteamclient64.dll. - Core DLL Patching: It identifies the SteamTools Core DLL, resolves patch offsets via signature scanning, and applies byte-level patches.
- Payload Cache Patching:
- It locates the encrypted payload cache.
- If the cache is missing or corrupted, it deploys an embedded payload.
- It decrypts the payload (AES-CBC), decompresses it (Zlib), applies activation patches, and then re-encrypts/re-compresses it using the original IV to maintain compatibility with SteamTools.
- Executable Patching: It modifies
SteamTools.exeat a specific offset (0x282F0) to change the prologue frompush rbp; ret; noptoret; nop, effectively disabling the core DLL redeployment logic.
- Core DLL Discovery & Repair: It scans the Steam directory for
Use the CloudRedirect CLI for provider management
masterThe CloudRedirect CLI allows you to manage cloud providers, remote applications, and blobs directly from the command line. All command output is returned as JSON to stdout.
Exit Codes:
0: Success1: Error
Execution Syntax:
- Windows:
cloud_redirect_cli.exe <command> [args...] - Linux:
cloud_redirect_cli <command> [args...]
# Example usage pattern cloud_redirect_cli list-remote-apps <provider>Use the CloudRedirect CLI
masterThe CloudRedirect CLI is invoked using the
--cliflag followed by a specific command and its required arguments. The CLI outputs results in JSON format. A successful operation is indicated by an exit code of0and a JSON response containing"success":trueor"authenticated":true.Supported providers include:
gdrive,onedrive,r2, ands3.cloud_redirect --cli <command> [args...]Configure HTTP transport options
masterWhen using custom or internal cloud storage (like MinIO or Garage), you can configure the HTTP transport to allow insecure connections or custom certificate authorities using the
TransportOptionsstruct.Key options:
allowInsecureHttp: Set totrueto permit plaintexthttp://connections.allowInsecureTls: Set totrueto skip TLS certificate verification (useful for self-signed certificates).caCertPath: Provide a path to a custom CA bundle for internal CAs.
TransportOptions options; options.allowInsecureHttp = true; options.allowInsecureTls = true; options.caCertPath = "/path/to/ca-bundle.crt"; transport->SetOptions(options);