Bluray disc: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 33: Line 33:
* with the IV 0x69474772af6fdab342743aefaa186287
* with the IV 0x69474772af6fdab342743aefaa186287
* no padding
* no padding
data1 is available in IRD files. It can be found on the disc with some SCSI commands.


=== Sector encryption ===
=== Sector encryption ===

Revision as of 22:12, 26 January 2018

Overview

  • UDF filesystem (a profile of ECMA-167) in cleartext
  • file entries are not encrypted, some files are not encrypted
  • some regions of the disc are encrypted (sector by sector)
  • One sector is 2048 bytes

Encryption

The first sector of the disc tells which parts of the disc are unencrypted and which one are encoded.

For exemple, this is the beginning of "The Last of Us" disc:

00000000: 0000 0003 0000 0000 0000 0000 0000 099f  ................
00000010: 00a2 6160 00ba 73ff 011d dda0 011f ddbf  ..a`..s.........
00000020: 0000 0000 0000 0000 0000 0000 0000 0000  ................
  • 0x00000003 is the number of unencrypted regions
  • The first unencrypted region is from sector 0x00000000 to sector 0x0000099f
  • The first encrypted region is from sector 0x0000099f to sector 0x00a26160
  • The second unencrypted region is from sector 0x00a26160 to sector 0x00ba73ff
  • The second encrypted region is from sector 0x00ba73ff to sector 0x011ddda0
  • The third unencrypted region is from sector 0x011ddda0 to sector 0x011fddbf
  • 0x011fddbf sectors is 38636746752 bytes whereas the file is 38636748800 bytes : the last sector is not included for some reason.

Deriving the disc key

The disc key is obtained by encrypting "data1" with AES CBC:

  • with the secret 0x380bcf0b53455b3c7817ab4fa3ba90ed
  • with the IV 0x69474772af6fdab342743aefaa186287
  • no padding

data1 is available in IRD files. It can be found on the disc with some SCSI commands.

Sector encryption

Each sector is encrypted with AES CBC:

  • using the disc key
  • no padding

The IV is derived from the sector number with:

int num = sectorNumber;
byte[] array = new byte[16];
for (int j = 0; j < 16; j++)
{
	array[16 - j - 1] = (byte)(num & 0xFF);
	num >>= 8;
}

File system layout

  • PS3_DISC.SFB
  • PS3_GAME/ICON0.PNG
  • PS3_GAME/LICDIR/LIC.DAT
  • PS3_GAME/PARAM.SFO
  • PS3_GAME/PIC1.PNG
  • PS3_GAME/PS3LOGO.DAT
  • PS3_GAME/SND0.AT3
  • PS3_GAME/TROPDIR/
  • PS3_GAME/USRDIR/build/
  • PS3_GAME/USRDIR/data/
  • PS3_GAME/USRDIR/EBOOT.BIN
  • PS3_UPDATE/PS3UPDAT.PUP

References

  • 3k3y iIsoTools, this is a .NET program available in binary form. The ILspy decompiler produces a very treadable output.
  • PS3 ISO Patcher by BlackDaemon, is a .NET program available in source code