vitasdk
Documentation of the vitasdk

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




Using this library in your project

Include the header file in your project:


Link the library to the executable:

SceNpDrmForDriver_stub



Functions

int _sceNpDrmGetRifName (char *rif_name, uint64_t aid)
 Get rif name. More...
 
int _sceNpDrmGetFixedRifName (char *rif_name, uint64_t aid)
 Get fixed rif name. More...
 
int _sceNpDrmCheckActData (int *act_type, int *version_flag, SceUInt64 *account_id, SceUInt64 act_exp_time[2])
 Check you have npdrm activation data, and get information from it. More...
 
int _sceNpDrmGetRifNameForInstall (char *rif_name, const SceNpDrmLicense *rif_data, int unk)
 Get rif name for install. More...
 
int scePsmDrmGetRifKey (const ScePsmDrmLicense *license_buf, ScePsmDrmKeySet *keydata, int *flags, ScePsmDrmExpireTime *exp_time)
 Get PSM rif key. More...
 
int ksceNpDrmGetRifName (char *name, SceUInt64 aid)
 Get license file name. More...
 
int ksceNpDrmGetFixedRifName (char *name, SceUInt64 aid)
 Get license file name with fixed. More...
 
int ksceNpDrmReadActData (SceNpDrmActivationData *act_data)
 Get current activation data. More...
 
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. More...
 
int ksceNpDrmGetRifVitaKey (const SceNpDrmLicense *license, void *klicense, int *flags, int *sku_flags, SceUInt64 *lic_start_time, SceUInt64 *lic_exp_time)
 Get license key info. More...
 
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. More...
 
int ksceNpDrmGetRifInfo (const SceNpDrmLicense *license, SceSize license_size, int check_sign, char *content_id, SceUInt64 *account_id, int *license_version, int *license_flags, int *flags, int *sku_flags, SceInt64 *lic_start_time, SceInt64 *lic_exp_time, SceUInt64 *flags2)
 Get license info. More...
 
int ksceNpDrmEbootSigVerify (const char *eboot_pbp_path, const void *eboot_signature)
 Verify a eboot.pbp signature "__sce_ebootpbp". More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Function Documentation

◆ _sceNpDrmGetRifName()

int _sceNpDrmGetRifName ( char *  rif_name,
uint64_t  aid 
)

Get rif name.

Parameters
[out]rif_name- 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- 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  act_exp_time[2] 
)

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

Parameters
[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_exp_time- The pointer of activation expire time output, [0] is start_date, [1] is end_date
Returns
0 on success, < 0 on error.

◆ _sceNpDrmGetRifNameForInstall()

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

Get rif name for install.

Parameters
[out]rif_name- RIF name buffer (48 bytes)
[in]rif_data- Data of RIF file (512 bytes)
[in]unk- Unknown, use 0
Returns
0 on success, < 0 on error.

◆ scePsmDrmGetRifKey()

int scePsmDrmGetRifKey ( const ScePsmDrmLicense license_buf,
ScePsmDrmKeySet keydata,
int *  flags,
ScePsmDrmExpireTime exp_time 
)

Get PSM rif key.

Parameters
[in]license_buf- RIF buffer (1024 bytes)
[out]keydata- Decrypted keyset
[out]flags- License flags
[out]exp_time- Expire times output
Returns
0 on success, < 0 on error

◆ ksceNpDrmGetRifName()

int ksceNpDrmGetRifName ( char *  name,
SceUInt64  aid 
)

Get license file name.

Parameters
[out]name- The pointer of license file name output buffer. size is 0x30.
[in]aid- The license account id
Returns
0 on success, < 0 on error.

◆ ksceNpDrmGetFixedRifName()

int ksceNpDrmGetFixedRifName ( char *  name,
SceUInt64  aid 
)

Get license file name with fixed.

Parameters
[out]name- The pointer of license file name output buffer. size is 0x30.
[in]aid- The license account id
Returns
0 on success, < 0 on error.

◆ ksceNpDrmReadActData()

int ksceNpDrmReadActData ( SceNpDrmActivationData act_data)

Get current activation data.

Parameters
[out]act_data- The pointer of output activation data see:SceNpDrmActivationData. if ecdsa or rsa verify fail, will be all 0.
Returns
0 on success, < 0 on error.

◆ ksceNpDrmCheckActData()

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.

Parameters
[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_exp_time- The pointer of activation data expire time output
Returns
0 on success, < 0 on error.

◆ ksceNpDrmGetRifVitaKey()

int ksceNpDrmGetRifVitaKey ( const SceNpDrmLicense license,
void *  klicense,
int *  flags,
int *  sku_flags,
SceUInt64 lic_start_time,
SceUInt64 lic_exp_time 
)

Get license key info.

Parameters
[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.
Returns
0 on success, < 0 on error.

◆ ksceNpDrmGetRifPspKey()

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.

Parameters
[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.
Returns
0 on success, < 0 on error.

◆ ksceNpDrmGetRifInfo()

int ksceNpDrmGetRifInfo ( const SceNpDrmLicense license,
SceSize  license_size,
int  check_sign,
char *  content_id,
SceUInt64 account_id,
int *  license_version,
int *  license_flags,
int *  flags,
int *  sku_flags,
SceInt64 lic_start_time,
SceInt64 lic_exp_time,
SceUInt64 flags2 
)

Get license info.

Parameters
[in]license- The pointer of license data. see:SceNpDrmLicense
[in]license_size- The license data size. 0x200 etc
[in]check_sign- The license signature check flag. if pass 1, do check.
[out]content_id- The pointer of license content_id output buffer. size is 0x30.
[out]account_id- The pointer of license account_id output.
[out]license_version- The pointer of license version output.
[out]license_flags- The pointer of license flags output.
[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.
[out]flags2- The pointer of flags2 output.
Returns
0 on success, < 0 on error.

◆ ksceNpDrmEbootSigVerify()

int ksceNpDrmEbootSigVerify ( const char *  eboot_pbp_path,
const void *  eboot_signature 
)

Verify a eboot.pbp signature "__sce_ebootpbp".

Parameters
[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
Returns
0 on success, < 0 on error.

◆ ksceNpDrmPspEbootVerify()

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.

Parameters
[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
Returns
0 on success, < 0 on error.

◆ ksceNpDrmPspEbootSigGen()

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.

Parameters
[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
Returns
eboot_signature size on success, < 0 on error.

◆ ksceNpDrmEbootSigConvert()

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.

Parameters
[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
Returns
eboot_signature size on success, < 0 on error.

◆ ksceNpDrmEbootSigGenPsp()

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.

Parameters
[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
Returns
eboot_signature size on success, < 0 on error.

◆ ksceNpDrmEbootSigGenPs1()

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.

Parameters
[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
Returns
eboot_signature size on success, < 0 on error.

◆ ksceNpDrmEbootSigGenMultiDisc()

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.

Parameters
[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
Returns
eboot_signature size on success, < 0 on error.