SceSblPostSsMgr: Difference between revisions

From Vita Development Wiki
Jump to navigation Jump to search
No edit summary
 
(105 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Module ==
== Module ==


=== Known NIDs ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! Name !! World !! Privilege !! NID
! Version !! World !! Privilege
|-
|-
| 3.60 || SceSblPostSsMgr || Non-secure || Kernel || 0xB6C941F2
| 3.60 || Non-secure || Kernel
|}
|}


Line 17: Line 16:
! Version !! Name !! World !! Visibility !! NID
! Version !! Name !! World !! Visibility !! NID
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblPostSsMgrForDriver|SceSblPostSsMgrForDriver]] || ? || Kernel || 0x2254E1B2
| 1.03-3.60 || [[SceSblPostSsMgr#SceSblPostSsMgrForDriver|SceSblPostSsMgrForDriver]] || Non-secure || Kernel || 0x2254E1B2
|-
| 0.990-1.692 || [[SceSblPostSsMgr#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || not present. Was present in [[SceSysmem#SceZlibForDriver]].
|-
| 1.800.071-3.60 || [[SceSblPostSsMgr#SceZlibForDriver|SceZlibForDriver]] || Non-secure || Kernel || 0xE241534E
|-
| 0.990-1.692 || [[SceSblPostSsMgr#SceSblFwLoaderForDriver|SceSblFwLoaderForDriver]] || Non-secure || Kernel || not present. Was present in [[SceSblFwLoader#SceSblFwLoaderForDriver]].
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceZlibForDriver|SceZlibForDriver]] || ? || Kernel || 0xE241534E
| 1.800.071-3.60 || [[SceSblPostSsMgr#SceSblFwLoaderForDriver|SceSblFwLoaderForDriver]] || Non-secure || Kernel || 0x6FE424E4
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblFwLoaderForDriver|SceSblFwLoaderForDriver]] || ? || Kernel || 0x6FE424E4
| 1.03-3.60 || [[SceSblPostSsMgr#SceSblPmMgr|SceSblPmMgr]] || Non-secure || User || 0xA9CE5795
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblPmMgr|SceSblPmMgr]] || ? || User || 0xA9CE5795
| 1.03-3.60 || [[SceSblPostSsMgr#SceSblRtcMgr|SceSblRtcMgr]] || Non-secure || User || 0x44C5F209
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblRtcMgr|SceSblRtcMgr]] || ? || User || 0x44C5F209
| 1.03-3.60 || [[SceSblPostSsMgr#SceSblLicMgr|SceSblLicMgr]] || Non-secure || User || 0x62083C72
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblLicMgr|SceSblLicMgr]] || ? || User || 0x62083C72
| 1.03-3.60 || [[SceSblPostSsMgr#SceSblUtMgr|SceSblUtMgr]] || Non-secure || User || 0x000DF81A
|-
|-
| 3.60 || [[SceSblPostSsMgr#SceSblUtMgr|SceSblUtMgr]] || ? || User || 0x000DF81A
| 1.03 || [[SceSblPostSsMgr#SceSblSpsfoMgr|SceSblSpsfoMgr]] || Non-secure || User || 0x7959298B
|}
|}


== SceSblPostSsMgrForDriver ==
== Types ==
 
=== Types ===


<source lang="C">
<source lang="C">
typedef struct spsfo_ctx
typedef struct spsfo_ctx {
{
   SceUID mem_uid; // SceSblSpsfoMgr
   SceUID mem_uid; //SceSblSpsfoMgr
   void* mem_block_base;
   void* mem_block_base;
   uint32_t unk_8;
   uint32_t unk_8;
} spsfo_ctx;
} spsfo_ctx;
typedef struct SceUtoken { // size is 0x800
  char unk_data[0x800];
} SceUtoken;
typedef struct SceUtokenDecrypted { // size is 0x58
    SceUInt64 program_authority_id;
    SceSelfCapability capability;
    SceSelfAttribute attribute; // the important utoken flags are at &attribute+8
    SceUInt8 shared_secret_0[0x10];
} SceUtokenDecrypted;
typedef struct SceSblRsaDataParam {
void *data;
unsigned int size;
} SceSblRsaDataParam;
typedef struct SceSblRsaPublicKeyParam {
const void *n;
const void *k; // e/d
} SceSblRsaPublicKeyParam;
typedef struct SceSblRsaPrivateKeyParam {
int unk_0x00;
int unk_0x04;
int unk_0x08;
int unk_0x0C;
void *p;
void *q;
void *dp; // d % (p - 1)
void *dq; // d % (q - 1)
void *qp; // q^-1 % p
} SceSblRsaPrivateKeyParam;
</source>
</source>


=== sceSblPostSsMgrInitializeSpfsoCtxForDriver ===
== Not exported ==
 
=== module_start ===
 
Calls 2 subroutines:
* init_qaftoken
* init_utoken
 
=== init utoken ===
 
Reads tm0:utoken.dat.
 
Calls utoken_sm.self service 2 to decrypt SceUtoken buffer. The output is a 0x58 bytes buffer.
 
== SceSblPostSsMgrForDriver ==
 
=== sceSblSpsfoMgrOpenForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xBDF18922
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0xBDF18922
|}
|}


derived from [[SceVshBridge#vshSblAuthMgrVerifySpsfo|_vshSblAuthMgrVerifySpsfo]]
<source lang="C">int sceSblSpsfoMgrOpenForDriver(const char *path, spsfo_ctx *result);</source>
 
<source lang="C">
int sceSblPostSsMgrInitializeSpfsoCtxForDriver(char *path, spsfo_ctx *result);
</source>


=== sceSblPostSsMgrVerifySpfsoCtxForDriver ===
=== sceSblSpsfoMgrVerifyForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x686B9461
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0x686B9461
|}
|}


derived from [[SceVshBridge#vshSblAuthMgrVerifySpsfo|_vshSblAuthMgrVerifySpsfo]]
Derived from [[SceVshBridge#vshSblAuthMgrVerifySpsfo|_vshSblAuthMgrVerifySpsfo]].


<source lang="C">
<source lang="C">int sceSblSpsfoMgrVerifyForDriver(spsfo_ctx *ctx, int *res, int *size);</source>
int sceSblPostSsMgrVerifySpfsoCtxForDriver(spsfo_ctx *ctx, int *res, int *size);
</source>


=== sceSblPostSsMgrReleaseSpfsoCtxForDriver ===
=== sceSblSpsfoMgrCloseForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xAD3B0078
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0xAD3B0078
|}
|}


derived from [[SceVshBridge#vshSblAuthMgrVerifySpsfo|_vshSblAuthMgrVerifySpsfo]]
<source lang="C">int sceSblSpsfoMgrCloseForDriver(spsfo_ctx *ctx);</source>
 
<source lang="C">
int sceSblPostSsMgrReleaseSpfsoCtxForDriver(spsfo_ctx *ctx);
</source>


=== sceSblLicMgrGetActivationKeyForDriver ===
=== sceSblLicMgrGetActivationKeyForDriver ===
Line 92: Line 139:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xF7F1015B
| 0.990.000-3.740.011 || 0xF7F1015B
|}
|}


<source lang="C">
<source lang="C">
typedef struct activation_key // size is 0x14
typedef struct activation_key { // size is 0x14
{
   char open_psid[0x10]; // obtained with sceSblSsMgrGetOpenPsIdForDriver
   char open_psid[0x10]; // obtained with sceSblSsMgrGetOpenPsIdForDriver
   uint32_t vadd_hash; // result of vector add operation applied to open_psid
   uint32_t vadd_hash; // result of vector add operation applied to open_psid
Line 105: Line 151:
</source>
</source>


=== sceSblLicMgrActivateForDriver ===
=== sceSblLicMgrActivateDevkitForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x0298382B
| 0.990.000-3.740.011 || 0x0298382B
|}
|}


<source lang="C">int sceSblLicMgrActivateForDriver(char *afv_path);</source>
<source lang="C">int sceSblLicMgrActivateDevkitForDriver(char *afv_path);</source>


=== sceSblLicMgrGetLicenseStatusForDriver ===
=== sceSblLicMgrGetLicenseStatusForDriver ===
Line 120: Line 166:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x15F37282
| 0.990.000-3.740.011 || 0x15F37282
|}
|}


<source lang="C">int sceSblLicMgrGetLicenseStatusForDriver(void);</source>
<source lang="C">
// Return value: -1 = not initialized, 0 = activated, 1 = expired, 2 = RTC backup battery failure
int sceSblLicMgrGetLicenseStatusForDriver(void);
</source>


=== sceSblLicMgrGetExpireDateForDriver ===
=== sceSblLicMgrGetExpireDateForDriver ===
Line 130: Line 179:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x4FF2682F
| 0.990.000-3.740.011 || 0x4FF2682F
|}
|}


Get [[SceSblSsMgr#get_syscon_data|activation data]] expire date
Get [[SceSblSsMgr#NVS_Areas|activation data]] expire date.
 
If sceSblAIMgrIsToolDVT1ForDriver, 30/10/2011 8:00:00.
 
If sceSblAIMgrIsToolRev4ForDriver or TEST, expire_date = 0xFFFFFFFF.
 
If sceSblAIMgrIsToolDVT2ForDriver, 30/6/2012 8:00:00.
 
If sceSblAIMgrIsDEXForDriver and product_sub_code = 0xA, 0xB or 0xC, 31/3/2012 14:59:00.


<source lang="C">int sceSblLicMgrGetExpireDateForDriver(int *expire_date, int request_data_flag);</source>
<source lang="C">
// If read_from_nvs is false, it reads expire_date from SceSblPostSsMgr memory, else it reads NVS and queries act_sm.
int sceSblLicMgrGetExpireDateForDriver(int *expire_date, SceBool read_from_nvs);
</source>


=== sceSblPmMgrGetProductModeForDriver ===
=== sceSblPmMgrSetProductModeForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xADF92824
| 0.990.000-3.740.011 || 0xADF92824
|}
|}


executes [[F00D_Commands#pm_sm.self|pm_sm.self]] commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA
Executes [[Secure_Modules_Functions#pm_sm.self|pm_sm.self]] commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.
 
* If enable = 0, it calls pm_set(5). The console exits Manufacturing Mode.
* If enable = 1, it calls pm_set(4). That console enters Manufacturing Mode.
 
<source lang="C">int sceSblPmMgrSetProductModeForDriver(SceBool enable);</source>


=== sceSblPmMgrGetProductMode2ForDriver ===
=== sceSblPmMgrSetSdModeOffForDriver ===
{| class="wikitable"
{| class="wikitable"
|-
|-
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xFE92A318
| 0.931.010-0.996.090 || not present
|-
| 1.000.071-3.740.011 || 0xFE92A318
|}
|}


Executes [[F00D_Commands#pm_sm.self|pm_sm.self]] commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.
Executes [[Secure_Modules_Functions#pm_sm.self|pm_sm.self]] commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.
 
If productMode != 0 (normal mode), it calls pm_set(7, use_new_ernie_protocol).
 
<source lang="C">int sceSblPmMgrSetSdModeOffForDriver(SceUInt32 productMode);</source>


=== sceSblPmMgrGetProductModeFromNVSForDriver ===
=== sceSblPmMgrGetProductModeFromNVSForDriver ===
Line 162: Line 233:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x4663C195
| 0.990.000-3.740.011 || 0x4663C195
|}
|}


Executes [[F00D_Commands#pm_sm.self|pm_sm.self]] command 8.
Executes [[Secure_Modules_Functions#pm_sm.self|pm_sm.self]] command 1.
 
<source lang="C">int sceSblPmMgrGetProductModeFromNVSForDriver(SceUInt8 *pProductMode);</source>


=== sceSblPmMgrAuthEtoIForDriver ===
=== sceSblPmMgrAuthEtoIForDriver ===
Line 172: Line 245:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x19B63D65
| 0.990.000-3.740.011 || 0x19B63D65
|}
|}


Executes pm_sm_sd.self commands 9, A.
Returns jig_auth(12). Returns an integer on success.
 
jig_auth:
* On 0.990: executes pm_sm_sd.self commands 3 (gen_req_hello), 4 (gen_challenge), 5 (check_response), 6 (gen_req_result), 7 (check_result).
* On 1.03-3.60: executes pm_sm_sd.self commands 9, 0xA.
 
<source lang="C">int sceSblPmMgrAuthEtoIForDriver(void);</source>


=== sceSblPostSsMgrDecryptSealedkeyForDriver ===
=== sceSblPostSsMgrDecryptSealedkeyForDriver ===
Line 182: Line 261:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x33275F95
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0x33275F95
|}
|}


<code>data</code> is 0x50 bytes of data from [[Sealedkey#File_Structure|sealedkey]]
<code>data</code> is 0x50 bytes of data from [[Sealedkey#File_Structure|sealedkey]]


this function:
This function:


verifies pfsSKKey header
verifies pfsSKKey header


decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using [[SceSblSsMgr#sceSblSsMgrEncryptWithPortabilityForDriver|sceSblSsMgrEncryptWithPortabilityForDriver]]
decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using [[SceSblSsMgr#sceSblSsEncryptWithPortabilityForDriver|sceSblSsEncryptWithPortabilityForDriver]]


verifies hmac256 value in <code>HMAC Value</code>
verifies hmac256 value in <code>HMAC Value</code>
Line 198: Line 279:


<source lang="C">
<source lang="C">
//data - size 0x50
// data - size 0x50
//dst_secret - size 0x10
// dst_secret - size 0x10
int sceSblPostSsMgrDecryptSealedkeyForDriver(char* data, char* dst_secret);
int sceSblPostSsMgrDecryptSealedkeyForDriver(char* data, char* dst_secret);
</source>
</source>
Line 208: Line 289:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x08525D8D
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0x08525D8D
|}
|}


<code>data</code> is 0x50 bytes of data like in [[Sealedkey#File_Structure|sealedkey]]
<code>data</code> is 0x50 bytes of data like in [[Sealedkey#File_Structure|sealedkey]]


this function:
This function:


writes pfsSKKey header
writes pfsSKKey header


decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using [[SceSblSsMgr#sceSblSsMgrEncryptWithPortabilityForDriver|sceSblSsMgrEncryptWithPortabilityForDriver]]
decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using [[SceSblSsMgr#sceSblSsEncryptWithPortabilityForDriver|sceSblSsEncryptWithPortabilityForDriver]]


randomly generates 0x10 bytes of IV with [[SceSblSsMgr#sceSblSsMgrGetRandomNumberForDriver|sceSblSsMgrGetRandomNumberForDriver]]
randomly generates 0x10 bytes of IV with [[SceSblSsMgr#sceSblRngPseudoRandomNumberForDriver|sceSblRngPseudoRandomNumberForDriver]]


randomly generates 0x10 bytes of secret with [[SceSblSsMgr#sceSblSsMgrGetRandomNumberForDriver|sceSblSsMgrGetRandomNumberForDriver]]
randomly generates 0x10 bytes of secret with [[SceSblSsMgr#sceSblRngPseudoRandomNumberForDriver|sceSblRngPseudoRandomNumberForDriver]]


encrypts the secret into <code>Encrypted key</code>
encrypts the secret into <code>Encrypted key</code>
Line 228: Line 311:


<source lang="C">
<source lang="C">
//dest_data - size 0x50
// dest_data - size 0x50
int sceSblPostSsMgrEncryptSealedkeyForDriver (char* dest_data);
int sceSblPostSsMgrEncryptSealedkeyForDriver(char* dest_data);
</source>
</source>


Line 237: Line 320:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xDDA6FA6D
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0xDDA6FA6D
|}
|}


This function verifies magic in the header and HMAC of the keystone file
This function verifies magic in the header and HMAC of the keystone file.


<source lang="C">int sceSblPostSsMgrVerifyKeystoneForDriver(char* data, int version);</source>
<source lang="C">int sceSblPostSsMgrVerifyKeystoneForDriver(char* data, int version);</source>
Line 249: Line 334:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xF86F1452
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0xF86F1452
|}
|}


Line 261: Line 348:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x42474C8B
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0x42474C8B
|}
|}


Line 271: Line 360:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xCC5AA5A5
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0xCC5AA5A5
|}
|}


<source lang="C">int sceSblPostSsMgrDebugDecryptKeystoneForDriver(char* keystone_data, char* dst_secret);</source>
<source lang="C">int sceSblPostSsMgrDebugDecryptKeystoneForDriver(char* keystone_data, char* dst_secret);</source>
=== sceSblPostSsMgrGenerateAppKeyForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.010.031 || not present
|-
| 3.100.081-3.740.011 || 0x2646DE64
|}
This name was derived from [[SceVshBridge#_vshSblSsGenerateAppKey]].
<source lang="C">int sceSblPostSsMgrGenerateAppKeyForDriver(void *in, void *out);</source>
=== sceSblUtMgrIsAllowComTestForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0x128FB35A
|}
Temp name was sceSblUtMgrIsUtokenProgramForDriver.
pseudo-code:
<source lang="C">
SceBool sceSblUtMgrIsAllowComTestForDriver(SceUID pid) {
  SceBool ret;
  SceUInt32 stack_cookie;
  SceUInt32 ret2;
  SceUInt32 paid[2];
  if (g_has_com_test_flag == 0 || sceSblACMgrGetPaidForKernel(pid, &paid) != 0)
    ret = false;
  else
    ret = g_ut_paid_hi == paid[1] && g_ut_paid_low == paid[0];
  if (stack_cookie != 0)
    __stack_chk_fail();
  return ret;
}
</source>
<source lang="C">SceBool sceSblUtMgrIsAllowComTestForDriver(SceUID pid);</source>


=== sceSblUtMgrUpdateUtokenForDriver ===
=== sceSblUtMgrUpdateUtokenForDriver ===
Line 281: Line 417:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xC2E58CE3
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0xC2E58CE3
|}
|}


Executes [[F00D_Commands#utoken_sm.self|utoken_sm]] command 1 (?to encrypt or verify buffer?)
Executes [[Secure_Modules_Functions#utoken_sm.self|utoken_sm]] command 1 to verify buffer, then writes the 0x800 bytes buffer to tm0:utoken/utoken.dat.
Writes a 0x800 buffer to tm0:utoken/utoken.dat.
 
Called by SceSblUtMgr_BDE74645.


<source lang="C">
<source lang="C">
Line 299: Line 434:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x1FF699DD
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0x1FF699DD
|}
|}


Writes 0x800 blank tm0:utoken/utoken.dat or removes it.
Writes blank 0x800 bytes to tm0:utoken/utoken.dat or removes it.


Exported to userland by [[SceSblPostSsMgr#sceSblUtMgrResetUtokenFile|sceSblUtMgrResetUtokenFile]].
Exported to usermode by [[SceSblPostSsMgr#sceSblUtMgrResetUtokenFile|sceSblUtMgrResetUtokenFile]].


<source lang="C">int sceSblUtMgrResetUtokenFileForDriver(void);</source>
<source lang="C">int sceSblUtMgrResetUtokenFileForDriver(void);</source>
Line 313: Line 450:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x7ACCAA50
| 0.931.010-0.990.000 || not present
|-
| 0.996.090-3.740.011 || 0x7ACCAA50
|}
|}


Line 325: Line 464:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x9D2E2D39
| 0.931.010-1.61 || not present
|-
| 1.660.011-3.740.011 || 0x9D2E2D39
|}
|}


Line 337: Line 478:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x9FD835B0
| 0.931.010-3.20 || not present
|-
| 3.300.041-3.740.011 || 0x9FD835B0
|}
|}


Line 343: Line 486:


<source lang="C">int sceSblUtMgrHasNpTestFlagForDriver(void);</source>
<source lang="C">int sceSblUtMgrHasNpTestFlagForDriver(void);</source>
=== sceSblUtMgrHasUNK1FlagForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-0.996.090 || not present
|-
| 1.000.071-3.740.011 || 0x22599675
|}
<source lang="C">int sceSblUtMgrHasUNK1FlagForDriver(void);</source>
=== sceSblUtMgrHasUNK2FlagForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-2.50 || not present
|-
| 3.000.071-3.740.011 || 0x9B49C249
|}
<source lang="C">int sceSblUtMgrHasUNK2FlagForDriver(void);</source>
=== sceSblUtMgrHasUNK3FlagForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0x1923D80D
|}
<source lang="C">int sceSblUtMgrHasUNK3FlagForDriver(void);</source>
=== sceSblUtMgrHasUNK4FlagForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-1.81 || not present
|-
| 2.000.081-3.740.011 || 0xC93C0A0D
|}
<source lang="C">int sceSblUtMgrHasUNK4FlagForDriver(void);</source>
=== sceSblUtMgrGetTrilithiumBufferForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.100.081 || not present
|-
| 3.180.011-3.740.011 || 0xABDD68CD
|}
<source lang="C">int sceSblUtMgrGetTrilithiumBufferForDriver(SceUtokenDecrypted *buffer);</source>


=== sceSblRtcMgrSetCpRtcForDriver ===
=== sceSblRtcMgrSetCpRtcForDriver ===
Line 349: Line 552:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x3F9BDEDF
| 0.990.000-3.740.011 || 0x3F9BDEDF
|}
|}


Set RTC in DevKit CP.
Set RTC in DevKit CP.
<source lang="C">int sceSblRtcMgrSetCpRtcForDriver(int rtc);</source>
<source lang="C">int sceSblRtcMgrSetCpRtcForDriver(int rtc);</source>


Line 360: Line 564:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0x942010A0
| 0.990.000-3.740.011 || 0x942010A0
|}
|}
<source lang="C">int sceSblRtcMgrGetCpRtcPhysicalForDriver(int *rtc);</source>


=== sceSblRtcMgrGetCpRtcLogicalForDriver ===
=== sceSblRtcMgrGetCpRtcLogicalForDriver ===
Line 368: Line 574:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xDE5150FE
| 0.990.000-3.740.011 || 0xDE5150FE
|}
|}
<source lang="C">int sceSblRtcMgrGetCpRtcLogicalForDriver(int *rtc);</source>
=== SceSblPostSsMgrForDriver_D8A2D465 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-1.06 || not present
|-
| 1.500.151-3.740.011 || 0xD8A2D465
|}
Related to Activation file.
Returns true if a1 and a2 are identical to some values in memory.
<source lang="C">SceBool SceSblPostSsMgrForDriver_D8A2D465(int a1, int a2);</source>
=== SceSblPostSsMgrForDriver_2C463AF1 ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0x2C463AF1
|}
Used just before SceSblPostSsMgrForDriver_CB5436BD.
<source lang="C">int SceSblPostSsMgrForDriver_2C463AF1(int maybe_keyset, SceSize size, void *buf);</source>
=== SceSblPostSsMgrForDriver_CB5436BD ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.01 || not present
|-
| 3.100.081-3.740.011 || 0xCB5436BD
|}
Transforms? coredump key.
<source lang="C">int SceSblPostSsMgrForDriver_CB5436BD(int maybe_keyset, SceSize size, void *buf);</source>
=== sceSblRSA2048CreateSignatureForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-2.060.011 || not present
|-
| 2.100.081-3.740.011 || 0x07BAD056
|}
This is a guessed name.
Creates a RSA 2048 signature.
Used in [[SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver]].
<source lang="C">int sceSblRSA2048CreateSignatureForDriver(SceSblRsaDataParam *dst, SceSblRsaDataParam *hash, SceSblRsaPrivateKeyParam *private_key, int type);</source>
=== sceSblRSA2048VerifySignatureForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-2.060.011 || not present
|-
| 2.100.081-3.740.011 || 0x3DB69911
|}
This is a guessed name.
Verfies a RSA 2048 signature.
<source lang="C">int sceSblRSA2048VerifySignatureForDriver(SceSblRsaDataParam *rsa_signature, SceSblRsaDataParam *hash, SceSblRsaPublicKeyParam *public_key, int type);</source>
=== sceSblSsMgrCloudDataGetEncDecCryptHandleForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.010.031 || not present
|-
| 3.100.081-3.740.011 || 0xC6684F7E
|}
This is a guessed name.
Gets the entire Cloud Data Key Ring.
Used in [[SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver]].
<source lang="C">
typedef struct SceCloudDataKeyRing { // size is 0x2A0
    char magic[8]; // "CloudBU\0"
    SceUInt32 unk_8; // ex: 0 or 1
    SceUInt8 unk_0xC[0x294];
} SceCloudDataKeyRing;
typedef struct SceCloudDataSignCryptHandle { // size is 0x2A0
    SceCloudBUKeyRing keyring;
} SceCloudDataSignCryptHandle;
int sceSblSsMgrCloudDataGetEncDecCryptHandleForDriver(SceCloudDataSignCryptHandle *pHandle);
</source>
=== sceSblSsMgrCloudDataGetSignCryptHandleForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.010.031 || not present
|-
| 3.100.081-3.740.011 || 0x739C981E
|}
This is a guessed name.
Used in [[SceAppMgr#sceAppMgrCloudDataVerifyHeaderForDriver]] and [[SceAppMgr#sceAppMgrLocalBackupVerifyOfflineHeader]].
<source lang="C">
typedef struct SceCloudDataSignCryptHandleBlock { // size is 0x104
    SceUInt8 data[0x100];
    SceSize size; // ex: 4 for exponent, 0x100 for modulus. Normal range is 0-0x100.
} SceCloudDataSignCryptHandleBlock;
typedef struct SceCloudDataSignCryptHandle { // size is 0x208
    SceCloudDataSignCryptHandleBlock rsa_modulus;
    SceCloudDataSignCryptHandleBlock rsa_exponent;
} SceCloudDataSignCryptHandle;
// mode: must be 1
// idx: must be 1
int sceSblSsMgrCloudDataGetSignCryptHandleForDriver(SceUInt32 mode, SceUInt32 idx, SceCloudDataSignCryptHandle *pHandle);
</source>
=== sceSblSsMgrCloudDataStopForDriver ===
{| class="wikitable"
|-
! Version !! NID
|-
| 0.931.010-3.010.031 || not present. Moved from [[SceSblSsMgr]].
|-
| 3.100.081-3.740.011 || 0x2BF04B8E
|}
This is a guessed name.
Clears Cloud Data Key Ring.
Used in [[SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver]], [[SceAppMgr#sceAppMgrCloudDataVerifyHeaderForDriver]] and [[SceAppMgr#sceAppMgrLocalBackupVerifyOfflineHeader]].
<source lang="C">int sceSblSsMgrCloudDataStopForDriver(void);</source>


== SceZlibForDriver ==
== SceZlibForDriver ==
This library was moved from [[SceSysmem#SceZlibForDriver]] on FW 1.800.071.


== SceSblFwLoaderForDriver ==
== SceSblFwLoaderForDriver ==
This library was moved from [[SceSblFwLoader#SceSblFwLoaderForDriver]] since System Software version 1.800.071.


== SceSblPmMgr ==
== SceSblPmMgr ==
Line 384: Line 752:
| 3.60 || 0x41FE8A37
| 3.60 || 0x41FE8A37
|}
|}
Calls [[#sceSblPmMgrSetProductModeForDriver|sceSblPmMgrSetProductModeForDriver]](0).
<source lang="C">int sceSblPmMgrSetProductModeOffForUser(void);</source>


=== sceSblPmMgrGetProductModeForUser ===
=== sceSblPmMgrGetProductModeForUser ===
Line 395: Line 767:
Returns 0 on success.
Returns 0 on success.


Gets sysroot_buffer using [[SceSysmem#sceKernelGetSysrootBufferForDriver|sceKernelGetSysrootBufferForDriver]].
Gets KBL Param using [[SceSysmem#sceKernelSysrootGetKblParamForKernel|sceKernelSysrootGetKblParamForKernel]].


result = ((int *)(sysroot_buffer->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag
result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag


<source lang="C">int sceSblPmMgrGetProductModeForUser(int* result);</source>
<source lang="C">int sceSblPmMgrGetProductModeForUser(int* result);</source>
Line 409: Line 781:
|}
|}


Calls [[SceSblPostSsMgr#sceSblPostSsMgrExecutePmSmF00dCommand8ForDriver|sceSblPostSsMgrExecutePmSmF00dCommand8ForDriver]].
Calls [[SceSblPostSsMgr#sceSblPmMgrGetProductModeFromNVSForDriver|sceSblPmMgrGetProductModeFromNVSForDriver]].


=== sceSblPmMgrAuthEtoI ===
=== sceSblPmMgrAuthEtoI ===
Line 416: Line 788:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xBD38B141
| 0.990-3.60 || 0xBD38B141
|}
|}
Calls [[#sceSblPmMgrAuthEtoIForDriver|sceSblPmMgrAuthEtoIForDriver]]().
Returns an integer on success.
<source lang="C">int sceSblPmMgrAuthEtoI(void);</source>


=== sceSblPmMgrGetCurrentMode ===
=== sceSblPmMgrGetCurrentMode ===
Line 429: Line 807:
Returns 0 on success.
Returns 0 on success.


Gets sysroot_buffer using [[SceSysmem#sceKernelGetSysrootBufferForDriver|sceKernelGetSysrootBufferForDriver]].
Gets KBL Param using [[SceSysmem#sceKernelSysrootGetKblParamForKernel|sceKernelSysrootGetKblParamForKernel]].


result = ((int *)(sysroot_buffer->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag
result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag


<source lang="C">int sceSblPmMgrGetCurrentMode(int* result);</source>
<source lang="C">int sceSblPmMgrGetCurrentMode(int* result);</source>
Line 497: Line 875:
== SceSblLicMgr ==
== SceSblLicMgr ==


Functions related to [[F00D_Commands#act_sm.self|afv file]].
Functions related to [[Secure_Modules_Functions#act_sm.self|AFV file]].


=== sceSblLicMgrGetIssueNo ===
=== sceSblLicMgrGetIssueNo ===
Line 549: Line 927:
|}
|}


<source lang="C">
Activates from ux0:/data/activate/.
// activates from ux0:/data/activate/
 
int sceSblLicMgrActivateFromFs();
<source lang="C">int sceSblLicMgrActivateFromFs(void);</source>
</source>


=== sceSblLicMgrGetUsageTimeLimit ===
=== sceSblLicMgrGetUsageTimeLimit ===
Line 562: Line 939:
|}
|}


<source lang="C">int sceSblLicMgrGetUsageTimeLimit(int *time_limit);</source>
<source lang="C">
/*
* sceSblLicMgrGetUsageTimeLimit:
*  0x800f1326:
*    DEX:  "This testing kit is not activated."
*    Tool: "This development kit is not activated."
*  0x800f1329:
*    "The backup battery has failed."
*  0x80251002:
*    "Cannot check expiration date. Please set date via Internet."
*  0:
*    Time_is_0:
*      DEX:  "This Testing Kit is expired. See DevKit/TestKit Activation  User\'s Guide."
*      Tool: "This Development Kit is expired. See DevKit/TestKit Activation User\'s Guide."
*    else:
*      DEX:  "This testing kit expires in %2d day +%02d:%02d:%02d"
*      Tool: "This development kit expires in %2d day +%02d:%02d:%02d"
*
* + "This testing kit expires in %2d day\n+%02d:%02d:%02d."
* + "This development kit expires in %2d day\n+%02d:%02d:%02d."
*/
 
int sceSblLicMgrGetUsageTimeLimit(SceUInt32 *time_limit);
</source>


Uses [[SceSblSsMgr#sceSblSsMgrGetQAFlagsForKernel|sceSblSsMgrGetQAFlagsForKernel]].
Uses [[SceSblSsMgr#sceSblSsMgrGetQAFlagsForKernel|sceSblSsMgrGetQAFlagsForKernel]].
Line 581: Line 981:
! Version !! NID
! Version !! NID
|-
|-
| 3.60 || 0xE9FA0FE5
| 0.940-3.60 || 0xE9FA0FE5
|}
|}


Line 657: Line 1,057:
<source lang="C">int sceSblUtMgrGetCurrentSecureTick(int* secure_tick);</source>
<source lang="C">int sceSblUtMgrGetCurrentSecureTick(int* secure_tick);</source>


=== sceSblUtMgrIsTrilithiumFlagEnabled ===
=== sceSblUtMgrGetUtName ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 666: Line 1,066:


<source lang="C">
<source lang="C">
// size = sizeof("UT_TRILITHIUM_FLAG") = 18
// name: buffer that will embed Utoken name if User Token for this app is valid
int SceSblUtMgr_04CA1311(char* buf, SceSize size);
// size: max size is 0x18
int sceSblUtMgrGetUtName(char *name, SceSize size);
</source>
</source>


buf takes value "UT_TRILITHIUM_FLAG" if a flag is enabled.
== SceSblSpsfoMgr ==
 
=== sceSblSpsfoMgrOpen ===
{| class="wikitable"
|-
! Version !! NID
|-
| 1.03 || 0x64B45B53
|}
 
<source lang="C">int sceSblSpsfoMgrOpen(char *path, spsfo_ctx *result);</source>
 
=== sceSblSpsfoMgrVerify ===
{| class="wikitable"
|-
! Version !! NID
|-
| 1.03 || 0x517CAF25
|}
 
<source lang="C">int sceSblSpsfoMgrVerify(spsfo_ctx *ctx, int *res, int *size);</source>
 
=== sceSblSpsfoMgrClose ===
{| class="wikitable"
|-
! Version !! NID
|-
| 1.03 || 0x3533B542
|}
 
<source lang="C">int sceSblSpsfoMgrClose(spsfo_ctx *ctx);</source>
 
[[Category:ARM]]
[[Category:Kernel]]
[[Category:Modules]]
[[Category:Library]]

Latest revision as of 23:28, 16 July 2023

Module

Version World Privilege
3.60 Non-secure Kernel

Libraries

Known NIDs

Version Name World Visibility NID
1.03-3.60 SceSblPostSsMgrForDriver Non-secure Kernel 0x2254E1B2
0.990-1.692 SceZlibForDriver Non-secure Kernel not present. Was present in SceSysmem#SceZlibForDriver.
1.800.071-3.60 SceZlibForDriver Non-secure Kernel 0xE241534E
0.990-1.692 SceSblFwLoaderForDriver Non-secure Kernel not present. Was present in SceSblFwLoader#SceSblFwLoaderForDriver.
1.800.071-3.60 SceSblFwLoaderForDriver Non-secure Kernel 0x6FE424E4
1.03-3.60 SceSblPmMgr Non-secure User 0xA9CE5795
1.03-3.60 SceSblRtcMgr Non-secure User 0x44C5F209
1.03-3.60 SceSblLicMgr Non-secure User 0x62083C72
1.03-3.60 SceSblUtMgr Non-secure User 0x000DF81A
1.03 SceSblSpsfoMgr Non-secure User 0x7959298B

Types

typedef struct spsfo_ctx {
  SceUID mem_uid; // SceSblSpsfoMgr
  void* mem_block_base;
  uint32_t unk_8;
} spsfo_ctx;

typedef struct SceUtoken { // size is 0x800
  char unk_data[0x800];
} SceUtoken;

typedef struct SceUtokenDecrypted { // size is 0x58
    SceUInt64 program_authority_id;
    SceSelfCapability capability;
    SceSelfAttribute attribute; // the important utoken flags are at &attribute+8
    SceUInt8 shared_secret_0[0x10];
} SceUtokenDecrypted;

typedef struct SceSblRsaDataParam {
	void *data;
	unsigned int size;
} SceSblRsaDataParam;

typedef struct SceSblRsaPublicKeyParam {
	const void *n;
	const void *k; // e/d
} SceSblRsaPublicKeyParam;

typedef struct SceSblRsaPrivateKeyParam {
	int unk_0x00;
	int unk_0x04;
	int unk_0x08;
	int unk_0x0C;
	void *p;
	void *q;
	void *dp; // d % (p - 1)
	void *dq; // d % (q - 1)
	void *qp; // q^-1 % p
} SceSblRsaPrivateKeyParam;

Not exported

module_start

Calls 2 subroutines:

  • init_qaftoken
  • init_utoken

init utoken

Reads tm0:utoken.dat.

Calls utoken_sm.self service 2 to decrypt SceUtoken buffer. The output is a 0x58 bytes buffer.

SceSblPostSsMgrForDriver

sceSblSpsfoMgrOpenForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0xBDF18922
int sceSblSpsfoMgrOpenForDriver(const char *path, spsfo_ctx *result);

sceSblSpsfoMgrVerifyForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0x686B9461

Derived from _vshSblAuthMgrVerifySpsfo.

int sceSblSpsfoMgrVerifyForDriver(spsfo_ctx *ctx, int *res, int *size);

sceSblSpsfoMgrCloseForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0xAD3B0078
int sceSblSpsfoMgrCloseForDriver(spsfo_ctx *ctx);

sceSblLicMgrGetActivationKeyForDriver

Version NID
0.990.000-3.740.011 0xF7F1015B
typedef struct activation_key { // size is 0x14
   char open_psid[0x10]; // obtained with sceSblSsMgrGetOpenPsIdForDriver
   uint32_t vadd_hash; // result of vector add operation applied to open_psid
} activation_key;

int sceSblLicMgrGetActivationKeyForDriver(activation_key* key);

sceSblLicMgrActivateDevkitForDriver

Version NID
0.990.000-3.740.011 0x0298382B
int sceSblLicMgrActivateDevkitForDriver(char *afv_path);

sceSblLicMgrGetLicenseStatusForDriver

Version NID
0.990.000-3.740.011 0x15F37282
// Return value: -1 = not initialized, 0 = activated, 1 = expired, 2 = RTC backup battery failure
int sceSblLicMgrGetLicenseStatusForDriver(void);

sceSblLicMgrGetExpireDateForDriver

Version NID
0.990.000-3.740.011 0x4FF2682F

Get activation data expire date.

If sceSblAIMgrIsToolDVT1ForDriver, 30/10/2011 8:00:00.

If sceSblAIMgrIsToolRev4ForDriver or TEST, expire_date = 0xFFFFFFFF.

If sceSblAIMgrIsToolDVT2ForDriver, 30/6/2012 8:00:00.

If sceSblAIMgrIsDEXForDriver and product_sub_code = 0xA, 0xB or 0xC, 31/3/2012 14:59:00.

// If read_from_nvs is false, it reads expire_date from SceSblPostSsMgr memory, else it reads NVS and queries act_sm.
int sceSblLicMgrGetExpireDateForDriver(int *expire_date, SceBool read_from_nvs);

sceSblPmMgrSetProductModeForDriver

Version NID
0.990.000-3.740.011 0xADF92824

Executes pm_sm.self commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.

  • If enable = 0, it calls pm_set(5). The console exits Manufacturing Mode.
  • If enable = 1, it calls pm_set(4). That console enters Manufacturing Mode.
int sceSblPmMgrSetProductModeForDriver(SceBool enable);

sceSblPmMgrSetSdModeOffForDriver

Version NID
0.931.010-0.996.090 not present
1.000.071-3.740.011 0xFE92A318

Executes pm_sm.self commands 2, 3, 4, 5, 6, 7, 8, 9, 0xA.

If productMode != 0 (normal mode), it calls pm_set(7, use_new_ernie_protocol).

int sceSblPmMgrSetSdModeOffForDriver(SceUInt32 productMode);

sceSblPmMgrGetProductModeFromNVSForDriver

Version NID
0.990.000-3.740.011 0x4663C195

Executes pm_sm.self command 1.

int sceSblPmMgrGetProductModeFromNVSForDriver(SceUInt8 *pProductMode);

sceSblPmMgrAuthEtoIForDriver

Version NID
0.990.000-3.740.011 0x19B63D65

Returns jig_auth(12). Returns an integer on success.

jig_auth:

  • On 0.990: executes pm_sm_sd.self commands 3 (gen_req_hello), 4 (gen_challenge), 5 (check_response), 6 (gen_req_result), 7 (check_result).
  • On 1.03-3.60: executes pm_sm_sd.self commands 9, 0xA.
int sceSblPmMgrAuthEtoIForDriver(void);

sceSblPostSsMgrDecryptSealedkeyForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0x33275F95

data is 0x50 bytes of data from sealedkey

This function:

verifies pfsSKKey header

decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using sceSblSsEncryptWithPortabilityForDriver

verifies hmac256 value in HMAC Value

decrypts Encrypted key into dst_secret

// data - size 0x50
// dst_secret - size 0x10
int sceSblPostSsMgrDecryptSealedkeyForDriver(char* data, char* dst_secret);

sceSblPostSsMgrEncryptSealedkeyForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0x08525D8D

data is 0x50 bytes of data like in sealedkey

This function:

writes pfsSKKey header

decrypts aes_key(pfsSKKey__EncKey) and hmac_key(pfsSKKey__Secret) using sceSblSsEncryptWithPortabilityForDriver

randomly generates 0x10 bytes of IV with sceSblRngPseudoRandomNumberForDriver

randomly generates 0x10 bytes of secret with sceSblRngPseudoRandomNumberForDriver

encrypts the secret into Encrypted key

calculates hmac256 value into HMAC Value

// dest_data - size 0x50
int sceSblPostSsMgrEncryptSealedkeyForDriver(char* dest_data);

sceSblPostSsMgrVerifyKeystoneForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0xDDA6FA6D

This function verifies magic in the header and HMAC of the keystone file.

int sceSblPostSsMgrVerifyKeystoneForDriver(char* data, int version);

sceSblPostSsMgrVerifyKeystoneWithPasscodeForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0xF86F1452

This function calls sceSblPostSsMgrVerifyKeystoneForDriver. Then also verifies HMAC of passcode.

int sceSblPostSsMgrVerifyKeystoneWithPasscodeForDriver(char* keystone_data, char* passcode);

sceSblPostSsMgrDebugEncryptKeystoneForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0x42474C8B
int sceSblPostSsMgrDebugEncryptKeystoneForDriver(char* src_secret, char* dest_data);

sceSblPostSsMgrDebugDecryptKeystoneForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0xCC5AA5A5
int sceSblPostSsMgrDebugDecryptKeystoneForDriver(char* keystone_data, char* dst_secret);

sceSblPostSsMgrGenerateAppKeyForDriver

Version NID
0.931.010-3.010.031 not present
3.100.081-3.740.011 0x2646DE64

This name was derived from SceVshBridge#_vshSblSsGenerateAppKey.

int sceSblPostSsMgrGenerateAppKeyForDriver(void *in, void *out);

sceSblUtMgrIsAllowComTestForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0x128FB35A

Temp name was sceSblUtMgrIsUtokenProgramForDriver.

pseudo-code:

SceBool sceSblUtMgrIsAllowComTestForDriver(SceUID pid) {
  SceBool ret;
  SceUInt32 stack_cookie;
  SceUInt32 ret2;
  SceUInt32 paid[2];
  if (g_has_com_test_flag == 0 || sceSblACMgrGetPaidForKernel(pid, &paid) != 0)
    ret = false;
  else
    ret = g_ut_paid_hi == paid[1] && g_ut_paid_low == paid[0];
  if (stack_cookie != 0)
    __stack_chk_fail();
  return ret;
}
SceBool sceSblUtMgrIsAllowComTestForDriver(SceUID pid);

sceSblUtMgrUpdateUtokenForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0xC2E58CE3

Executes utoken_sm command 1 to verify buffer, then writes the 0x800 bytes buffer to tm0:utoken/utoken.dat.

// size = 0x800
int sceSblUtMgrExecuteUtokenSmCommand1ForDriver(char* buf, SceSize size);

sceSblUtMgrResetUtokenFileForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0x1FF699DD

Writes blank 0x800 bytes to tm0:utoken/utoken.dat or removes it.

Exported to usermode by sceSblUtMgrResetUtokenFile.

int sceSblUtMgrResetUtokenFileForDriver(void);

sceSblUtMgrHasComTestFlagForDriver

Version NID
0.931.010-0.990.000 not present
0.996.090-3.740.011 0x7ACCAA50

Derived from vshSblUtMgrHasComTestFlag.

int sceSblUtMgrHasComTestFlagForDriver(void);

sceSblUtMgrHasStoreFlagForDriver

Version NID
0.931.010-1.61 not present
1.660.011-3.740.011 0x9D2E2D39

Derived from vshSblUtMgrHasStoreFlag.

int sceSblUtMgrHasStoreFlagForDriver(void);

sceSblUtMgrHasNpTestFlagForDriver

Version NID
0.931.010-3.20 not present
3.300.041-3.740.011 0x9FD835B0

Derived from vshSblUtMgrHasNpTestFlag.

int sceSblUtMgrHasNpTestFlagForDriver(void);

sceSblUtMgrHasUNK1FlagForDriver

Version NID
0.931.010-0.996.090 not present
1.000.071-3.740.011 0x22599675
int sceSblUtMgrHasUNK1FlagForDriver(void);

sceSblUtMgrHasUNK2FlagForDriver

Version NID
0.931.010-2.50 not present
3.000.071-3.740.011 0x9B49C249
int sceSblUtMgrHasUNK2FlagForDriver(void);

sceSblUtMgrHasUNK3FlagForDriver

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0x1923D80D
int sceSblUtMgrHasUNK3FlagForDriver(void);

sceSblUtMgrHasUNK4FlagForDriver

Version NID
0.931.010-1.81 not present
2.000.081-3.740.011 0xC93C0A0D
int sceSblUtMgrHasUNK4FlagForDriver(void);

sceSblUtMgrGetTrilithiumBufferForDriver

Version NID
0.931.010-3.100.081 not present
3.180.011-3.740.011 0xABDD68CD
int sceSblUtMgrGetTrilithiumBufferForDriver(SceUtokenDecrypted *buffer);

sceSblRtcMgrSetCpRtcForDriver

Version NID
0.990.000-3.740.011 0x3F9BDEDF

Set RTC in DevKit CP.

int sceSblRtcMgrSetCpRtcForDriver(int rtc);

sceSblRtcMgrGetCpRtcPhysicalForDriver

Version NID
0.990.000-3.740.011 0x942010A0
int sceSblRtcMgrGetCpRtcPhysicalForDriver(int *rtc);

sceSblRtcMgrGetCpRtcLogicalForDriver

Version NID
0.990.000-3.740.011 0xDE5150FE
int sceSblRtcMgrGetCpRtcLogicalForDriver(int *rtc);

SceSblPostSsMgrForDriver_D8A2D465

Version NID
0.931.010-1.06 not present
1.500.151-3.740.011 0xD8A2D465

Related to Activation file.

Returns true if a1 and a2 are identical to some values in memory.

SceBool SceSblPostSsMgrForDriver_D8A2D465(int a1, int a2);

SceSblPostSsMgrForDriver_2C463AF1

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0x2C463AF1

Used just before SceSblPostSsMgrForDriver_CB5436BD.

int SceSblPostSsMgrForDriver_2C463AF1(int maybe_keyset, SceSize size, void *buf);

SceSblPostSsMgrForDriver_CB5436BD

Version NID
0.931.010-3.01 not present
3.100.081-3.740.011 0xCB5436BD

Transforms? coredump key.

int SceSblPostSsMgrForDriver_CB5436BD(int maybe_keyset, SceSize size, void *buf);

sceSblRSA2048CreateSignatureForDriver

Version NID
0.931.010-2.060.011 not present
2.100.081-3.740.011 0x07BAD056

This is a guessed name.

Creates a RSA 2048 signature.

Used in SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver.

int sceSblRSA2048CreateSignatureForDriver(SceSblRsaDataParam *dst, SceSblRsaDataParam *hash, SceSblRsaPrivateKeyParam *private_key, int type);

sceSblRSA2048VerifySignatureForDriver

Version NID
0.931.010-2.060.011 not present
2.100.081-3.740.011 0x3DB69911

This is a guessed name.

Verfies a RSA 2048 signature.

int sceSblRSA2048VerifySignatureForDriver(SceSblRsaDataParam *rsa_signature, SceSblRsaDataParam *hash, SceSblRsaPublicKeyParam *public_key, int type);

sceSblSsMgrCloudDataGetEncDecCryptHandleForDriver

Version NID
0.931.010-3.010.031 not present
3.100.081-3.740.011 0xC6684F7E

This is a guessed name.

Gets the entire Cloud Data Key Ring.

Used in SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver.

typedef struct SceCloudDataKeyRing { // size is 0x2A0
    char magic[8]; // "CloudBU\0"
    SceUInt32 unk_8; // ex: 0 or 1
    SceUInt8 unk_0xC[0x294];
} SceCloudDataKeyRing;

typedef struct SceCloudDataSignCryptHandle { // size is 0x2A0
    SceCloudBUKeyRing keyring;
} SceCloudDataSignCryptHandle;

int sceSblSsMgrCloudDataGetEncDecCryptHandleForDriver(SceCloudDataSignCryptHandle *pHandle);

sceSblSsMgrCloudDataGetSignCryptHandleForDriver

Version NID
0.931.010-3.010.031 not present
3.100.081-3.740.011 0x739C981E

This is a guessed name.

Used in SceAppMgr#sceAppMgrCloudDataVerifyHeaderForDriver and SceAppMgr#sceAppMgrLocalBackupVerifyOfflineHeader.

typedef struct SceCloudDataSignCryptHandleBlock { // size is 0x104
    SceUInt8 data[0x100];
    SceSize size; // ex: 4 for exponent, 0x100 for modulus. Normal range is 0-0x100.
} SceCloudDataSignCryptHandleBlock;

typedef struct SceCloudDataSignCryptHandle { // size is 0x208
    SceCloudDataSignCryptHandleBlock rsa_modulus;
    SceCloudDataSignCryptHandleBlock rsa_exponent;
} SceCloudDataSignCryptHandle;

// mode: must be 1
// idx: must be 1
int sceSblSsMgrCloudDataGetSignCryptHandleForDriver(SceUInt32 mode, SceUInt32 idx, SceCloudDataSignCryptHandle *pHandle);

sceSblSsMgrCloudDataStopForDriver

Version NID
0.931.010-3.010.031 not present. Moved from SceSblSsMgr.
3.100.081-3.740.011 0x2BF04B8E

This is a guessed name.

Clears Cloud Data Key Ring.

Used in SceAppMgr#sceAppMgrCloudDataCreateHeaderForDriver, SceAppMgr#sceAppMgrCloudDataVerifyHeaderForDriver and SceAppMgr#sceAppMgrLocalBackupVerifyOfflineHeader.

int sceSblSsMgrCloudDataStopForDriver(void);

SceZlibForDriver

This library was moved from SceSysmem#SceZlibForDriver on FW 1.800.071.

SceSblFwLoaderForDriver

This library was moved from SceSblFwLoader#SceSblFwLoaderForDriver since System Software version 1.800.071.

SceSblPmMgr

sceSblPmMgrSetProductModeOffForUser

Version NID
3.60 0x41FE8A37

Calls sceSblPmMgrSetProductModeForDriver(0).

int sceSblPmMgrSetProductModeOffForUser(void);

sceSblPmMgrGetProductModeForUser

Version NID
3.60 0x46EA9FDB

Returns 0 on success.

Gets KBL Param using sceKernelSysrootGetKblParamForKernel.

result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag

int sceSblPmMgrGetProductModeForUser(int* result);

sceSblPmMgrGetProductModeFromNVS

Version NID
3.60 0x49CE0DDF

Calls sceSblPmMgrGetProductModeFromNVSForDriver.

sceSblPmMgrAuthEtoI

Version NID
0.990-3.60 0xBD38B141

Calls sceSblPmMgrAuthEtoIForDriver().

Returns an integer on success.

int sceSblPmMgrAuthEtoI(void);

sceSblPmMgrGetCurrentMode

Version NID
3.60 0xDA4EDEBF

Returns 0 on success.

Gets KBL Param using sceKernelSysrootGetKblParamForKernel.

result = ((int *)(pKblParam->boot_type_indicator_1) >> 2) & 1; // manufacturing mode flag

int sceSblPmMgrGetCurrentMode(int* result);

SceSblRtcMgr

sceSblRtcMgrGetCpRtcPhysicalForUser

Version NID
3.60 0x1614302B

sceSblRtcMgrSetCpActivationKey

Version NID
3.60 0x298AE544

sceSblRtcMgrSetCpRtcPhysicalAndKey

Version NID
3.60 0x3C0EEC69

sceSblRtcMgrSetCpRtcLogical

Version NID
3.60 0x9DFB118B

sceSblRtcMgrSetCpRtcPhysicalForUser

Version NID
3.60 0xA990BC44

sceSblRtcMgrGetCpRtcLogical

Version NID
3.60 0xDD44D726

sceSblRtcMgrGetCpSerialId

Version NID
3.60 0xE162A827

Calls sceDeci4pCpupGetCpSerialIdForDriver.

SceSblLicMgr

Functions related to AFV file.

sceSblLicMgrGetIssueNo

Version NID
3.60 0x0E0691A1
// if request_data_flag is 0 then some cached value is used
// if request_data_flag is 1 then data is requested from syscon
int sceSblLicMgrGetIssueNo(int *issue_number, int request_data_flag);

sceSblLicMgrGetLicenseStatus

Version NID
3.60 0x0EA6A30C
int sceSblLicMgrGetLicenseStatus();

sceSblLicMgrGetActivationKey

Version NID
3.60 0x2A437187
typedef struct activation_key // size is 0x14
{
   char open_psid[0x10]; // obtained with sceSblSsMgrGetOpenPsIdForDriver
   uint32_t vadd_hash; // result of vector add operation applied to openPSID
} activation_key;

int sceSblLicMgrGetActivationKey(activation_key* key);

sceSblLicMgrActivateFromFs

Version NID
3.60 0x6E56EA0A

Activates from ux0:/data/activate/.

int sceSblLicMgrActivateFromFs(void);

sceSblLicMgrGetUsageTimeLimit

Version NID
3.60 0x774EBBA2
/*
 * sceSblLicMgrGetUsageTimeLimit:
 *   0x800f1326:
 *     DEX:  "This testing kit is not activated."
 *     Tool: "This development kit is not activated."
 *   0x800f1329:
 *     "The backup battery has failed."
 *   0x80251002:
 *     "Cannot check expiration date. Please set date via Internet."
 *   0:
 *     Time_is_0:
 *       DEX:  "This Testing Kit is expired. See DevKit/TestKit Activation  User\'s Guide."
 *       Tool: "This Development Kit is expired. See DevKit/TestKit Activation User\'s Guide."
 *     else:
 *       DEX:  "This testing kit expires in %2d day +%02d:%02d:%02d"
 *       Tool: "This development kit expires in %2d day +%02d:%02d:%02d"
 *
 * + "This testing kit expires in %2d day\n+%02d:%02d:%02d."
 * + "This development kit expires in %2d day\n+%02d:%02d:%02d."
 */

int sceSblLicMgrGetUsageTimeLimit(SceUInt32 *time_limit);

Uses sceSblSsMgrGetQAFlagsForKernel.

sceSblLicMgrClearActivationData

Version NID
3.60 0x9B749D1D
int sceSblLicMgrClearActivationData();

sceSblLicMgrGetExpireDate

Version NID
0.940-3.60 0xE9FA0FE5
// if request_data_flag is 0 then some cached value is used
// if request_data_flag is 1 then data is requested from syscon
int sceSblLicMgrGetExpireDate(int *expire_date, int request_data_flag);

sceSblLicMgrActivateDevkit

Version NID
3.60 0xEB21DD39
// afv_path is of size 0x100
int sceSblLicMgrActivateDevkit(char* afv_path);

SceSblUtMgr

sceSblUtMgrUpdateUtoken

Version NID
3.60 0xBDE74645

Calls sceSblUtMgrUpdateUtokenForDriver(buf, 0x800);.

// size = 0x800
int sceSblUtMgrUpdateUtoken(char* buf, SceSize size);

sceSblUtMgrReadUtoken

Version NID
3.60 0xD2836E0D
// size = 0x800
int sceSblUtMgrReadUtoken(char *buf, int SceSize size);

sceSblUtMgrResetUtokenFile

Version NID
3.60 0x1CD57182

Calls sceSblUtMgrResetUtokenFileForDriver.

int sceSblUtMgrResetUtokenFile(void);

sceSblUtMgrGetCurrentSecureTick

Version NID
3.60 0xCFCB1355

Calls sceRtcGetCurrentSecureTickForDriver then uses sceKernelMemcpyKernelToUserForDriver.

int sceSblUtMgrGetCurrentSecureTick(int* secure_tick);

sceSblUtMgrGetUtName

Version NID
3.60 0x04CA1311
// name: buffer that will embed Utoken name if User Token for this app is valid
// size: max size is 0x18
int sceSblUtMgrGetUtName(char *name, SceSize size);

SceSblSpsfoMgr

sceSblSpsfoMgrOpen

Version NID
1.03 0x64B45B53
int sceSblSpsfoMgrOpen(char *path, spsfo_ctx *result);

sceSblSpsfoMgrVerify

Version NID
1.03 0x517CAF25
int sceSblSpsfoMgrVerify(spsfo_ctx *ctx, int *res, int *size);

sceSblSpsfoMgrClose

Version NID
1.03 0x3533B542
int sceSblSpsfoMgrClose(spsfo_ctx *ctx);