From 582424bd94cd230adf1ab2ba9405940f0502c996 Mon Sep 17 00:00:00 2001 From: owendswang Date: Mon, 24 Aug 2026 23:57:42 +0800 Subject: [PATCH] Fixed base game PKG install --- homebrew/PKGInstall/pkg_install.c | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/homebrew/PKGInstall/pkg_install.c b/homebrew/PKGInstall/pkg_install.c index a559975..e12ba33 100644 --- a/homebrew/PKGInstall/pkg_install.c +++ b/homebrew/PKGInstall/pkg_install.c @@ -14,7 +14,10 @@ You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, see . */ +#include +#include #include +#include typedef struct pkg_metadata { const char* uri; @@ -23,8 +26,13 @@ typedef struct pkg_metadata { const char* content_id; const char* content_name; const char* icon_url; + uint32_t slot; + uint32_t is_playgo_enabled; } pkg_metadata_t; +_Static_assert(sizeof(pkg_metadata_t) == 0x38, + "sceAppInstUtil metadata ABI mismatch"); + typedef struct pkg_info { char content_id[48]; @@ -34,12 +42,15 @@ typedef struct pkg_info { typedef struct playgo_info { - char lang[8][30]; - char scenario_ids[3][64]; - char content_ids[64]; + char languages[30][8]; + char scenario_ids[64][3]; + char content_ids[64][48]; long unknown[810]; } playgo_info_t; +_Static_assert(sizeof(playgo_info_t) == 0x2700, + "sceAppInstUtil PlayGoInfo ABI mismatch"); + int sceAppInstUtilInitialize(void); int sceAppInstUtilInstallByPackage(const pkg_metadata_t*, pkg_info_t*, playgo_info_t*); @@ -47,6 +58,8 @@ int sceAppInstUtilInstallByPackage(const pkg_metadata_t*, pkg_info_t*, playgo_in int main(int argc, char** argv) { + char install_path[PATH_MAX + sizeof("/user")]; + const char* uri; playgo_info_t playgoinfo = {0}; pkg_info_t pkginfo = {0}; pkg_metadata_t metainfo = { @@ -55,7 +68,9 @@ main(int argc, char** argv) { .content_id = "", .icon_url = "", .ex_uri = "", - .uri = "" + .uri = "", + .slot = 0, + .is_playgo_enabled = 0 }; if(argc < 2) { @@ -67,7 +82,12 @@ main(int argc, char** argv) { return -1; } - metainfo.uri = argv[1]; + uri = argv[1]; + if(!strncmp(uri, "/data/", 6)) { + snprintf(install_path, sizeof(install_path), "/user%s", uri); + uri = install_path; + } + metainfo.uri = uri; return sceAppInstUtilInstallByPackage(&metainfo, &pkginfo, &playgoinfo); }