This commit is contained in:
red-prig 2022-10-06 22:58:35 +03:00
parent edcb0742cd
commit ad7e5d949f
5 changed files with 71 additions and 14 deletions

View File

@ -178,16 +178,25 @@ begin
Result:=4;
end;
function ps4_sceNpWebApiCreateContextA(libCtxId,userId:Integer):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApiCreateContextA:',libCtxId,':',userId);
Result:=Integer($80552907);
end;
//nop nid:libSceNpWebApi:ADD82CE59D4CC85C:sceNpWebApiCreateRequest
function ps4_sceNpWebApi2Initialize(libHttp2CtxId:Integer;
poolSize:size_t):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2Initialize:',poolSize);
Writeln('sceNpWebApi2Initialize:',libHttp2CtxId,':',poolSize);
Result:=4;
end;
function ps4_sceNpWebApi2CreateUserContext(libCtxId,m_userId:Integer):Integer; SysV_ABI_CDecl;
begin
Writeln('sceNpWebApi2CreateUserContext:',libCtxId);
Writeln('sceNpWebApi2CreateUserContext:',libCtxId,':',m_userId);
Result:=5;
end;
@ -270,6 +279,8 @@ begin
'libSceNpWebApi':
Case Info^.nid of
QWORD($1B70272CD7510631):Result:=@ps4_sceNpWebApiInitialize;
QWORD($CE4E9CEB9C68C8ED):Result:=@ps4_sceNpWebApiCreateContextA;
//nop nid:libSceNpWebApi:ADD82CE59D4CC85C:sceNpWebApiCreateRequest
end;
'libSceNpWebApi2':
@ -501,7 +512,7 @@ begin
//ps4_app.app_file:='..\samples\api_video_out\videoout_basic_1d.elf';
//ps4_app.app_path:='..\samples\http_get\';
//ps4_app.app_file:='..\samples\http_get\simple4.elf';
//ps4_app.app_file:='..\samples\http_get\simple5.elf';
//ps4_app.app_path:='G:\Games\MOMODORA\CUSA05694\';
//ps4_app.app_file:='G:\Games\MOMODORA\CUSA05694\eboot.bin';
@ -642,6 +653,18 @@ begin
//ps4_app.app_path:='G:\Games\Mega Man Legacy Collection v1.00\CUSA02516\';
//ps4_app.app_file:='G:\Games\Mega Man Legacy Collection v1.00\CUSA02516\eboot.bin';
//ps4_app.app_path:='G:\Games\ps4-homebrew\PS4_Player\';
//ps4_app.app_file:='G:\Games\ps4-homebrew\PS4_Player\eboot.bin';
//ps4_app.app_path:='G:\Games\ps4-homebrew\pad\';
//ps4_app.app_file:='G:\Games\ps4-homebrew\pad\eboot.bin';
//ps4_app.app_path:='G:\Games\Castlevania\SLUS00067\';
//ps4_app.app_file:='G:\Games\Castlevania\SLUS00067\eboot.bin';
//ps4_app.app_path:='G:\Games\Roombo First Blood\CUSA19205\';
//ps4_app.app_file:='G:\Games\Roombo First Blood\CUSA19205\eboot.bin';
ps4_app.resolve_cb:=@ResolveImport;
ps4_app.reload_cb :=@ReloadImport;

View File

@ -334,9 +334,15 @@ begin
if _is_single(attr) then
begin
if _test_and_set(ef,bitPattern,waitMode,pResultPat) then
if (ef^.single.ret<>1) then //is signaled
begin
Break;
if _test_and_set(ef,bitPattern,waitMode,pResultPat) then
begin
Result:=ef^.single.ret;
ef^.single.thread:=0;
Break;
end;
ef^.single.ret:=1;
end;
end else
@ -409,8 +415,6 @@ begin
if _is_single(attr) then
begin
ef^.single.thread:=0;
Result:=ef^.single.ret;
spin_unlock(ef^.lock_sing);
end else
begin
@ -449,8 +453,13 @@ begin
if _is_single(attr) then
begin
fetch_or(ef^.bitPattern,bitPattern);
ef^.single.ret:=0;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
if (ef^.single.ret=1) then
begin
ef^.single.ret:=0;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
end;
end else
begin
@ -526,8 +535,13 @@ begin
//cancel all
if _is_single(attr) then
begin
ef^.single.ret:=SCE_KERNEL_ERROR_EACCES;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
if (ef^.single.ret=1) then
begin
ef^.single.ret:=SCE_KERNEL_ERROR_EACCES;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
end;
end else
begin
node:=ef^.list.pHead;
@ -578,10 +592,13 @@ begin
begin
fetch_or(ef^.bitPattern,bitPattern);
ef^.single.ret:=SCE_KERNEL_ERROR_ECANCELED;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
if (ef^.single.ret=1) then
begin
ef^.single.ret:=SCE_KERNEL_ERROR_ECANCELED;
NtQueueApcThread(ef^.single.thread,@_apc_null,0,nil,0);
count:=1;
end;
count:=1;
end else
begin
fetch_or(ef^.bitPattern,bitPattern);

View File

@ -237,6 +237,11 @@ begin
end;
end;
function ps4_sceSysmoduleGetModuleInfoForUnwind(addr:Pointer;flags:DWORD;info:pSceModuleInfoForUnwind):Integer; SysV_ABI_CDecl;
begin
Result:=ps4_sceKernelGetModuleInfoForUnwind(addr,flags,info);
end;
type
PInternalSegmentInfo=^TInternalSegmentInfo;
TInternalSegmentInfo=packed record
@ -827,6 +832,8 @@ begin
lib^.set_proc($7CC3F934750E68C9,@ps4_sceSysmoduleIsLoaded);
lib^.set_proc($847AC6A06A0D7FEB,@ps4_sceSysmoduleLoadModuleInternalWithArg);
lib^.set_proc($E1F539CAF3A4546E,@ps4_sceSysmoduleGetModuleInfoForUnwind);
end;
function Load_libkernel(Const name:RawByteString):TElf_node;

View File

@ -744,6 +744,8 @@ begin
case elf_phdr[i].p_type of
PT_NOTE:; //skip
PT_LOAD:;//load
PT_SCE_RELRO:;//load

View File

@ -123,6 +123,13 @@ begin
Result:=0;
end;
function ps4_sceNpGetAccountIdA(userId:Integer;pAccountId:PQWORD):Integer; SysV_ABI_CDecl;
begin
if (pAccountId=nil) then Exit(SCE_NP_ERROR_INVALID_ARGUMENT);
pAccountId^:=1111;
Result:=0;
end;
function ps4_sceNpGetNpId(userId:Integer;npId:PSceNpId):Integer; SysV_ABI_CDecl;
begin
npId^:=Default(SceNpId);
@ -357,6 +364,7 @@ begin
lib:=Result._add_lib('libSceNpManager');
lib^.set_proc($036090DE4812A294,@ps4_sceNpSetContentRestriction);
lib^.set_proc($ADB9276948E9A96A,@ps4_sceNpGetAccountIdA);
lib^.set_proc($A7FA3BE029E83736,@ps4_sceNpGetNpId);
lib^.set_proc($5C39DC5D02095129,@ps4_sceNpGetOnlineId);
lib^.set_proc($7901FB9D63DC0207,@ps4_sceNpGetState);