Editing Rights Information Files

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:
* See also [https://www.psdevwiki.com/ps3/RIF PSP, PS3 and PS Vita RIF files].
Can be found in:
 
See also [[Rif/samples|Sample RIF files]].
 
== Location ==
 
The PS4 Rights Information Files and associated files can be found in:
* <code>/user/license/*.rif</code>, <code>/user/license/*.idx</code>
* <code>/user/license/*.rif</code>, <code>/user/license/*.idx</code>
* <code>/user/home/*/license/*.rif</code>, <code>/user/home/*/license/*.idx</code>
* <code>/user/home/*/license/*.rif</code>, <code>/user/home/*/license/*.idx</code>
Line 12: Line 6:
* <code>Sc0/license.dat</code> (in PKG entries)
* <code>Sc0/license.dat</code> (in PKG entries)


== RIF ==
[[Rif/samples|Sample rif files]].
 
== Rights Information Files ==


For a RIF file that is paired with an IDX file, see [[#RIFA File|RIFA file]].
For a rif file that is paired with an idx file, see [[#RIFA File|RIFA file]].


=== RIF Structure ===
=== RIF ===


Fields are big-endian.
Fields are big-endian.
Line 27: Line 23:
! style="width: 40%" | Remark
! style="width: 40%" | Remark
|-
|-
| Magic || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||  
| Signature || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||  
|-
|-
| Version || <code>0x004</code> || 2 || <code>00 01</code> || See [[#Type|Type]]
| Version || <code>0x004</code> || 2 || <code>00 01</code> || See [[#Type|Type]]
Line 33: Line 29:
| Unknown || <code>0x006</code> || 2 || <code>FF FF</code> ||  
| Unknown || <code>0x006</code> || 2 || <code>FF FF</code> ||  
|-
|-
| NP Account ID || <code>0x008</code> || 8 || <code>AB CD EF 01 02 34 78 91</code> || 0 if not KDS RIF
| PSN Account ID || <code>0x008</code> || 8 || <code>AB CD EF 01 02 34 78 91</code> || 0 if not KDS RIF
|-  
|-  
| Start Timestamp || <code>0x010</code> || 8 || <code>00 00 00 00 52 85 64 00</code> || Start timestamp (unix/epoch)
| Start Timestamp || <code>0x010</code> || 8 || <code>00 00 00 00 52 85 64 00</code> || Start timestamp (unix/epoch)
Line 43: Line 39:
| Type || <code>0x050</code> || 2 || <code>01 01</code> || See [[#Type|Type]]
| Type || <code>0x050</code> || 2 || <code>01 01</code> || See [[#Type|Type]]
|-
|-
| DRM Type || <code>0x052</code> || 2 || <code>00 0F</code> || Same as PKG DRM Type. PS5 Uses 00 10.
| DRM Type || <code>0x052</code> || 2 || <code>00 0F</code> || Same as PKG DRM Type, PS5 Uses 00 10
|-
|-
| Content Type || <code>0x054</code> || 2 || <code>00 1A</code> || Same as PKG Content Type. PS5 Uses 00 20.
| Content Type || <code>0x054</code> || 2 || <code>00 1A</code> || Same as PKG Content TypePS5 Uses 00 20
|-
|-
| SKU Flag || <code>0x056</code> || 2 || <code>00 01</code> || Not Bootable: 0, Trial: 1, Full Game: 3
| SKU Flag || <code>0x056</code> || 2 || <code>00 01</code> || Not Bootable 0 Trial 1 Full Game 3
|-
|-
| Extra Flags || <code>0x058</code> || 4 || <code>00 00 00 00</code> ||  
| Extra Flags || <code>0x058</code> || 4 || <code>00 00 00 00</code> ||  
Line 57: Line 53:
| Unknown || <code>0x068</code> || 3 || - ||
| Unknown || <code>0x068</code> || 3 || - ||
|-
|-
| Unknown || <code>0x06B</code> || 1 || - || 02 on old RIFs (3.55), 03 on new RIFs (5.00)
| Unknown || <code>0x06B</code> || 1 || - || 02 on old rifs (3.55), 03 on new rifs (5.00)
|-
|-
| Unknown || <code>0x06C</code> || 468 || - ||  
| Unknown || <code>0x06C</code> || 468 || - ||  
Line 65: Line 61:
| Secret Encryption IV || <code>0x260</code> || 16 || - || At least on debug/fake RIFs, this is the first 16 bytes of the SHA-256 hash of the Content ID (all 48 bytes including nulls)
| Secret Encryption IV || <code>0x260</code> || 16 || - || At least on debug/fake RIFs, this is the first 16 bytes of the SHA-256 hash of the Content ID (all 48 bytes including nulls)
|-
|-
| Encrypted Secret || <code>0x270</code> || 144 || - || See [[#Secret|Secret]] for when decrypted. On debug/fake RIFs, the decrypted secret is empty except the first 16 bytes, which are the second 16 bytes of the Content ID hash.
| Encrypted Secret || <code>0x270</code> || 144 || - || See [[#Secret|Secret]] for when decrypted. On debug/fake rifs, the decrypted secret is empty except the first 16 bytes, which are the second 16 bytes of the Content ID hash.
|-
|-
| Signature || <code>0x300</code> || 256 || - || RSA2048 signature. Verified using public key depending on type
| RSA Signature || <code>0x300</code> || 256 || - || Verified using public key depending on type
|}
|}


=== Type ===
==== Type ====


{| class="wikitable sortable"
{| class="wikitable sortable"
Line 156: Line 152:


=== Secret ===
=== Secret ===
* See also [https://psdevwiki.com/ps3/SELF_-_SPRX#Supplemental_Header_Table PS Vita shared secret on PS3 Dev Wiki] contained in some PS Vita SELF headers.
On debug/fake RIFs, the decrypted secret is empty except the first 16 bytes, which are the second 16 bytes of the Content ID hash.


{| class="wikitable sortable"
{| class="wikitable sortable"
Line 168: Line 160:
! style="width: 40%" | Remark
! style="width: 40%" | Remark
|-
|-
| Content ID Hash || <code>0x00</code> || 16 || - || On debug/fake RIFs, this is the second 16 bytes of the Content ID hash.
| Unknown || <code>0x00</code> || 16 || - || Random 16 bytes of unknown purpose
|-
|-
| Padding || <code>0x10</code> || 32 || - || Zero byte padding (32 bytes)
| Padding || <code>0x10</code> || 32 || - || Zero byte padding (32 bytes)
Line 187: Line 179:
== RIFA File ==
== RIFA File ==


See also [[#RIDX Structure|RIDX structure]] for the paired IDX file.
See also [[#RIDX Structure|RIDX structure]] for the paired idx file.


When in this form, a [[#RIFA Header|RIFA header is present]], followed by sequential [[#RIF|RIFs]].
When in this form, a [[#RIFA Header|RIFA header is present]], followed by sequential [[#RIF|rifs]].


=== RIFA Structure ===
=== RIFA Header ===


Fields are big-endian.
Fields are big-endian.
Line 202: Line 194:
! style="width: 40%" | Remark
! style="width: 40%" | Remark
|-
|-
| Magic || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||  
| Signature || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||  
|-
|-
| [[Service ID]] || <code>0x004</code> || 48 || <code>IP9100-CUSA00001_00</code> || ''Size assumed''
| [[Service ID]] || <code>0x004</code> || 48 || <code>IP9100-CUSA00001_00</code> || ''Size assumed''
Line 211: Line 203:
== RIDX File ==
== RIDX File ==


=== RIDX Structure ===
=== RIDX Header ===


Fields are little-endian.
Fields are little-endian.
Line 222: Line 214:
! style="width: 40%" | Remark
! style="width: 40%" | Remark
|-
|-
| Magic || <code>0x00</code> || 4 || <code>78 64 69 72</code> ('xdir', meaning RIF index) ||  
| Signature || <code>0x00</code> || 4 || <code>78 64 69 72</code> ('xdir') ||  
|-
|-
| Entries Count || <code>0x04</code> || 4 || code>01 00 00 00</code>, <code>03 00 00 00</code> ||  
| RIF Count || <code>0x04</code> || 4 || <code>01 00 00 00</code> ||  
|-
|-
| Version || <code>0x08</code> || 1 || <code>01</code> || 1 (current)
| Version || <code>0x08</code> || 1 || <code>01</code> || 1 (current)
Line 230: Line 222:
| [[Service ID]] || <code>0x09</code> || 19 || <code>IP9100-CUSA00001_00</code> ||  
| [[Service ID]] || <code>0x09</code> || 19 || <code>IP9100-CUSA00001_00</code> ||  
|-
|-
| Unknown || <code>0x1C</code> || 4 || code>01 00 00 00</code>, <code>00 00 00 00</code> ||
| Unknown || <code>0x1C</code> || 4 || <code>01 00 00 00</code> ||
|-
|-
| Entries || <code>0x20</code> || 48 * Entries_Count || - || See [[#RIDX Entry|RIDX entry]]
| Entries || <code>0x20</code> || 48 * RIF Count || - || See [[#RIDX Entry|RIDX entry]]
|}
|}


Line 246: Line 238:
! style="width: 40%" | Remark
! style="width: 40%" | Remark
|-
|-
| [[Entitlement Label]] || <code>0x00</code> || 16 || <code>PLAYROOM00000000</code> ||  
| [[Entitlement label]] || <code>0x00</code> || 16 || <code>PLAYROOM00000000</code> ||  
|-
|-
| RIF Offset || <code>0x10</code> || 8 || <code>00 04 00 00 00 00 00 00</code> || Offset into [[#RIFA File|RIFA file]]
| RIF Offset || <code>0x10</code> || 8 || <code>00 04 00 00 00 00 00 00</code> || Offset into [[#RIFA File|RIFA file]]
Line 256: Line 248:
| Unknown || <code>0x21</code> || 1 || <code>00</code> ||
| Unknown || <code>0x21</code> || 1 || <code>00</code> ||
|-
|-
| RIF Digest || <code>0x22</code> || 8 || - || First 8 bytes of HMACSHA256 of RIF data using per-console data as key
| RIF HMAC || <code>0x22</code> || 8 || - || First 8 bytes of HMACSHA256 of RIF data using per-console data as key
|-
|-
| Unknown || <code>0x2A</code> || 6 || - ||  
| Unknown || <code>0x2A</code> || 6 || - ||  
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)