From 641d0d3f7f1a7ebe1e3293681fc3e415f5aece6a Mon Sep 17 00:00:00 2001 From: red-prig Date: Wed, 21 Dec 2022 20:34:45 +0300 Subject: [PATCH] sceSysmoduleIsLoadedInternal --- kernel/ps4_libkernel.pas | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/kernel/ps4_libkernel.pas b/kernel/ps4_libkernel.pas index 01782615..67107004 100644 --- a/kernel/ps4_libkernel.pas +++ b/kernel/ps4_libkernel.pas @@ -729,32 +729,50 @@ end; {$I libsysmodule.inc} -function ps4_sceSysmoduleLoadModule(id:Word):Integer; SysV_ABI_CDecl; +function ps4_sceSysmoduleLoadModule(id:DWord):Integer; SysV_ABI_CDecl; begin + if (Word(id)=0) then Exit(-2141581312); + if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(-2141581312); + Writeln('sceSysmoduleLoadModule:',GetSysmoduleName(id)); Result:=0; end; -function ps4_sceSysmoduleUnloadModule(id:Word):Integer; SysV_ABI_CDecl; +function ps4_sceSysmoduleUnloadModule(id:DWord):Integer; SysV_ABI_CDecl; begin + if (Word(id)=0) then Exit(-2141581312); + Writeln('sceSysmoduleUnloadModule:',GetSysmoduleName(id)); Result:=0; end; -function ps4_sceSysmoduleIsLoaded(id:Word):Integer; SysV_ABI_CDecl; +function ps4_sceSysmoduleIsLoaded(id:DWord):Integer; SysV_ABI_CDecl; begin + if (Word(id)=0) then Exit(-2141581312); + Writeln('sceSysmoduleIsLoaded:',GetSysmoduleName(id)); - Result:=0; + Result:=0; //0 -> loaded ; -2141581311 -> not loaded end; // +function ps4_sceSysmoduleIsLoadedInternal(id:DWord):Integer; SysV_ABI_CDecl; +begin + if ((id or $80000000)=$80000000) then Exit(-2141581312); + + Writeln('sceSysmoduleIsLoadedInternal:',GetSysmoduleName(id)); + Result:=0; //0 -> loaded ; -2141581311 -> not loaded +end; + function ps4_sceSysmoduleLoadModuleInternalWithArg(id:Word; argc:size_t; argp:PPointer; flags:DWORD; pRes:PInteger):Integer; SysV_ABI_CDecl; begin + if ((id or $80000000)=$80000000) or (flags<>0) then Exit(-2141581312); + if ((Word(id)=$80) and (SDK_VERSION>=$3000000)) then Exit(-2141581312); + Writeln('sceSysmoduleLoadModuleInternalWithArg:',GetSysmoduleName(id)); if (pRes<>nil) then pRes^:=0; Result:=0; @@ -776,6 +794,7 @@ begin lib^.set_proc($791D9B6450005344,@ps4_sceSysmoduleUnloadModule); lib^.set_proc($7CC3F934750E68C9,@ps4_sceSysmoduleIsLoaded); + lib^.set_proc($CA714A4396DF1A4B,@ps4_sceSysmoduleIsLoadedInternal); lib^.set_proc($847AC6A06A0D7FEB,@ps4_sceSysmoduleLoadModuleInternalWithArg); lib^.set_proc($E1F539CAF3A4546E,@ps4_sceSysmoduleGetModuleInfoForUnwind);