Skip to content

Commit

Permalink
add scePsmDrmGetRifKey and psm license struct (vitasdk#660)
Browse files Browse the repository at this point in the history
* add scePsmDrmGetRifKey and psm license struct

Maybe should goto a separate psmdrm.h, not sure.

* fix return

* make match what princess of sleeping and KuromeSan said

* Update npdrm.h

* correct npdrm.h
  • Loading branch information
EliCrystal2001 authored Dec 31, 2021
1 parent 0b2627f commit c332e5f
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions include/psp2/npdrm.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,24 @@ typedef struct SceNpDrmLicense { // size is 0x200
char rsa_signature[0x100];
} SceNpDrmLicense;

typedef struct ScePsmDrmLicense {
char magic[0x8];
SceUInt32 unk1;
SceUInt32 unk2;
SceUInt64 account_id;
SceUInt32 unk3;
SceUInt32 unk4;
SceUInt64 start_time;
SceUInt64 expiration_time;
SceUInt8 activation_checksum[0x20];
char content_id[0x30];
SceUInt8 unk5[0x80];
SceUInt8 unk6[0x20];
SceUInt8 key[0x10];
SceUInt8 signature[0x1D0];
SceUInt8 rsa_signature[0x100];
} ScePsmDrmLicense;

/**
* Get rif name
*
Expand Down Expand Up @@ -72,6 +90,19 @@ int _sceNpDrmGetFixedRifName(char *rif_name, uint64_t aid);
*/
int _sceNpDrmGetRifNameForInstall(char *rif_name, const void *rif_data, int unk);

/**
* Get PSM rif key
*
* @param[in] license_buf - RIF buffer (1024 bytes)
*
* @param[out] keydata - Decrypted key data
*
* @param[in] flags - Unknown
*
* @return 0 on success, < 0 on error
*/
int scePsmDrmGetRifKey(const ScePsmDrmLicense *license_buf, char *keydata, int flags);

#ifdef __cplusplus
}
#endif
Expand Down

0 comments on commit c332e5f

Please sign in to comment.