Rights Information Files: Difference between revisions

From PS4 Developer wiki
Jump to navigation Jump to search
m (Replaced content with "== rif == location: [PS4VOLUME]/license/rif examples: Rif/samples {{File Formats}} <noinclude>Category:Main</noinclude>")
(Format information)
Line 1: Line 1:
== rif ==
Can be found in:
location: [PS4VOLUME]/license/rif
* <code>/user/license/*.rif</code>, <code>/user/license/*.idx</code>
* <code>/user/home/*/license/*.rif</code>, <code>/user/home/*/license/*.idx</code>
* <code>/mnt/disc/license/rif</code>


examples: [[Rif/samples]]
[[Rif/samples|Sample rif files]].


== RIF File ==


For a rif file that is paired with a idx file, see [[#RIFA File|RIFA file]].
=== RIF ===
Fields are big-endian.
{| class="wikitable sortable"
! style="width: 25%" | Name
! style="width: 5%" | Offset
! style="width: 5%" | Size
! style="width: 25%" | Example
! style="width: 40%" | Remark
|-
| Signature || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||
|-
| Version || <code>0x004</code> || 2 || <code>00 01</code> || 1 (current)
|-
| Unknown || <code>0x006</code> || 2 || <code>FF FF</code> ||
|-
| 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)
|-
| End Timestamp || <code>0x018</code> || 8 || <code>7F FF FF FF FF FF FF FF</code> || End timestamp (unix/epoch), typically INT64_MAX
|-
| Content ID || <code>0x020</code> || 48 || <code>IP9100-CUSA00001_00-PLAYROOM00000000</code> ||
|-
| Type || <code>0x050</code> || 2 || <code>01 01</code> ||
* <code>0x000</code> KDS RIF
* <code>0x101,0x302</code> Isolated RIF
* <code>0x102</code> Disc RIF
* <code>0x200-0x202</code> Fake/Debug RIF
|-
| Unknown || <code>0x052</code> || 2 || <code>00 0F</code> ||
|-
| Unknown || <code>0x054</code> || 2 || <code>00 1A</code> ||
|-
| SKU Flags || <code>0x056</code> || 2 || <code>00 01</code> ||
|-
| Extra Flags || <code>0x058</code> || 4 || <code>00 00 00 00</code> ||
|-
| Unknown || <code>0x060</code> || 4 || <code>00 02 00 00</code> ||
|-
| Unknown || <code>0x064</code> || 476 || - ||
|-
| Disc Key || <code>0x240</code> || 32 || - ||
|-
| Secret Encryption IV || <code>0x260</code> || 16 || - ||
|-
| Encrypted Secret || <code>0x270</code> || 144 || - || See [[#Secret|Secret]] for when decrypted
|-
| RSA Signature || <code>0x300</code> || 256 || - || Verified using public key depending on type
|}
=== Secret ===
{| class="wikitable sortable"
! style="width: 25%" | Name
! style="width: 5%" | Offset
! style="width: 5%" | Size
! style="width: 25%" | Example
! style="width: 40%" | Remark
|-
| Unknown || <code>0x00</code> || 16 || - ||
|-
| Unknown || <code>0x10</code> || 16 || - ||
|-
| Unknown || <code>0x20</code> || 16 || - ||
|-
| Content Key Seed || <code>0x30</code> || 16 || - || Used to generate PFS key
|-
| SELF Key Seed || <code>0x40</code> || 16 || - || Used to generate SELF key
|-
| Unknown || <code>0x50</code> || 16 || - ||
|-
| Unknown || <code>0x60</code> || 16 || - ||
|-
| Entitlement Key || <code>0x70</code> || 16 || - ||
|-
| Unknown || <code>0x80</code> || 16 || - ||
|}
== RIFA 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]].
=== RIFA Header ===
Fields are big-endian.
{| class="wikitable sortable"
! style="width: 25%" | Name
! style="width: 5%" | Offset
! style="width: 5%" | Size
! style="width: 25%" | Example
! style="width: 40%" | Remark
|-
| Signature || <code>0x000</code> || 4 || <code>52 49 46 00</code> ('RIF\0') ||
|-
| Title ID || <code>0x004</code> || 48 || <code>IP9100-CUSA00001_00</code> || ''Size assumed''
|-
| Unknown || <code>0x034</code> || 972 || - ||
|}
== RIDX File ==
=== RIDX Header ===
Fields are little-endian.
{| class="wikitable sortable"
! style="width: 25%" | Name
! style="width: 5%" | Offset
! style="width: 5%" | Size
! style="width: 25%" | Example
! style="width: 40%" | Remark
|-
| Signature || <code>0x00</code> || 4 || <code>78 64 69 72</code> ('xdir') ||
|-
| RIF Count || <code>0x04</code> || 4 || <code>01 00 00 00</code> ||
|-
| Version || <code>0x08</code> || 1 || <code>01</code> || 1 (current)
|-
| Title ID || <code>0x09</code> || 19 || <code>IP9100-CUSA00001_00</code> ||
|-
| Unknown || <code>0x1C</code> || 4 || <code>01 00 00 00</code> ||
|-
| Entries || <code>0x20</code> || 48 * RIF Count || See [[#RIDX Entry|RIDX entry]]
|}
=== RIDX Entry ===
Fields are little-endian.
{| class="wikitable sortable"
! style="width: 25%" | Name
! style="width: 5%" | Offset
! style="width: 5%" | Size
! style="width: 25%" | Example
! style="width: 40%" | Remark
|-
| Entitlement ID || <code>0x00</code> || 16 || <code>PLAYROOM00000000</code> ||
|-
| Offset || <code>0x10</code> || 8 || <code>00 04 00 00 00 00 00 00</code> || Offset into [[#RIFA File|RIFA file]]
|-
| Size || <code>0x18</code> || 8 || <code>00 04 00 00 00 00 00 00</code> ||
|-
| Unknown || <code>0x20</code> || 1 || <code>01</code> ||
|-
| Unknown || <code>0x21</code> || 15 || - ||
|}


{{File Formats}}
{{File Formats}}
<noinclude>[[Category:Main]]</noinclude>
<noinclude>[[Category:Main]]</noinclude>

Revision as of 21:44, 11 December 2017

Can be found in:

  • /user/license/*.rif, /user/license/*.idx
  • /user/home/*/license/*.rif, /user/home/*/license/*.idx
  • /mnt/disc/license/rif

Sample rif files.

RIF File

For a rif file that is paired with a idx file, see RIFA file.

RIF

Fields are big-endian.

Name Offset Size Example Remark
Signature 0x000 4 52 49 46 00 ('RIF\0')
Version 0x004 2 00 01 1 (current)
Unknown 0x006 2 FF FF
PSN Account ID 0x008 8 AB CD EF 01 02 34 78 91 0 if not KDS RIF
Start Timestamp 0x010 8 00 00 00 00 52 85 64 00 Start timestamp (unix/epoch)
End Timestamp 0x018 8 7F FF FF FF FF FF FF FF End timestamp (unix/epoch), typically INT64_MAX
Content ID 0x020 48 IP9100-CUSA00001_00-PLAYROOM00000000
Type 0x050 2 01 01
  • 0x000 KDS RIF
  • 0x101,0x302 Isolated RIF
  • 0x102 Disc RIF
  • 0x200-0x202 Fake/Debug RIF
Unknown 0x052 2 00 0F
Unknown 0x054 2 00 1A
SKU Flags 0x056 2 00 01
Extra Flags 0x058 4 00 00 00 00
Unknown 0x060 4 00 02 00 00
Unknown 0x064 476 -
Disc Key 0x240 32 -
Secret Encryption IV 0x260 16 -
Encrypted Secret 0x270 144 - See Secret for when decrypted
RSA Signature 0x300 256 - Verified using public key depending on type

Secret

Name Offset Size Example Remark
Unknown 0x00 16 -
Unknown 0x10 16 -
Unknown 0x20 16 -
Content Key Seed 0x30 16 - Used to generate PFS key
SELF Key Seed 0x40 16 - Used to generate SELF key
Unknown 0x50 16 -
Unknown 0x60 16 -
Entitlement Key 0x70 16 -
Unknown 0x80 16 -

RIFA File

See also RIDX structure for the paired idx file.

When in this form, a RIFA header is present, followed by sequential rifs.

RIFA Header

Fields are big-endian.

Name Offset Size Example Remark
Signature 0x000 4 52 49 46 00 ('RIF\0')
Title ID 0x004 48 IP9100-CUSA00001_00 Size assumed
Unknown 0x034 972 -

RIDX File

RIDX Header

Fields are little-endian.

Name Offset Size Example Remark
Signature 0x00 4 78 64 69 72 ('xdir')
RIF Count 0x04 4 01 00 00 00
Version 0x08 1 01 1 (current)
Title ID 0x09 19 IP9100-CUSA00001_00
Unknown 0x1C 4 01 00 00 00
Entries 0x20 48 * RIF Count See RIDX entry

RIDX Entry

Fields are little-endian.

Name Offset Size Example Remark
Entitlement ID 0x00 16 PLAYROOM00000000
Offset 0x10 8 00 04 00 00 00 00 00 00 Offset into RIFA file
Size 0x18 8 00 04 00 00 00 00 00 00
Unknown 0x20 1 01
Unknown 0x21 15 -