![]() |
vitasdk
Documentation of the vitasdk
|
Exports for Kernel. More...
Data Structures | |
| struct | ScePsmDrmKeySet |
| struct | ScePsmDrmExpireTime |
| struct | SceNpDrmActivationData |
| struct | SceNpDrmLicense |
| struct | ScePsmDrmLicense |
Functions | |
| VITASDK_BUILD_ASSERT_EQ (0x200, ScePsmDrmKeySet) | |
| VITASDK_BUILD_ASSERT_EQ (0x10, ScePsmDrmExpireTime) | |
| VITASDK_BUILD_ASSERT_EQ (0x1038, SceNpDrmActivationData) | |
| VITASDK_BUILD_ASSERT_EQ (0x200, SceNpDrmLicense) | |
| VITASDK_BUILD_ASSERT_EQ (0x400, ScePsmDrmLicense) | |
| int | ksceNpDrmGetRifName (char *name, SceUInt64 aid) |
| Get license file name. | |
| int | ksceNpDrmGetFixedRifName (char *name, SceUInt64 aid) |
| Get license file name with fixed. | |
| int | ksceNpDrmReadActData (SceNpDrmActivationData *act_data) |
| Get current activation data. | |
| int | ksceNpDrmCheckActData (int *act_type, int *version_flag, SceUInt64 *account_id, SceUInt64 *act_start_time, SceUInt64 *act_end_time) |
| Check you have npdrm activation data, and get information from it. | |
| int | ksceNpDrmGetRifVitaKey (const SceNpDrmLicense *license, void *klicense, int *flags, int *sku_flags, SceUInt64 *lic_start_time, SceUInt64 *lic_exp_time) |
| Get license key info. | |
| int | ksceNpDrmGetRifPspKey (const SceNpDrmLicense *license, void *klicense, int *flags, SceUInt64 *lic_start_time, SceUInt64 *lic_exp_time) |
| Get license key info for a PSP game. | |
| int | ksceNpDrmGetRifInfo (const SceNpDrmLicense *license, SceSize license_size, int check_sign, char *content_id, SceUInt64 *account_id, int *license_version, int *drm_type, int *flags, int *sku_flags, SceInt64 *lic_start_time, SceInt64 *lic_exp_time, SceUInt64 *rif_data_0x98) |
| Get license info. | |
| int | ksceNpDrmEbootSigVerify (const char *eboot_pbp_path, const void *eboot_signature) |
| Verify a eboot.pbp signature "__sce_ebootpbp". | |
| int | ksceNpDrmPspEbootVerify (const char *eboot_pbp_path, const void *eboot_signature) |
| Verify an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" from firmware <2.00. | |
| int | ksceNpDrmPspEbootSigGen (const char *eboot_pbp_path, const void *eboot_sha256, void *eboot_signature) |
| Generate an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" for a PSP game - this is unused in firmware >2.00. | |
| int | ksceNpDrmEbootSigConvert (const char *eboot_pbp_path, const void *old_eboot_signature, void *new_eboot_signature) |
| Convert an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" to a 0x200 byte one used in firmwares >2.00. | |
| int | ksceNpDrmEbootSigGenPsp (const char *eboot_pbp_path, const void *eboot_sha256, void *eboot_signature, int sw_version) |
| Generate eboot.pbp signature "__sce_ebootpbp" for a PSP game. | |
| int | ksceNpDrmEbootSigGenPs1 (const char *eboot_pbp_path, const void *eboot_sha256, void *eboot_signature, int sw_version) |
| Generate eboot.pbp signature "__sce_ebootpbp" for a single-disc PS1 game. | |
| int | ksceNpDrmEbootSigGenMultiDisc (const char *eboot_pbp_path, const void *sce_discinfo, void *eboot_signature, int sw_version) |
| Generate eboot.pbp signature "__sce_discinfo" for a multi-disc PS1 game. | |
| int | ksceNpDrmGetLegacyDocKey (const void *rif, const void *doc_edat, SceSize doc_edat_size, void *legacy_doc_key) |
| Get a legacy PSP document key. | |
| int | ksceNpDrmGetRifNameForInstall (char *rif_name, const SceNpDrmLicense *license, SceBool is_fixed) |
| Get a RIF name for installation. | |
| SceBool | ksceNpDrmIsLooseAccountBind (void) |
| int | ksceNpDrmPackageSetGameExist (SceBool game_exists) |
| Set whether package game content exists. | |
| int | ksceNpDrmPresetRifProvisionalFlag (SceNpDrmLicense *license, SceBool enable) |
| Set or clear a RIF's provisional flag. | |
| int | ksceNpDrmRemoveActData (SceUInt64 *account_id) |
| Remove tm0:/npdrm/act.dat and clear the cached activation data. | |
| int | ksceNpDrmUpdateAccountId (SceUInt64 account_id) |
| Update the cached NP account ID. | |
| int | ksceNpDrmUpdateActData (void) |
| Reload and validate tm0:/npdrm/act.dat and refresh the cached activation keys. | |
| int | ksceNpDrmUpdateDebugSettings (void) |
| Refresh the cached NPDRM debug and loose-account-binding settings. | |
| int | ksceNpDrmVerifyRif (const SceNpDrmLicense *license, SceSize license_size) |
| Verify a RIF signature. | |
| int | ksceNpDrmVerifyRifFull (SceNpDrmLicense *license) |
| Fully validate a RIF and update it in place. | |
| int | ksceNpDrmWriteActData (const void *npdrm_act_data, const void *aes_dec_key) |
| Validate and install NPDRM activation data. | |
Exports for Kernel.
Include the header file in your project:
Include the header file in your project:
Link the library to the executable:
| struct ScePsmDrmKeySet |
| struct ScePsmDrmExpireTime |
| Data Fields | ||
|---|---|---|
| SceRtcTick * | start_date | |
| SceRtcTick * | end_date | |
| int | pad[2] | |
| struct SceNpDrmActivationData |
| Data Fields | ||
|---|---|---|
| SceInt16 | act_type | |
| SceInt16 | version_flag | |
| SceInt32 | version | |
| SceUInt64 | account_id | |
| SceUInt8 | primary_key_table[0x80][0x10] | |
| SceUInt8 | unk1[0x40] | |
| SceUInt8 | openpsid[0x10] | |
| SceUInt8 | unk2[0x10] | |
| SceUInt8 | unk3[0x10] | |
| SceUInt8 | secondary_key_table[0x65][0x10] | |
| SceUInt8 | rsa_signature[0x100] | |
| SceUInt8 | unk_sigmature[0x40] | |
| SceUInt8 | ecdsa_signature[0x28] | |
| struct SceNpDrmLicense |
| Data Fields | ||
|---|---|---|
| SceInt16 | version | |
| SceInt16 | version_flags | |
| SceInt16 | license_type | |
| SceInt16 | license_flags | |
| SceUInt64 | account_id | |
| char | content_id[0x30] | |
| char | key_table[0x10] | |
| char | key1[0x10] | |
| SceRtcTick | start_time | |
| SceRtcTick | expiration_time | |
| char | ecdsa_signature[0x28] | |
| SceInt64 | flags | |
| char | key2[0x10] | |
| char | unk_0xB0[0x10] | |
| char | open_psid[0x10] | |
| char | unk_0xD0[0x10] | |
| char | cmd56_handshake_part[0x14] | |
| int | debug_upgradable | |
| int | unk_0xF8 | |
| int | sku_flag | |
| char | rsa_signature[0x100] | |
| struct ScePsmDrmLicense |
| Data Fields | ||
|---|---|---|
| char | magic[0x8] | |
| SceUInt32 | unk1 | |
| SceUInt32 | unk2 | |
| SceUInt64 | account_id | |
| SceUInt32 | unk3 | |
| SceUInt32 | unk4 | |
| SceRtcTick | start_time | |
| SceRtcTick | expiration_time | |
| SceUInt8 | activation_checksum[0x20] | |
| char | content_id[0x30] | |
| SceUInt8 | unk5[0x80] | |
| ScePsmDrmKeySet | keyset | |
| SceUInt8 | rsa_signature[0x100] | |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x200 | , |
| ScePsmDrmKeySet | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x10 | , |
| ScePsmDrmExpireTime | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x1038 | , |
| SceNpDrmActivationData | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x200 | , |
| SceNpDrmLicense | |||
| ) |
| VITASDK_BUILD_ASSERT_EQ | ( | 0x400 | , |
| ScePsmDrmLicense | |||
| ) |
| int ksceNpDrmGetRifName | ( | char * | name, |
| SceUInt64 | aid | ||
| ) |
Get license file name.
| [out] | name | - The pointer of license file name output buffer. size is 0x30. |
| [in] | aid | - The license account id |
| int ksceNpDrmGetFixedRifName | ( | char * | name, |
| SceUInt64 | aid | ||
| ) |
Get license file name with fixed.
| [out] | name | - The pointer of license file name output buffer. size is 0x30. |
| [in] | aid | - The license account id |
| int ksceNpDrmReadActData | ( | SceNpDrmActivationData * | act_data | ) |
Get current activation data.
| [out] | act_data | - The pointer of output activation data see:SceNpDrmActivationData. if ecdsa or rsa verify fail, will be all 0. |
| int ksceNpDrmCheckActData | ( | int * | act_type, |
| int * | version_flag, | ||
| SceUInt64 * | account_id, | ||
| SceUInt64 * | act_start_time, | ||
| SceUInt64 * | act_end_time | ||
| ) |
Check you have npdrm activation data, and get information from it.
| [out] | act_type | - The pointer of activation type output. |
| [out] | version_flag | - The pointer of version flag output. |
| [out] | account_id | - The pointer of activated account id output. |
| [out] | act_start_time | - The pointer of activation data start time output. |
| [out] | act_end_time | - Activation data expiration time output. |
| int ksceNpDrmGetRifVitaKey | ( | const SceNpDrmLicense * | license, |
| void * | klicense, | ||
| int * | flags, | ||
| int * | sku_flags, | ||
| SceUInt64 * | lic_start_time, | ||
| SceUInt64 * | lic_exp_time | ||
| ) |
Get license key info.
| [in] | license | - The pointer of license data. see:SceNpDrmLicense |
| [out] | klicense | - The pointer of klicense output buffer. size is 0x10. |
| [out] | flags | - The pointer of flags output. |
| [out] | sku_flags | - The pointer of sku flags output. |
| [out] | lic_start_time | - The pointer of license start time output. |
| [out] | lic_exp_time | - The pointer of license exp time output. |
| int ksceNpDrmGetRifPspKey | ( | const SceNpDrmLicense * | license, |
| void * | klicense, | ||
| int * | flags, | ||
| SceUInt64 * | lic_start_time, | ||
| SceUInt64 * | lic_exp_time | ||
| ) |
Get license key info for a PSP game.
| [in] | license | - The pointer of license data. see:SceNpDrmLicense |
| [out] | klicense | - The pointer of klicense output buffer. size is 0x10. |
| [out] | flags | - The pointer of flags output. |
| [out] | lic_start_time | - The pointer of license start time output. |
| [out] | lic_exp_time | - The pointer of license exp time output. |
| int ksceNpDrmGetRifInfo | ( | const SceNpDrmLicense * | license, |
| SceSize | license_size, | ||
| int | check_sign, | ||
| char * | content_id, | ||
| SceUInt64 * | account_id, | ||
| int * | license_version, | ||
| int * | drm_type, | ||
| int * | flags, | ||
| int * | sku_flags, | ||
| SceInt64 * | lic_start_time, | ||
| SceInt64 * | lic_exp_time, | ||
| SceUInt64 * | rif_data_0x98 | ||
| ) |
Get license info.
| [in] | license | - Required SceNpDrmLicense structure. |
| [in] | license_size | - Set to 0x200. FW 3.60 still reads the complete RIF when a smaller value is supplied. |
| [in] | check_sign | - Set to 1 to check the RIF signature. |
| [out] | content_id | - Optional 0x30-byte content ID output buffer. |
| [out] | account_id | - Optional license account ID output. |
| [out] | license_version | - Optional license version output; receives a SceUInt32 value. |
| [out] | drm_type | - Optional DRM type output; receives a SceUInt32 value. |
| [out] | flags | - Optional derived license flags output. |
| [out] | sku_flags | - Optional SKU flags output. |
| [out] | lic_start_time | - Optional license start time output; receives a SceRtcTick value. |
| [out] | lic_exp_time | - Optional license expiration time output; receives a SceRtcTick value. |
| [out] | rif_data_0x98 | - Optional raw 8-byte RIF field output. |
| int ksceNpDrmEbootSigVerify | ( | const char * | eboot_pbp_path, |
| const void * | eboot_signature | ||
| ) |
Verify a eboot.pbp signature "__sce_ebootpbp".
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | eboot_signature | - The pointer of data of __sce_ebootpbp signature. size is 0x200 |
| int ksceNpDrmPspEbootVerify | ( | const char * | eboot_pbp_path, |
| const void * | eboot_signature | ||
| ) |
Verify an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" from firmware <2.00.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | eboot_signature | - The pointer of data of __sce_ebootpbp signature. size is 0x100 |
| int ksceNpDrmPspEbootSigGen | ( | const char * | eboot_pbp_path, |
| const void * | eboot_sha256, | ||
| void * | eboot_signature | ||
| ) |
Generate an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" for a PSP game - this is unused in firmware >2.00.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | eboot_sha256 | - The pointer of SHA256 hash of first (data.psar offset + 0x1C0000) bytes into the EBOOT.PBP file |
| [out] | eboot_signature | - The pointer of the output eboot signature data. size is 0x100 |
| int ksceNpDrmEbootSigConvert | ( | const char * | eboot_pbp_path, |
| const void * | old_eboot_signature, | ||
| void * | new_eboot_signature | ||
| ) |
Convert an older 0x100 byte eboot.pbp signature "__sce_ebootpbp" to a 0x200 byte one used in firmwares >2.00.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | old_eboot_signature | - The pointer of old eboot signature data. size is 0x100 |
| [out] | new_eboot_signature | - The pointer of new eboot signature data. size is 0x200 |
| int ksceNpDrmEbootSigGenPsp | ( | const char * | eboot_pbp_path, |
| const void * | eboot_sha256, | ||
| void * | eboot_signature, | ||
| int | sw_version | ||
| ) |
Generate eboot.pbp signature "__sce_ebootpbp" for a PSP game.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | eboot_sha256 | - The pointer of SHA256 hash of first (data.psar offset + 0x1C0000) bytes into the EBOOT.PBP file |
| [out] | eboot_signature | - The pointer of the output eboot signature data. size is 0x200 |
| [in] | sw_version | - The minimum firmware version the signature can be used on. cannot be lower than current firmware |
| int ksceNpDrmEbootSigGenPs1 | ( | const char * | eboot_pbp_path, |
| const void * | eboot_sha256, | ||
| void * | eboot_signature, | ||
| int | sw_version | ||
| ) |
Generate eboot.pbp signature "__sce_ebootpbp" for a single-disc PS1 game.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | eboot_sha256 | - The pointer of SHA256 hash of first (data.psar offset + 0x1C0000) bytes into the EBOOT.PBP file |
| [out] | eboot_signature | - The pointer of the output eboot signature data. size is 0x200 |
| [in] | sw_version | - The minimum firmware version the signature can be used on. cannot be lower than current firmware |
| int ksceNpDrmEbootSigGenMultiDisc | ( | const char * | eboot_pbp_path, |
| const void * | sce_discinfo, | ||
| void * | eboot_signature, | ||
| int | sw_version | ||
| ) |
Generate eboot.pbp signature "__sce_discinfo" for a multi-disc PS1 game.
| [in] | eboot_pbp_path | - The pointer of the file path of the EBOOT.PBP file |
| [in] | sce_discinfo | - The pointer of contents of vs0:/app/NPXS10028/__sce_discinfo |
| [out] | eboot_signature | - The pointer of the output eboot signature data. size is 0x100 |
| [in] | sw_version | - The minimum firmware version the signature can be used on. cannot be lower than current firmware |
| int ksceNpDrmGetLegacyDocKey | ( | const void * | rif, |
| const void * | doc_edat, | ||
| SceSize | doc_edat_size, | ||
| void * | legacy_doc_key | ||
| ) |
Get a legacy PSP document key.
| [in] | rif | - RIF data. This is only read when required by the document header. |
| [in] | doc_edat | - Required document EDAT data with a PSPEDAT header; at least 0x90 bytes |
| [in] | doc_edat_size | - Size of the document EDAT data |
| [out] | legacy_doc_key | - Required legacy document key output buffer (0x10 bytes) |
| int ksceNpDrmGetRifNameForInstall | ( | char * | rif_name, |
| const SceNpDrmLicense * | license, | ||
| SceBool | is_fixed | ||
| ) |
Get a RIF name for installation.
| [out] | rif_name | - Required RIF name buffer (0x30 bytes) |
| [in] | license | - Required SceNpDrmLicense structure |
| [in] | is_fixed | - Set to 0 to derive the name from the RIF content ID, or 1 to request the fixed account-based name |
| SceBool ksceNpDrmIsLooseAccountBind | ( | void | ) |
| int ksceNpDrmPackageSetGameExist | ( | SceBool | game_exists | ) |
Set whether package game content exists.
FW 3.60 stores the value unchanged. Observed AppMgr callers use 0 or 1.
| [in] | game_exists | - Value indicating whether package game content exists |
| int ksceNpDrmPresetRifProvisionalFlag | ( | SceNpDrmLicense * | license, |
| SceBool | enable | ||
| ) |
| int ksceNpDrmRemoveActData | ( | SceUInt64 * | account_id | ) |
Remove tm0:/npdrm/act.dat and clear the cached activation data.
| [out] | account_id | - Optional account ID from the removed activation data |
| int ksceNpDrmUpdateAccountId | ( | SceUInt64 | account_id | ) |
Update the cached NP account ID.
A zero value reloads the account ID from the registry.
| [in] | account_id | - Account ID to cache, or 0 to reload it from the registry |
| int ksceNpDrmUpdateActData | ( | void | ) |
Reload and validate tm0:/npdrm/act.dat and refresh the cached activation keys.
| int ksceNpDrmUpdateDebugSettings | ( | void | ) |
Refresh the cached NPDRM debug and loose-account-binding settings.
| int ksceNpDrmVerifyRif | ( | const SceNpDrmLicense * | license, |
| SceSize | license_size | ||
| ) |
Verify a RIF signature.
| [in] | license | - Required RIF data (0x200 bytes) |
| [in] | license_size | - Set to 0x200. FW 3.60 still reads the complete RIF when a smaller value is supplied. |
| int ksceNpDrmVerifyRifFull | ( | SceNpDrmLicense * | license | ) |
Fully validate a RIF and update it in place.
On FW 3.60, the function may decrypt and move the RIF key and clear the trailing RIF fields on success.
| [in,out] | license | - Required RIF data (0x200 bytes) |
| int ksceNpDrmWriteActData | ( | const void * | npdrm_act_data, |
| const void * | aes_dec_key | ||
| ) |
Validate and install NPDRM activation data.
| [in] | npdrm_act_data | - Activation data (0x1040 bytes) |
| [in] | aes_dec_key | - Optional 0x10-byte AES key used to decrypt the activation data before validation |
| SceUInt8 ScePsmDrmKeySet::hmac_key[0x20] |
| SceUInt8 ScePsmDrmKeySet::key[0x10] |
| SceUInt8 ScePsmDrmKeySet::signature[0x1D0] |
| SceRtcTick* ScePsmDrmExpireTime::start_date |
| SceRtcTick* ScePsmDrmExpireTime::end_date |
| int ScePsmDrmExpireTime::pad[2] |
| SceInt16 SceNpDrmActivationData::act_type |
| SceInt16 SceNpDrmActivationData::version_flag |
| SceInt32 SceNpDrmActivationData::version |
| SceUInt64 SceNpDrmActivationData::account_id |
| SceUInt8 SceNpDrmActivationData::primary_key_table[0x80][0x10] |
| SceUInt8 SceNpDrmActivationData::unk1[0x40] |
| SceUInt8 SceNpDrmActivationData::openpsid[0x10] |
| SceUInt8 SceNpDrmActivationData::unk2[0x10] |
| SceUInt8 SceNpDrmActivationData::unk3[0x10] |
| SceUInt8 SceNpDrmActivationData::secondary_key_table[0x65][0x10] |
| SceUInt8 SceNpDrmActivationData::rsa_signature[0x100] |
| SceUInt8 SceNpDrmActivationData::unk_sigmature[0x40] |
| SceUInt8 SceNpDrmActivationData::ecdsa_signature[0x28] |
| SceInt16 SceNpDrmLicense::version |
| SceInt16 SceNpDrmLicense::version_flags |
| SceInt16 SceNpDrmLicense::license_type |
| SceInt16 SceNpDrmLicense::license_flags |
| SceUInt64 SceNpDrmLicense::account_id |
| char SceNpDrmLicense::content_id[0x30] |
| char SceNpDrmLicense::key_table[0x10] |
| char SceNpDrmLicense::key1[0x10] |
| SceRtcTick SceNpDrmLicense::start_time |
| SceRtcTick SceNpDrmLicense::expiration_time |
| char SceNpDrmLicense::ecdsa_signature[0x28] |
| SceInt64 SceNpDrmLicense::flags |
| char SceNpDrmLicense::key2[0x10] |
| char SceNpDrmLicense::unk_0xB0[0x10] |
| char SceNpDrmLicense::open_psid[0x10] |
| char SceNpDrmLicense::unk_0xD0[0x10] |
| char SceNpDrmLicense::cmd56_handshake_part[0x14] |
| int SceNpDrmLicense::debug_upgradable |
| int SceNpDrmLicense::unk_0xF8 |
| int SceNpDrmLicense::sku_flag |
| char SceNpDrmLicense::rsa_signature[0x100] |
| char ScePsmDrmLicense::magic[0x8] |
| SceUInt32 ScePsmDrmLicense::unk1 |
| SceUInt32 ScePsmDrmLicense::unk2 |
| SceUInt64 ScePsmDrmLicense::account_id |
| SceUInt32 ScePsmDrmLicense::unk3 |
| SceUInt32 ScePsmDrmLicense::unk4 |
| SceRtcTick ScePsmDrmLicense::start_time |
| SceRtcTick ScePsmDrmLicense::expiration_time |
| SceUInt8 ScePsmDrmLicense::activation_checksum[0x20] |
| char ScePsmDrmLicense::content_id[0x30] |
| SceUInt8 ScePsmDrmLicense::unk5[0x80] |
| ScePsmDrmKeySet ScePsmDrmLicense::keyset |
| SceUInt8 ScePsmDrmLicense::rsa_signature[0x100] |