vitasdk
Documentation of the vitasdk

Exports for User. More...

Data Structures

struct  SceNpDrmCheckActDataOpt
 
struct  SceNpDrmCheckDrmResetOpt
 
struct  SceNpDrmGetRifInfoOpt
 Optional outputs for _sceNpDrmGetRifInfo. More...
 

Functions

int _sceNpDrmGetRifName (char *rif_name, uint64_t aid)
 Get rif name.
 
int _sceNpDrmGetFixedRifName (char *rif_name, uint64_t aid)
 Get fixed rif name.
 
int _sceNpDrmCheckActData (int *act_type, int *version_flag, SceUInt64 *account_id, SceUInt64 opt[2])
 Check you have npdrm activation data, and get information from it.
 
int _sceNpDrmGetRifNameForInstall (char *rif_name, const SceNpDrmLicense *rif_data, int is_fixed)
 Get rif name for install.
 
 VITASDK_BUILD_ASSERT_EQ (0x10, SceNpDrmCheckActDataOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x18, SceNpDrmCheckDrmResetOpt)
 
 VITASDK_BUILD_ASSERT_EQ (0x28, SceNpDrmGetRifInfoOpt)
 
int _sceNpDrmCheckDrmReset (const void *input, SceSize input_size, const SceNpDrmCheckDrmResetOpt *opt)
 Check whether activation data must be reset.
 
int _sceNpDrmGetRifInfo (const SceNpDrmLicense *license, SceSize license_size, SceBool check_sign, const SceNpDrmGetRifInfoOpt *opt)
 Get RIF information.
 
int _sceNpDrmPresetRifProvisionalFlag (SceNpDrmLicense *license)
 Set the provisional flag in a RIF.
 
int _sceNpDrmRemoveActData (SceUInt64 *account_id)
 Remove tm0:/npdrm/act.dat and clear the cached activation data.
 

Variables

SceRtcTick * SceNpDrmCheckActDataOpt::act_start_time
 Optional activation start time output.
 
SceRtcTick * SceNpDrmCheckActDataOpt::act_exp_time
 Optional activation expiration time output.
 
SceUInt32 SceNpDrmCheckActDataOpt::reserved [2]
 Ignored on FW 3.60.
 
SceUInt64 SceNpDrmCheckDrmResetOpt::account_id
 Account ID to compare with the current activation data.
 
SceBool * SceNpDrmCheckDrmResetOpt::reset
 Optional output set to SCE_TRUE if this call reset act.dat.
 
SceSize SceNpDrmCheckDrmResetOpt::input_copy_size
 Number of input bytes to copy; set to input_size and do not exceed 0x40.
 
SceUInt32 SceNpDrmCheckDrmResetOpt::reserved [2]
 Ignored on FW 3.60.
 
char * SceNpDrmGetRifInfoOpt::content_id
 Optional 0x30-byte content ID output buffer.
 
SceUInt64 * SceNpDrmGetRifInfoOpt::account_id
 Optional license account ID output.
 
SceUInt32 * SceNpDrmGetRifInfoOpt::license_version
 Optional license version output.
 
SceUInt32 * SceNpDrmGetRifInfoOpt::drm_type
 Optional DRM type output.
 
SceUInt32 * SceNpDrmGetRifInfoOpt::flags
 Optional derived license flags output.
 
SceUInt32 * SceNpDrmGetRifInfoOpt::sku_flags
 Optional SKU flags output.
 
SceRtcTick * SceNpDrmGetRifInfoOpt::lic_start_time
 Optional license start time output.
 
SceRtcTick * SceNpDrmGetRifInfoOpt::lic_exp_time
 Optional license expiration time output.
 
SceUInt64 * SceNpDrmGetRifInfoOpt::rif_data_0x98
 Optional raw 8-byte RIF field output.
 
SceUInt32 SceNpDrmGetRifInfoOpt::reserved
 Ignored on FW 3.60.
 

Detailed Description

Exports for User.


Using this library in your project

Include the header file in your project:

#include <psp2/npdrm.h>


Link the library to the executable:

SceNpDrm_stub




Data Structure Documentation

◆ SceNpDrmCheckActDataOpt

