mirror of
https://github.com/knutwurst/patchdl.git
synced 2026-10-14 16:01:00 +02:00
Standalone PS5 payload with an embedded web UI on :12880, no etaHEN. - Scans installed titles and classifies the source (genuine install, ShadowMountPlus mount, preinstall, unknown) from the on-disk layout. - Reads name, installed version and the Sony version.xml URL from the PS5 app database (vendored SQLite). - Resolves version.xml past nanoDNS via a raw DNS query, TLS pinned to the SCEI DNAS root. - Filters patches to the newest one compatible with the current firmware. - Downloads the patch and installs it through AppInstUtil (sysmodule loaded at runtime), gated to genuine installs with a package title-id match guard. - Action-based UI filters and an on-screen startup notification with the URL.
51 lines
1.1 KiB
C
51 lines
1.1 KiB
C
#include <signal.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <unistd.h>
|
|
|
|
#include "patchdl_notify.h"
|
|
#include "patchdl_proc.h"
|
|
#include "patchdl_version.h"
|
|
#include "patchdl_websrv.h"
|
|
|
|
#ifndef PATCHDL_HTTP_PORT
|
|
#define PATCHDL_HTTP_PORT 12880
|
|
#endif
|
|
|
|
#define PATCHDL_PROC_NAME "patchdl.elf"
|
|
|
|
int
|
|
main(int argc, char** argv) {
|
|
unsigned short port = PATCHDL_HTTP_PORT;
|
|
|
|
if(argc > 1) {
|
|
int requested_port = atoi(argv[1]);
|
|
if(requested_port > 0 && requested_port <= 65535) {
|
|
port = (unsigned short)requested_port;
|
|
}
|
|
}
|
|
|
|
signal(SIGPIPE, SIG_IGN);
|
|
|
|
/* Identify ourselves in the PS5 process list and replace any stale
|
|
instance so re-deploys are idempotent and the HTTP port is free. */
|
|
patchdl_proc_set_name(PATCHDL_PROC_NAME);
|
|
patchdl_proc_kill_others(PATCHDL_PROC_NAME);
|
|
|
|
printf("PatchDL v%s starting web UI on port %u\n", PATCHDL_VERSION, port);
|
|
|
|
if(patchdl_websrv_start(port)) {
|
|
puts("PatchDL web server failed to start");
|
|
return 1;
|
|
}
|
|
|
|
/* On-screen debug notification with the URL to open. */
|
|
patchdl_notify_startup(port);
|
|
|
|
while(1) {
|
|
sleep(60);
|
|
}
|
|
|
|
return 0;
|
|
}
|