vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceQafTokenEnc
 Unencrypted header and encrypted payload in the first 0x80 token bytes. More...
 
struct  SceQafTokenEx
 

Functions

 VITASDK_BUILD_ASSERT_EQ (0x80, SceQafTokenEnc)
 
 VITASDK_BUILD_ASSERT_EQ (0x180, SceQafTokenEx)
 
int sceSblQafManagerDeleteQafTokenForUser (void)
 Does nothing on FW 3.60; does not delete a legacy QAF token.
 
int sceSblQafManagerGetQafNameForUser (char *buffer, SceSize max_length)
 Copy up to 0x18 bytes of the active QAF profile name to user memory.
 
int sceSblQafManagerIsAllowKernelDebugForUser (void)
 
int sceSblQafMgrDeleteQafToken2 (void)
 Delete the stored extended QAF token and mark the NVS token slot empty.
 
int sceSblQafMgrGetQafName (char *buffer, SceSize max_length)
 Validate the stored extended QAF token and return its active profile name.
 
int sceSblQafMgrGetQafToken2 (SceQafTokenEx *qaf_token)
 Retrieve and transform the stored 0x180-byte extended QAF token.
 
int sceSblQafMgrIsAllowAllDebugMenuDisplay (void)
 
int sceSblQafMgrIsAllowForceUpdate (void)
 
int sceSblQafMgrIsAllowLimitedDebugMenuDisplay (void)
 
int sceSblQafMgrIsAllowMinimumDebugMenuDisplay (void)
 
int sceSblQafMgrIsAllowNonQAPup (void)
 
int sceSblQafMgrIsAllowNpFullTest (void)
 
int sceSblQafMgrIsAllowNpTest (void)
 Check whether NP test mode is enabled.
 
int sceSblQafMgrIsAllowRemoteSysmoduleLoad (void)
 
int sceSblQafMgrIsAllowScreenShotAlways (void)
 
int sceSblQafMgrSetQafToken2 (const SceQafTokenEx *qaf_token)
 Validate and install an extended QAF token.
 

Variables

char SceQafTokenEnc::magic [4]
 Token magic.
 
SceUInt32 SceQafTokenEnc::qaf_version
 QAF token version; FW 3.60 uses its second byte as the version counter.
 
char SceQafTokenEnc::qaf_name [0x18]
 NUL-terminated or padded QAF profile name.
 
SceUInt8 SceQafTokenEnc::enc_data [0x60]
 Encrypted token payload.
 
SceUInt8 SceQafTokenEx::token_data [0x80]
 Input to sceSblQafMgrSetQafToken2 has the layout of SceQafTokenEnc.
 
SceUInt8 SceQafTokenEx::sig [0x100]
 0x100-byte token signature.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceSblSsMgr_stub




Data Structure Documentation

◆ SceQafTokenEnc

struct SceQafTokenEnc

Unencrypted header and encrypted payload in the first 0x80 token bytes.

Data Fields
char magic[4] Token magic.
SceUInt32 qaf_version QAF token version; FW 3.60 uses its second byte as the version counter.
char qaf_name[0x18] NUL-terminated or padded QAF profile name.
SceUInt8 enc_data[0x60] Encrypted token payload.

◆ SceQafTokenEx

struct SceQafTokenEx
Data Fields
SceUInt8 token_data[0x80] Input to sceSblQafMgrSetQafToken2 has the layout of SceQafTokenEnc.

sceSblQafMgrGetQafToken2 transforms this region, but its output layout is not established. Encrypted token on input to sceSblQafMgrSetQafToken2.

SceUInt8 sig[0x100] 0x100-byte token signature.

Function Documentation

◆ VITASDK_BUILD_ASSERT_EQ() [1/2]

VITASDK_BUILD_ASSERT_EQ ( 0x80  ,
SceQafTokenEnc   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/2]

VITASDK_BUILD_ASSERT_EQ ( 0x180  ,
SceQafTokenEx   
)

◆ sceSblQafManagerDeleteQafTokenForUser()

int sceSblQafManagerDeleteQafTokenForUser ( void  )

Does nothing on FW 3.60; does not delete a legacy QAF token.

Returns
Always 0x80010058 on FW 3.60.

◆ sceSblQafManagerGetQafNameForUser()

int sceSblQafManagerGetQafNameForUser ( char *  buffer,
SceSize  max_length 
)

Copy up to 0x18 bytes of the active QAF profile name to user memory.

The calling process must be a system program. The function reads and writes the selected portion of buffer, so it must be both readable and writable. Values of max_length above 0x18 are treated as 0x18.

Parameters
[in,out]buffer- Required profile-name buffer.
[in]max_length- Number of bytes available in buffer; must be nonzero.
Returns
0 on success, < 0 on error.

◆ sceSblQafManagerIsAllowKernelDebugForUser()

int sceSblQafManagerIsAllowKernelDebugForUser ( void  )
Returns
1 when QA flag byte 0xD bit 0 is set, otherwise 0.