struct SceNpDrmCheckActDataOpt
Data Fields
SceRtcTick * act_start_time Optional activation start time output.
SceRtcTick * act_exp_time Optional activation expiration time output.
SceUInt32 reserved[2] Ignored on FW 3.60.

◆ SceNpDrmCheckDrmResetOpt

struct SceNpDrmCheckDrmResetOpt
Data Fields
SceUInt64 account_id Account ID to compare with the current activation data.
SceBool * reset Optional output set to SCE_TRUE if this call reset act.dat.
SceSize input_copy_size Number of input bytes to copy; set to input_size and do not exceed 0x40.
SceUInt32 reserved[2] Ignored on FW 3.60.

◆ SceNpDrmGetRifInfoOpt

struct SceNpDrmGetRifInfoOpt

Optional outputs for _sceNpDrmGetRifInfo.

On FW 3.60, flags receives a derived bit field: bit 0 is set when the DRM type contains 0x2000 or the SKU flags equal 1, bit 1 mirrors the RIF provisional flag, bit 16 denotes OpenPsId binding, and bit 17 denotes game-card binding.

Data Fields
char * content_id Optional 0x30-byte content ID output buffer.
SceUInt64 * account_id Optional license account ID output.
SceUInt32 * license_version Optional license version output.
SceUInt32 * drm_type Optional DRM type output.
SceUInt32 * flags Optional derived license flags output.
SceUInt32 * sku_flags Optional SKU flags output.
SceRtcTick * lic_start_time Optional license start time output.
SceRtcTick * lic_exp_time Optional license expiration time output.
SceUInt64 * rif_data_0x98 Optional raw 8-byte RIF field output.
SceUInt32 reserved Ignored on FW 3.60.

Function Documentation

◆ _sceNpDrmGetRifName()

int _sceNpDrmGetRifName ( char *  rif_name,
uint64_t  aid 
)

Get rif name.

Parameters
[out]rif_name- Required RIF name buffer (48 bytes)
[in]aid- Account ID
Returns
0 on success, < 0 on error.

◆ _sceNpDrmGetFixedRifName()

int _sceNpDrmGetFixedRifName ( char *  rif_name,
uint64_t  aid 
)

Get fixed rif name.

Parameters
[out]rif_name- Required RIF name buffer (48 bytes)
[in]aid- Account ID
Returns
0 on success, < 0 on error.

◆ _sceNpDrmCheckActData()

int _sceNpDrmCheckActData ( int *  act_type,
int *  version_flag,
SceUInt64 *  account_id,
SceUInt64  opt[2] 
)

Check you have npdrm activation data, and get information from it.

Parameters
[out]act_type- Optional activation type output.
[out]version_flag- Optional activation version flag output.
[out]account_id- Optional activated account ID output.
[in]opt- Required pointer to a SceNpDrmCheckActDataOpt structure, passed as a SceUInt64 pointer for backwards compatibility. Both pointer types have the same ABI.
Returns
0 on success, < 0 on error.

◆ _sceNpDrmGetRifNameForInstall()

int _sceNpDrmGetRifNameForInstall ( char *  rif_name,
const SceNpDrmLicense *  rif_data,
int  is_fixed 
)

Get rif name for install.

Parameters
[out]rif_name- Required RIF name buffer (48 bytes)
[in]rif_data- Required RIF data (512 bytes)
[in]is_fixed- Set to 0 to derive the name from the RIF content ID, or 1 to request the fixed account-based name
Returns
0 on success, < 0 on error.

◆ VITASDK_BUILD_ASSERT_EQ() [1/3]

VITASDK_BUILD_ASSERT_EQ ( 0x10  ,
SceNpDrmCheckActDataOpt   
)

◆ VITASDK_BUILD_ASSERT_EQ() [2/3]

VITASDK_BUILD_ASSERT_EQ ( 0x18  ,
SceNpDrmCheckDrmResetOpt   
)

◆ VITASDK_BUILD_ASSERT_EQ() [3/3]

VITASDK_BUILD_ASSERT_EQ ( 0x28  ,
SceNpDrmGetRifInfoOpt   
)

