Editing Bluray disc

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:
== Overview ==
== Overview ==


Generalities about disc images:
* [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
* disc images are made of sectors
* Some regions of the disc are encrypted (sector by sector)
* a sector is 2048 bytes
* One sector is 2048 bytes
* sector 0 is made of bytes 0 to 2047, etc.
* The first sector describes which part of the disc is encrypted (see below)
 
* The second sector has information about the disc
Encryption:
 
* some regions of the disc are encrypted, some regions of the disc are not encrypted
* the encryption is done at the disc (block-device) layer not at the level of the individual file
* each sector of the encrypted regions is encrypted independently
* Sector 0 describes which regions of the disc are encrypted (see below).
* Sector 1 has information about the disc.
 
File system:
 
* [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])
* the structure of the UDF filesystem is in not encrypted
* some files are encrypted (their data fall in the encrypted regions of the disc)
* some files are not encrypted (their data fall in the non-encrypted regions of the disc)
* as a consequence if the disc is mounted directly, the filesystem file structure is readable and some files are readable but some other files content appears as garbage.


== Disc Info ==
== Disc Info ==
Line 66: Line 51:
...
...
</pre>
</pre>
* The first 16 bytes identify a PS3 disc.
* The next 32 bytes are the disc ID (with space padding)
* 0x840: ?


== Encryption ==
== Encryption ==
Line 83: Line 64:
</pre>
</pre>


* 0x00000003: number of unencrypted regions
* 0x00000003 is the number of unencrypted regions
* Sectors 0x00000000 to 0x0000099f: first unencrypted region
* The first unencrypted region is from sector 0x00000000 to sector 0x0000099f
* Sectors 0x0000099f to 0x00a26160The: first encrypted region
* The first encrypted region is from sector 0x0000099f to sector 0x00a26160
* Sectors 0x00a26160 to 0x00ba73ff: second unencrypted region
* The second unencrypted region is from sector 0x00a26160 to sector 0x00ba73ff
* Sectors 0x00ba73ff to 0x011ddda0: second encrypted region
* The second encrypted region is from sector 0x00ba73ff to sector 0x011ddda0  
* Sectors 0x011ddda0 to 0x011fddbf: third unencrypted region
* 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.
Note:
 
* 0x011fddbf sectors is 38636746752 bytes whereas the file is 38636748800 bytes;
* the last sector is not included for some reason.


=== Deriving the disc key ===
=== Deriving the disc key ===
Line 102: Line 79:
* with the IV 0x69474772af6fdab342743aefaa186287
* with the IV 0x69474772af6fdab342743aefaa186287
* no padding
* no padding
 
* data1 is available in the IRD file
Where can I get data1?
* it can be found on the disc with a bunch of SCSI commands.
 
* it can be found on the disc with a bunch of SCSI commands (assuming you have a suitable BD drive)
* for the rest of us, it is available in the IRD file


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


Each disc sector is encrypted (independently from the other sectors) with AES CBC:
Each sector is encrypted with AES CBC:


* using the disc key
* using the disc key
Line 247: Line 221:
== IRD file ==
== IRD file ==


3k3y generates [http://jonnysp.bplaced.net/ IRD files] which contains some information about the disc. In particular, it contains "data1" which is used to derive the disc AES encryption key. It contains the PIC zone as well (which is outside of the normal area of the disc and thus not present in ISOs) but it's not clear how useful that is.
3k3y generates [http://jonnysp.bplaced.net/ IRD files] which contains some information about the disc. In particular, it contains "data1" which is used to derived the disc AES encryption key.


The file is:
The file is:
Line 258: Line 232:
* Integer are in little endian format:
* Integer are in little endian format:
* Variable length strings use a [https://msdn.microsoft.com/fr-fr/library/system.io.binaryreader.readstring(v=vs.110).aspx compressed length prefix].
* Variable length strings use a [https://msdn.microsoft.com/fr-fr/library/system.io.binaryreader.readstring(v=vs.110).aspx compressed length prefix].
Compressed data are compressed with gzipped and prefixed with a length (uint32).


The format is (v6 to v9):
The format is (v6 to v9):
Line 267: Line 243:
!Example
!Example
!Versions
!Versions
!Notes
|-
|-
|4B
|4B
Line 273: Line 248:
|Magic string ("3IRD")
|Magic string ("3IRD")
|3IRD
|3IRD
|
|
|
|-
|-
Line 280: Line 254:
|Version
|Version
|6, 7, 8, 9
|6, 7, 8, 9
|
|
|
|-
|-
|9B
|9B
|string
|string
|Title ID
|Game ID
|BCES01584
|BCES01584
|
|
| The same value stored in [[PARAM.SFO#TITLE_ID|PARAM.SFO / TITLE_ID]]
|-
|-
|var
|var
|string
|string
|Title
|Game name
|The Last Of Us
|The Last Of Us
|
|
| The same value stored in [[PARAM.SFO#TITLE|PARAM.SFO / TITLE]]
|-
|-
|4B
|4B
|string
|string
| PS3 system version
|Update version
|4.41
|4.41
|
|
| The same value stored in [[PARAM.SFO#PS3_SYSTEM_VER|PARAM.SFO / PS3_SYSTEM_VER]]
|-
|-
|5B
|5B
|string
|string
| Version
|Game version
|4.41
|4.41
|
|
| The same value stored in [[PARAM.SFO#VERSION|PARAM.SFO / VERSION]]
|-
|-
|5B
|5B
|string
|string
| App version
|App version
|01.00
|01.00
|
|
| The same value stored in [[PARAM.SFO#APP_VER|PARAM.SFO / APP_VER]]
|-
|-
|4B
|4B
Line 323: Line 291:
|
|
|v=7
|v=7
|
|-
|-
|var
|var
|compressed
|compressed
|Header
|Header
|
|
|
|
|
Line 335: Line 301:
|compressed
|compressed
|Footer
|Footer
|
|
|
|
|
Line 342: Line 307:
|uint
|uint
|Region count
|Region count
|
|
|
|
|
Line 357: Line 321:
|…
|…
|…
|…
|
|-
|-
|4B
|4B
|uint
|uint
|File count
|File count
|
|
|
|
|
Line 371: Line 333:
|
|
|
|
| The offset/sector of the file's whose hash is shown
|-
|-
|16B
|16B
Line 384: Line 345:
|…
|…
|…
|…
|
|-
|4B
|bytes
|Padding
|(00 00 00 00)
|
|-
|-
|115B
|115B
Line 397: Line 351:
|
|
|v=9
|v=9
|
|-
|-
|16B
|16B
|bytes
|bytes
|Data 1
|Data 1
|
|
|
|
|
Line 409: Line 361:
|bytes
|bytes
|Data 2
|Data 2
|
|
|
|
|
Line 418: Line 369:
|
|
|v<9
|v<9
|
|-
|-
|4B
|2B
|uint/bytes
|uint/bytes
|UID
|UID
|
|
|-
|4B
|uint
|CRC
|
|
|
|
|
|}
|}
Compressed data are compressed with gzip and prefixed with a length (uint32).


== References ==
== References ==
Line 440: Line 381:
* 3k3y IsoTools, this is a .NET program available in binary form. The [https://github.com/icsharpcode/ILSpy ILspy] decompiler produces a very readable 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
* See also [[ODE]] page


{{Reverse engineering}}<noinclude>[[Category:Main]]</noinclude>
{{Reverse engineering}}<noinclude>[[Category:Main]]</noinclude>
Please note that all contributions to PS3 Developer wiki are considered to be released under the GNU Free Documentation License 1.2 (see PS3 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)