mirror of
https://github.com/MoHadiShibli/Control4Free.git
synced 2026-10-06 10:00:28 +02:00
A GoldHEN ELF payload that creates virtual DualShock 4 controllers with scePadVirtualDevice*, the path Remote Play uses, so they work on the home screen, at sign-in and in games. A phone or PC drives them from a page the payload serves on port 4264. - Stage 0 (default) is the browser controller: four slots, explicit creation, native PS4 user selection, input over a WebSocket. - Stages 1-8 are the diagnostics that established the VDA call order. - Loopback-only /api/status and /api/stop for the launcher app. - The klog connection is reopened when a controller is created, so a start through GoldHEN AutoRun still works if it beats the klog server. The VDA code is ported from seregonwar/SplashDown (GPL-3.0).
14 lines
613 B
Python
14 lines
613 B
Python
"""Deterministically embed the standalone phone client in the payload."""
|
|
import gzip
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
source, output = map(Path, sys.argv[1:])
|
|
data = gzip.compress(source.read_bytes(), compresslevel=9, mtime=0)
|
|
lines = ["/* Generated by tools/embed_client.py. */", "#include <stddef.h>",
|
|
"const unsigned char c4fPage[] = {"]
|
|
lines.extend(" " + ",".join(str(n) for n in data[i:i+24]) + "," for i in range(0, len(data), 24))
|
|
lines.extend(["};", "const size_t c4fPageSize = sizeof(c4fPage);", ""])
|
|
output.parent.mkdir(parents=True, exist_ok=True)
|
|
output.write_text("\n".join(lines))
|