From 18d0438c41fc7f7fc4268ed942b6e011189326fe Mon Sep 17 00:00:00 2001 From: Pavel <68122101+red-prig@users.noreply.github.com> Date: Tue, 10 Oct 2023 17:21:38 +0300 Subject: [PATCH] + --- sys/kern/kern_authinfo.pas | 51 ++++++++++++++++++++++++-------------- sys/kern/kern_exec.pas | 7 +++--- 2 files changed, 36 insertions(+), 22 deletions(-) diff --git a/sys/kern/kern_authinfo.pas b/sys/kern/kern_authinfo.pas index 9acc8ded..cc15e157 100644 --- a/sys/kern/kern_authinfo.pas +++ b/sys/kern/kern_authinfo.pas @@ -53,7 +53,16 @@ const type TCUSANAME=array[0..9] of AnsiChar; - //[preload_lib] -> sceSysmodulePreloadModuleForLibkernel +const + //SceLncAppType + SCE_LNC_APP_TYPE_INVALID =-1; + SCE_LNC_APP_TYPE_SHELL_UI= 1; + SCE_LNC_APP_TYPE_DAEMON = 2; + SCE_LNC_APP_TYPE_CDLG = 3; + SCE_LNC_APP_TYPE_MINI_APP= 4; + SCE_LNC_APP_TYPE_BIG_APP = 5; + + //[preloadPrxFlags] -> sceSysmodulePreloadModuleForLibkernel //0x0000000004 libSceNet //0x0000000008 libSceIpmi //0x0000000010 libSceMbus @@ -89,26 +98,30 @@ type //0x2000000000 libSceNpGameIntent //0x4000000000 libSceNpWebApi2 +type + t_title_workaround=packed record + version:Integer; + align :Integer; + ids :array[0..1] of QWORD; + end; + p_appinfo=^t_appinfo; t_appinfo=packed record - AppId :Integer; //4 - mmap_flags :Integer; //4 - excp_flags :Integer; //4 - AppType :Integer; //4 5? - CUSANAME :TCUSANAME; //10 - debug_level:Byte; //1 - slv_flags :Byte; //1 eLoadOptions - f_1c :Byte; - f_1d :Byte; - f_1e :Byte; - f_1f :Byte; - preload_lib:QWORD; - f_28 :Integer; - f_2c :Integer; - f_30 :Integer; - f_34 :Integer; - f_38 :QWORD; - f_40 :QWORD; + AppId :Integer; //4 + mmap_flags :Integer; //4 + attributeExe :Integer; //4 + AppType :Integer; //4 SceLncAppType + CUSANAME :TCUSANAME; //10 titleId + debug_level :Byte; //1 + slv_flags :Byte; //1 eLoadOptions + budget_flags :Byte; + debug_out :Byte; + f_1e :Byte; + requiredHdcpType:Byte; + preloadPrxFlags :QWORD; + attribute :Integer; + hasParamSfo :Integer; + titleWorkaround :t_title_workaround; end; {$IF sizeof(t_appinfo)<>72}{$STOP sizeof(t_appinfo)<>72}{$ENDIF} diff --git a/sys/kern/kern_exec.pas b/sys/kern/kern_exec.pas index ef9af2d6..99818131 100644 --- a/sys/kern/kern_exec.pas +++ b/sys/kern/kern_exec.pas @@ -1212,7 +1212,7 @@ begin Exit(0); end; -procedure init_tty; +procedure init_tty; //TODO before execve begin kern_openat(STDIN_FILENO ,'/dev/deci_stdin' ,UIO_SYSSPACE,O_RDWR,0); kern_openat(STDOUT_FILENO,'/dev/deci_stdout',UIO_SYSSPACE,O_RDWR,0); @@ -1444,16 +1444,17 @@ begin //copy authinfo g_authinfo:=imgp^.authinfo; - //copy appinfo + //copy appinfo (TODO before execve) g_appinfo.mmap_flags:=g_appinfo.mmap_flags or 1; //is_big_app ??? if (p_proc.p_sce_replay_exec<>0) then begin g_appinfo.mmap_flags:=g_appinfo.mmap_flags or 2; //is_system ??? end; + g_appinfo.AppType:=SCE_LNC_APP_TYPE_BIG_APP; //TODO load CUSANAME - //init std tty + //init std tty (TODO before execve) init_tty; {