fix(rockstar): serve launcher pipes named by the executables beside a protected game

This commit is contained in:
maxjivi05 committed 2026-11-13 18:26:29 -05:00
1 parent 6d1a0d9fd0
commit 22afb0b797
4 files changed
+88 -9

No files matched your search

+1
View File
@@ -95,6 +95,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
- Battle.net is by [@kayakyakr](https://github.com/kayakyakr). It runs Blizzard's own client in Proton (downloaded from Blizzard, not included) and shows key art from the [Battle.net Shop](https://shop.battle.net). Without Steam, its games see the pad as an Xbox 360 controller via `PROTON_SPOOF_STEAMINPUT_VIDPID` in [Proton](https://github.com/ValveSoftware/wine)'s `dlls/winebus.sys`.
- The EA store follows the EA app's protocols as documented by [ArmchairDevelopers](https://github.com/ArmchairDevelopers)' [Maxima](https://github.com/ArmchairDevelopers/Maxima) (GPL-3.0): sign-in, the GraphQL queries (included verbatim, since EA matches them by hash), build archives, online activation licences and the LSX game endpoint. The code is DroidDeck's own.
- Battle.net installs drive Blizzard's Agent the way [@barncastle](https://github.com/barncastle)'s [Battle.Net-Installer](https://github.com/barncastle/Battle.Net-Installer) does, with requests from [wowdev.wiki](https://wowdev.wiki/Agent). Read without taking code: [@mubaraknumann](https://github.com/mubaraknumann)'s [unifideck](https://github.com/mubaraknumann/unifideck), [@djmittens](https://github.com/djmittens)'s [neo-mittens](https://github.com/djmittens/neo-mittens) `bnetswitch`, [@BCD1210](https://github.com/BCD1210)'s [soju](https://github.com/BCD1210/soju) and [Lutris](https://github.com/lutris/lutris)'s `product.db` reader.
- The Rockstar launcher service looks for launcher pipe names in the executables beside the game, since [CitizenFX](https://github.com/citizenfx/fivem)'s `ros-patches-five` shows GTA V opening `GTAVLauncher_Pipe` and [@pingod](https://github.com/pingod)'s [rdr2-linux-launcher](https://github.com/pingod/rdr2-linux-launcher) notes that Rockstar's protected executables resolve such strings only at run time. Read without taking code.
- World of Warcraft addon imports replace an addon's folder from a temporary copy, as [WowUp](https://github.com/WowUp/WowUp) does, and read flavour folders the way [WoWDeck](https://github.com/sigboe/wowdeck) does. No code from either is used.
- The World of Warcraft addon Download window searches [WoWInterface](https://www.wowinterface.com) through its MMOUI API. [CurseForge](https://www.curseforge.com/wow) opens in the user's browser, with no API and no key.
- Xbox games load [@domsvoboda](https://github.com/domsvoboda)'s [xodus-nexus](https://github.com/domsvoboda/xodus-nexus) modules (LGPL-2.1-or-later), including `wintypes.dll`. Minecraft's GameInput setup was checked against [@Wyze3306](https://github.com/Wyze3306)'s [BedrockOnLinux](https://github.com/Wyze3306/BedrockOnLinux) (MIT).
+1 -1
View File
@@ -6,7 +6,7 @@ The handoff is mode 0600, expires after 90 seconds and is deleted before startin
GTA III, Vice City and San Andreas use body-length MTLX replies. GTA IV and L.A. Noire use total-length, terminated replies. Titles with installed Social Club metadata or SDK binaries use the SDK IPC adapter, including user-info, login, ticket, initialization and authorized title-state synchronization. The title metadata supplies the ROS identity and principal executable; it is checked against Rockstar's catalog before title authorization. Other titles retain Play and Steam shortcuts and attempt the normal executable launch path.
The SDK runtime is extracted from the game's own Social-Club-Setup.exe when present. Architecture-specific payloads are staged into the prefix, archive paths and sizes are checked, interrupted copies are retried, and both registry views are registered. The helper discovers launcher identity pipe names in the game executable and answers bounded INIT challenges from the launched process. No vendor executables or runtime files are bundled with this tool. SDK initialization has a 90-second deadline. SDK wire tests and fixture clients do not establish gameplay compatibility for every title; per-title ROS ticket exchange and secondary SDK channels remain unverified.
The SDK runtime is extracted from the game's own Social-Club-Setup.exe when present. Architecture-specific payloads are staged into the prefix, archive paths and sizes are checked, interrupted copies are retried, and both registry views are registered. The helper discovers launcher identity pipe names in the game executable and the executables beside it, because protected game executables resolve that name only at run time, and answers bounded INIT challenges from the launched process. No vendor executables or runtime files are bundled with this tool. SDK initialization has a 90-second deadline. SDK wire tests and fixture clients do not establish gameplay compatibility for every title; per-title ROS ticket exchange and secondary SDK channels remain unverified.
GTA III defaults to full x87 precision for FEX before Wine starts, because reduced precision crashed new-game initialization on the test device. San Andreas defaults to WineD3D, because DXVK intermittently corrupted its textures; full precision and conservative memory ordering did not prevent that corruption. These defaults use DroidDeck's per-game settings and preserve explicit per-game overrides.
+85 -5
View File
@@ -1,5 +1,7 @@
use std::collections::BTreeSet;
use std::fs::{self, File};
use std::io::{self, Read};
use std::path::Path;
const LIMIT: usize = 4096;
@@ -34,8 +36,36 @@ fn collect(bytes: &[u8], names: &mut BTreeSet<String>) {
}
}
pub fn pipe_names(reader: &mut impl Read) -> io::Result<Vec<String>> {
pub fn title_pipe_names(exe: &Path) -> io::Result<Vec<String>> {
let mut names = BTreeSet::new();
scan(&mut File::open(exe)?, &mut names)?;
let Some(folder) = exe.parent() else {
return Ok(names.into_iter().collect());
};
let mut siblings = Vec::new();
for entry in fs::read_dir(folder)? {
let entry = entry?;
let path = entry.path();
if entry.file_type()?.is_file()
&& path != exe
&& path
.extension()
.is_some_and(|extension| extension.eq_ignore_ascii_case("exe"))
{
siblings.push(path);
}
}
if siblings.len() > 32 {
return Err(invalid());
}
siblings.sort();
for path in siblings {
scan(&mut File::open(path)?, &mut names)?;
}
Ok(names.into_iter().collect())
}
fn scan(reader: &mut impl Read, names: &mut BTreeSet<String>) -> io::Result<()> {
let mut carry = Vec::new();
let mut chunk = [0; 65536];
let mut total = 0usize;
@@ -49,20 +79,20 @@ pub fn pipe_names(reader: &mut impl Read) -> io::Result<Vec<String>> {
return Err(invalid());
}
carry.extend_from_slice(&chunk[..count]);
collect(&carry, &mut names);
collect(&carry, names);
for offset in 0..2 {
let ascii: Vec<_> = carry[offset..]
.chunks_exact(2)
.map(|pair| if pair[1] == 0 { pair[0] } else { 0 })
.collect();
collect(&ascii, &mut names);
collect(&ascii, names);
}
if names.len() > 4 {
return Err(invalid());
}
carry.drain(..carry.len().saturating_sub(256));
}
Ok(names.into_iter().collect())
Ok(())
}
pub fn exchange(reader: &mut impl Read) -> io::Result<Vec<u8>> {
@@ -134,12 +164,62 @@ mod tests {
}
bytes.extend_from_slice(br"\\.\pipe\..\outsideLauncherPipe");
bytes.push(0);
let mut names = BTreeSet::new();
scan(&mut Cursor::new(bytes), &mut names).unwrap();
assert_eq!(
pipe_names(&mut Cursor::new(bytes)).unwrap(),
names.into_iter().collect::<Vec<_>>(),
["GameLauncherPipe", "OtherLauncher_Pipe"]
);
}
fn folder(name: &str) -> std::path::PathBuf {
let path =
std::env::temp_dir().join(format!("droiddeck-identity-{name}-{}", std::process::id()));
let _ = fs::remove_dir_all(&path);
fs::create_dir(&path).unwrap();
path
}
#[test]
fn title_names_include_sibling_launcher_executables() {
let root = folder("siblings");
let game = root.join("Game.exe");
fs::write(&game, b"MZ obfuscated").unwrap();
fs::write(
root.join("TitleLauncher.exe"),
[br"MZ \\.\pipe\TitleLauncher_Pipe".as_slice(), b"\0"].concat(),
)
.unwrap();
fs::write(
root.join("Data.dat"),
[br"\\.\pipe\DataLauncher_Pipe".as_slice(), b"\0"].concat(),
)
.unwrap();
fs::create_dir(root.join("Folder.exe")).unwrap();
let names = title_pipe_names(&game).unwrap();
fs::remove_dir_all(&root).unwrap();
assert_eq!(names, ["TitleLauncher_Pipe"]);
}
#[test]
fn title_names_keep_the_game_executable_names_and_limits() {
let root = folder("principal");
let game = root.join("Game.exe");
fs::write(
&game,
[br"MZ \\.\pipe\GameLauncherPipe".as_slice(), b"\0"].concat(),
)
.unwrap();
fs::write(root.join("Tool.exe"), b"MZ plain").unwrap();
assert_eq!(title_pipe_names(&game).unwrap(), ["GameLauncherPipe"]);
for index in 0..32 {
fs::write(root.join(format!("Extra{index}.exe")), b"MZ").unwrap();
}
let crowded = title_pipe_names(&game);
fs::remove_dir_all(&root).unwrap();
assert!(crowded.is_err());
}
#[test]
fn identity_replies_echo_only_a_valid_challenge() {
struct Split<R>(R);
+1 -3
View File
@@ -147,9 +147,7 @@ fn run() -> Result<i32, Box<dyn std::error::Error>> {
};
let mut identity_listeners = Vec::new();
if session.is_some() {
for name in
droiddeck_rockstar_launcher::identity::pipe_names(&mut std::fs::File::open(&exe)?)?
{
for name in droiddeck_rockstar_launcher::identity::title_pipe_names(&exe)? {
identity_listeners.push(Listener::new(&name, Duration::from_secs(90))?);
}
}