Editing Content License

Jump to navigation Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
The PS4 content license files are like on PSP, PS3 and PSVita the .rif files.
The PS4 content license files are like on PSP, PS3 and PS4 the .rif files.<br />
 
But for the first time, the format has been a lot changed:
But for the first time, the format has been changed a lot:
* There is only 1 .rif file (and .idx) per game/app. On PSP, PS3 and PSVita, there were 1 .rif per content (1 for the game + 1 for each DLC)
* There is only one .rif file (and .idx) per game/app. On PSP, PS3 and PSVita, there were 1 .rif per content (1 for the game + 1 for each DLC)
* This is handled by adding each DLC license to the game .rif. To know where the license is in the .rif, PS4 generates a .idx file (RIF index).
* This is handled by adding each DLC license to the game .rif. To know where the license is in the .rif, PS4 generates a .idx file (RIF index).
* When the .rif is downloaded from PSN by SceShellcore, it is added to the current .rif file of the game (if existing).<br />Then the .idx is generated. ShellCore calls npdrm_ioctl to get a 0x10 bytes HMAC-SHA256 per console key from SAMU.<br />The HMAC is computed over the RIF data and is written to the .idx entry.<br />The aim is both to ensure .rif integrity and to make sure the .rif and .idx can't be copied to another PS4 console.
* When the .rif is downloaded from PSN by SceShellcore, it is added to the current .rif file of the game (if existing).<br />Then the .idx is generated. ShellCore calls npdrm_ioctl to get a 0x10 bytes HMAC-SHA256 per console key from SAMU.<br />The HMAC is computed over the RIF data and is written to the .idx entry.<br />The aim is both to ensure .rif integrity and to make sure the .rif and .idx can't be copied to another PS4 console.
Line 18: Line 17:


The .rif file embeds one or more [[RIF Entry|RIF entry]].
The .rif file embeds one or more [[RIF Entry|RIF entry]].
[[Rif/samples|Sample disc rif files]].


=== RIF Entry ===
=== RIF Entry ===
Line 36: Line 33:
| Version || <code>0x004</code> || 2 || <code>00 01</code>, <code>00 02</code> || See [[#RIF Type|RIF Type]]
| Version || <code>0x004</code> || 2 || <code>00 01</code>, <code>00 02</code> || See [[#RIF Type|RIF Type]]
|-
|-
| ?DRM Type? || <code>0x006</code> || 2 || <code>00 02</code> for KDS, <code>FF FF</code> for disc ||
| Unknown || <code>0x006</code> || 2 || <code>00 02</code>, <code>FF FF</code> || ?Finalized flag? ?DRM Type?
|-
|-
| PSN Account ID || <code>0x008</code> || 8 || <code>AB CD EF 01 02 34 78 91</code> || zeroed if not KDS RIF
| PSN Account ID || <code>0x008</code> || 8 || <code>AB CD EF 01 02 34 78 91</code> || zeroed if not KDS RIF
Line 173: Line 170:
| Unknown || <code>0x00</code> || 0x10 || - ||  
| Unknown || <code>0x00</code> || 0x10 || - ||  
|-
|-
| Zeroes? || <code>0x10</code> || 0x10 || - ||  
| Unknown || <code>0x10</code> || 0x10 || - ||  
|-
|-
| Zeroes? || <code>0x20</code> || 0x10 || - ||  
| Unknown || <code>0x20</code> || 0x10 || - ||  
|-
|-
| Content Key Seed || <code>0x30</code> || 0x10 || - || Used to generate PFS key
| Content Key Seed || <code>0x30</code> || 0x10 || - || Used to generate PFS key
Line 185: Line 182:
| Unknown || <code>0x60</code> || 0x10 || - ||  
| Unknown || <code>0x60</code> || 0x10 || - ||  
|-
|-
| Entitlement Key || <code>0x70</code> || 0x10 || - || Usually zeroes
| Entitlement Key || <code>0x70</code> || 0x10 || - ||  
|-
|-
| Zeroes? || <code>0x80</code> || 0x10 || - ||  
| Unknown || <code>0x80</code> || 0x10 || - ||  
|}
|}


Line 194: Line 191:
This RIF form is paired with a .idx file.
This RIF form is paired with a .idx file.


When in this form, contrarly to [[#RIF File|RIF files]] a [[#RIFA Header|RIFA header]] is present, followed by sequential [[#RIF Entry|RIF entries]].
When in this form, contrarly to [[RIF File|RIF files]] a [[#RIFA Header|RIFA header]] is present, followed by sequential [[#RIF Entry|RIF entries]].


See also [[#RIF IDX|IDX structure]] for the paired .idx file.
See also [[#RIF IDX|IDX structure]] for the paired .idx file.
Please note that all contributions to PS4 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS4 Developer wiki:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following hCaptcha:

Cancel Editing help (opens in new window)