Bluray disc: Difference between revisions

From PS3 Developer wiki
Jump to navigation Jump to search
mNo edit summary
Line 2: Line 2:


* [http://www.osta.org/specs/pdf/udf260.pdf UDF] filesystem (a profile of [http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-167.pdf ECMA-167]) in cleartext
* [http://www.osta.org/specs/pdf/udf260.pdf UDF] filesystem (a profile of [http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-167.pdf ECMA-167]) in cleartext
* file entries are not encrypted, some files are not encrypted
* File entries are not encrypted, some files are not encrypted
* some regions of the disc are encrypted (sector by sector)
* Some regions of the disc are encrypted (sector by sector)
* One sector is 2048 bytes
* One sector is 2048 bytes


Line 10: Line 10:
The first sector of the disc tells which parts of the disc are unencrypted and which one are encoded.
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:
For example, this is the beginning of "The Last of Us" disc:


<pre>
<pre>
Line 74: Line 74:
== References ==
== References ==


* 3k3y iIsoTools, this is a .NET program available in binary form. The [https://github.com/icsharpcode/ILSpy ILspy] decompiler produces a very treadable output.
* 3k3y IsoTools, this is a .NET program available in binary form. The [https://github.com/icsharpcode/ILSpy ILspy] decompiler produces a very readable output.
* PS3 ISO Patcher by BlackDaemon, is a .NET program available in source code
* PS3 ISO Patcher by BlackDaemon, is a .NET program available in source code

Revision as of 18:04, 29 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 example, 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 the IRD file
  • it can be found on the disc with a bunch of 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[] iv = new byte[16];
for (int j = 0; j < 16; j++)
{
	iv[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
PS3 Disc Game Structure
Disc Path XMB
icon
SFB/SFO/SFX Mandatory Parameters Since Enabled by
APP_VER ATTRIBUTE BOOTABLE CATEGORY TITLE TITLE_ID
dev_bdvd/ PS3_DISC.SFB Yes 1.00 Enables others with HYBRID_FLAG
PS3_GAME/ PARAM.SFO PS3 Blu-ray Disc Opt Opt Opt Game DG Yes Yes 1.00 HYBRID_FLAG (g) in PS3_DISC.FSB
USRDIR/ EBOOT.BIN 1.00 BOOTABLE (1) in parent PARAM.SFO
INSDIR/ PARAM.SFO No? Yes No No Game AR No No ? HYBRID_FLAG (g) in PS3_DISC.FSB ?
DATA000.PKG (up to 999) ?
PKGDIR/ PARAM.SFO PS3 Blu-ray Disc (installable contents) No Yes No Game DP Yes Yes 1.00 ? ATTRIBUTE (131072) in parent PARAM.SFO
PKG01/
(up to 99)
PARAM.SFO Preinstall Package No No No Game IP Yes Yes 1.00 ? ATTRIBUTE (1) in parent PARAM.SFO
INSTALL.PKG 1.00 ?
LICDIR/ LIC.DAT 1.00
TROPDIR/ <NPCOMMID>/ TROPHY.TRP 2.40
PS3_GM01/
(up to 99?)
PARAM.SFO PS3 Blu-ray Disc Opt Opt Opt Game DG Yes Yes 4.00+ ? HYBRID_FLAG (g) in PS3_DISC.FSB
USRDIR/ EBOOT.BIN 4.00+ ? BOOTABLE (1) in parent PARAM.SFO
LICDIR/ LIC.DAT 4.00+ ? dev_bdvd/PS3_GAME/LICDIR/LIC.DAT
PS3_CONTENT/ THEMEDIR/ PARAM.SFO PS3 Blu-ray Disc (installable contents) No Yes No Game TR Yes No ? 2.00+ HYBRID_FLAG (T) in PS3_DISC.FSB
D001/ DATA001.P3T
(up to 999)
Preinstall Package 2.00+ ATTRIBUTE (1) in parent PARAM.SFO
VIDEODIR/ PARAM.SFO PS3 Blu-ray Disc (video contents) No Yes No Video VR Yes No ? ? HYBRID_FLAG (V) in PS3_DISC.FSB
D001/
(up to 999)
PARAM.SFO ? No No No Video VI Yes No ? ATTRIBUTE (1) in parent PARAM.SFO
DATA000.MP4 ?
PS3_EXTRA/ PARAM.SFO PS3 Blu-ray Disc No Yes No Game XR Yes Yes 3.41- HYBRID_FLAG (g) in PS3_DISC.FSB ?
D001/
(up to 999)
PARAM.SFX Package Content No No No Game IP Yes No 3.41- ATTRIBUTE (1) in parent PARAM.SFO
DATA000.PKG 3.41-
D002/
(up to 999)
PARAM.SFX Theme Content No No No Game TI Yes No 3.41- ATTRIBUTE (1) in parent PARAM.SFO
DATA000.P3T 3.41-
D003/
(up to 999)
PARAM.SFX Video Content No No No Game VI Yes No 3.41- ATTRIBUTE (1) in parent PARAM.SFO
DATA000.MP4 3.41-
PS3_VPRM/ PARAM.SFO PS3 Blu-ray Disc (video contents) No No No Video DM No No ? HYBRID_FLAG (v) in PS3_DISC.FSB
PS3_UPDATE/ PS3UPDAT.PUP 1.00 ? HYBRID_FLAG (u) in PS3_DISC.FSB

See also Content Information Files

References

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