Skip to content

Commit

Permalink
Stub sceNpAuthGetIdTokenA (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor725 authored Mar 10, 2024
1 parent 7fbfd64 commit 3f1e049
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions src/np/ps4_libscenpauth.pas
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ interface

const
SCE_NP_CLIENT_ID_MAX_LEN=128;
SCE_NP_CLIENT_SECRET_MAX_LEN=256;
SCE_NP_AUTHORIZATION_CODE_MAX_LEN=128;
SCE_NP_ID_TOKEN_MAX_LEN=4096;

type
pSceNpClientId=^SceNpClientId;
Expand All @@ -21,6 +23,12 @@ interface
padding:array[0..6] of Byte;
end;

pSceNpClientSecret=^SceNpClientSecret;
SceNpClientSecret=packed record
secret:array[0..SCE_NP_CLIENT_SECRET_MAX_LEN] of char;
padding:array[0..6] of Byte;
end;

pSceNpAuthCreateAsyncRequestParameter=^SceNpAuthCreateAsyncRequestParameter;
SceNpAuthCreateAsyncRequestParameter=packed record
size:QWORD;
Expand All @@ -43,6 +51,22 @@ interface
padding:array[0..6] of Byte;
end;

pSceNpAuthGetIdTokenParameterA=^SceNpAuthGetIdTokenParameterA;
SceNpAuthGetIdTokenParameterA=packed record
size:QWORD;
userId:Integer;
padding:array[0..3] of Byte;
clientId:pSceNpClientId;
clientSecret:pSceNpClientSecret;
scope:PChar;
end;

pSceNpIdToken=^SceNpIdToken;
SceNpIdToken=packed record
token:array[0..SCE_NP_ID_TOKEN_MAX_LEN] of char;
padding:array[0..6] of Byte;
end;

implementation

function ps4_sceNpAuthCreateRequest():Integer; SysV_ABI_CDecl;
Expand Down Expand Up @@ -74,6 +98,15 @@ function ps4_sceNpAuthDeleteRequest(reqId:Integer):Integer; SysV_ABI_CDecl;
Result:=0;
end;

function ps4_sceNpAuthGetIdTokenA(reqId:Integer;
const param:pSceNpAuthGetIdTokenParameterA;
idToken:pSceNpIdToken):Integer; SysV_ABI_CDecl;
begin
Writeln(SysLogPrefix,'sceNpAuthGetIdTokenA');
FillChar(idToken^, SizeOf(SceNpIdToken), 0);
Result:=0;
end;

function Load_libSceNpAuth(Const name:RawByteString):TElf_node;
var
lib:PLIBRARY;
Expand All @@ -87,6 +120,7 @@ function Load_libSceNpAuth(Const name:RawByteString):TElf_node;
lib^.set_proc($2B11A43AB4094EA6,@ps4_sceNpAuthGetAuthorizationCode);
lib^.set_proc($8234B27F34AC0DC1,@ps4_sceNpAuthPollAsync);
lib^.set_proc($1FCC06F4193F9CF7,@ps4_sceNpAuthDeleteRequest);
lib^.set_proc($0A871B1D520A3C4F,@ps4_sceNpAuthGetIdTokenA);
end;

initialization
Expand Down

0 comments on commit 3f1e049

Please sign in to comment.