◆ sceSblQafMgrDeleteQafToken2()

int sceSblQafMgrDeleteQafToken2 ( void  )

Delete the stored extended QAF token and mark the NVS token slot empty.

The calling process must be a system program.

Returns
0 on success, < 0 on error.

◆ sceSblQafMgrGetQafName()

int sceSblQafMgrGetQafName ( char *  buffer,
SceSize  max_length 
)

Validate the stored extended QAF token and return its active profile name.

The calling process must be a system program. buffer must be readable and writable, and max_length must be at least 0x18. Exactly 0x18 bytes are transferred.

Parameters
[in,out]buffer- Required 0x18-byte profile-name buffer.
[in]max_length- Buffer capacity; must be at least 0x18.
Returns
0 on success, < 0 on error.

◆ sceSblQafMgrGetQafToken2()

int sceSblQafMgrGetQafToken2 ( SceQafTokenEx *  qaf_token)

Retrieve and transform the stored 0x180-byte extended QAF token.

The calling process must be a system program. When the NVS empty flag is clear, the first 0x80 bytes and the 0x100-byte signature are read from NVS. Otherwise a token filled with zeros is used. qaf_sm command 13 then transforms the complete token before it is copied to user memory.

Parameters
[out]qaf_token- Required output token.
Returns
0 on success, < 0 on error.

◆ sceSblQafMgrIsAllowAllDebugMenuDisplay()

int sceSblQafMgrIsAllowAllDebugMenuDisplay ( void  )
Returns
1 when QA flag byte 0xC bit 1 is set, otherwise 0.

◆ sceSblQafMgrIsAllowForceUpdate()

int sceSblQafMgrIsAllowForceUpdate ( void  )
Returns
1 when QA flag byte 0xF bit 1 is set, otherwise 0.

◆ sceSblQafMgrIsAllowLimitedDebugMenuDisplay()

int sceSblQafMgrIsAllowLimitedDebugMenuDisplay ( void  )
Returns
1 when QA flag byte 6 bit 1 is set, otherwise 0.

◆ sceSblQafMgrIsAllowMinimumDebugMenuDisplay()

int sceSblQafMgrIsAllowMinimumDebugMenuDisplay ( void  )
Returns
1 when QA flag byte 0xF bit 0 is set, otherwise 0.

◆ sceSblQafMgrIsAllowNonQAPup()

int sceSblQafMgrIsAllowNonQAPup ( void  )
Returns
1 when QA flag byte 0xF bit 0 is set, otherwise 0.

◆ sceSblQafMgrIsAllowNpFullTest()

int sceSblQafMgrIsAllowNpFullTest ( void  )
Returns
1 when QA flag byte 6 bit 1 is set, otherwise 0.

◆ sceSblQafMgrIsAllowNpTest()

int sceSblQafMgrIsAllowNpTest ( void  )

Check whether NP test mode is enabled.

Returns
1 when QA flag byte 0xF bit 0 or Sysroot's NP-test flag is set, otherwise 0.

◆ sceSblQafMgrIsAllowRemoteSysmoduleLoad()

int sceSblQafMgrIsAllowRemoteSysmoduleLoad ( void  )
Returns
1 when QA flag byte 0xD bit 1 is set, otherwise 0.

◆ sceSblQafMgrIsAllowScreenShotAlways()

int sceSblQafMgrIsAllowScreenShotAlways ( void  )
Returns
1 when QA flag byte 6 bit 1 is set, otherwise 0.

◆ sceSblQafMgrSetQafToken2()

int sceSblQafMgrSetQafToken2 ( const SceQafTokenEx *  qaf_token)

Validate and install an extended QAF token.

The calling process must be a system program. qaf_sm command 12 validates the 0x180-byte token. The secure version counter is then initialized or advanced from byte 5. The token is enabled before it is written to NVS and read back for verification.

Parameters
[in]qaf_token- Required encrypted token and signature.
Returns
0 on success, < 0 on error.

Variable Documentation

◆ magic

char SceQafTokenEnc::magic[4]

Token magic.

◆ qaf_version

SceUInt32 SceQafTokenEnc::qaf_version

QAF token version; FW 3.60 uses its second byte as the version counter.

◆ qaf_name

char SceQafTokenEnc::qaf_name[0x18]

NUL-terminated or padded QAF profile name.

◆ enc_data

SceUInt8 SceQafTokenEnc::enc_data[0x60]

Encrypted token payload.

◆ token_data

SceUInt8 SceQafTokenEx::token_data[0x80]

Input to sceSblQafMgrSetQafToken2 has the layout of SceQafTokenEnc.

sceSblQafMgrGetQafToken2 transforms this region, but its output layout is not established. Encrypted token on input to sceSblQafMgrSetQafToken2.

◆ sig

SceUInt8 SceQafTokenEx::sig[0x100]

0x100-byte token signature.