◆ _sceNpDrmCheckDrmReset()

int _sceNpDrmCheckDrmReset ( const void *  input,
SceSize  input_size,
const SceNpDrmCheckDrmResetOpt *  opt 
)

Check whether activation data must be reset.

Parameters
[in]input- Required input data. If its first byte is zero, FW 3.60 returns success without checking or resetting act.dat.
[in]input_size- Size of the input data; must be in the range [2, 0x40]
[in]opt- Required structure containing the account ID, optional reset-result pointer, and input copy size. Set input_copy_size to input_size.
Returns
0 on success, < 0 on error.

◆ _sceNpDrmGetRifInfo()

int _sceNpDrmGetRifInfo ( const SceNpDrmLicense *  license,
SceSize  license_size,
SceBool  check_sign,
const SceNpDrmGetRifInfoOpt *  opt 
)

Get RIF information.

Parameters
[in]license- Required RIF data (0x200 bytes)
[in]license_size- Size of the RIF data
[in]check_sign- Set to SCE_TRUE to check the RIF signature
[in]opt- Required option structure containing optional output pointers
Returns
0 on success, < 0 on error.

◆ _sceNpDrmPresetRifProvisionalFlag()

int _sceNpDrmPresetRifProvisionalFlag ( SceNpDrmLicense *  license)

Set the provisional flag in a RIF.

The 0x200-byte RIF is modified in place. Its existing signature is validated with the provisional bit normalized.

Parameters
[in,out]license- RIF to update
Returns
0 on success, < 0 on error.

◆ _sceNpDrmRemoveActData()

int _sceNpDrmRemoveActData ( SceUInt64 *  account_id)

Remove tm0:/npdrm/act.dat and clear the cached activation data.

Parameters
[out]account_id- Optional account ID from the removed act.dat
Returns
0 on success, < 0 on error.

Variable Documentation

◆ act_start_time

SceRtcTick* SceNpDrmCheckActDataOpt::act_start_time

Optional activation start time output.

◆ act_exp_time

SceRtcTick* SceNpDrmCheckActDataOpt::act_exp_time

Optional activation expiration time output.

◆ reserved [1/3]

SceUInt32 SceNpDrmCheckActDataOpt::reserved[2]

Ignored on FW 3.60.

◆ account_id [1/2]

SceUInt64 SceNpDrmCheckDrmResetOpt::account_id

Account ID to compare with the current activation data.

◆ reset

SceBool* SceNpDrmCheckDrmResetOpt::reset

Optional output set to SCE_TRUE if this call reset act.dat.

◆ input_copy_size

SceSize SceNpDrmCheckDrmResetOpt::input_copy_size

Number of input bytes to copy; set to input_size and do not exceed 0x40.

◆ reserved [2/3]

SceUInt32 SceNpDrmCheckDrmResetOpt::reserved[2]

Ignored on FW 3.60.

◆ content_id

char* SceNpDrmGetRifInfoOpt::content_id

Optional 0x30-byte content ID output buffer.

◆ account_id [2/2]

SceUInt64* SceNpDrmGetRifInfoOpt::account_id

Optional license account ID output.

◆ license_version

SceUInt32* SceNpDrmGetRifInfoOpt::license_version

Optional license version output.

◆ drm_type

SceUInt32* SceNpDrmGetRifInfoOpt::drm_type

Optional DRM type output.

◆ flags

SceUInt32* SceNpDrmGetRifInfoOpt::flags

Optional derived license flags output.

◆ sku_flags

SceUInt32* SceNpDrmGetRifInfoOpt::sku_flags

Optional SKU flags output.

◆ lic_start_time

SceRtcTick* SceNpDrmGetRifInfoOpt::lic_start_time

Optional license start time output.

◆ lic_exp_time

SceRtcTick* SceNpDrmGetRifInfoOpt::lic_exp_time

Optional license expiration time output.

◆ rif_data_0x98

SceUInt64* SceNpDrmGetRifInfoOpt::rif_data_0x98

Optional raw 8-byte RIF field output.

◆ reserved [3/3]

SceUInt32 SceNpDrmGetRifInfoOpt::reserved

Ignored on FW 3.60.