LIC.DAT: Difference between revisions
m (→Structure) |
|||
(18 intermediate revisions by 5 users not shown) | |||
Line 1: | Line 1: | ||
= Description = | == Description == | ||
*Checked within Level 2 Kernel and possible via lv2syscall476 | |||
*File size is always 0x10000 Bytes. | |||
*Paths | *Paths | ||
**dev_bdvd/'''PS3_GAME'''/LICDIR/'''LIC.DAT''' | **dev_bdvd/'''PS3_GAME'''/LICDIR/'''LIC.DAT''' | ||
Line 7: | Line 8: | ||
**etc... | **etc... | ||
== Example == | |||
{{Boxcode|float=left|width=auto|height=auto|title=Example: Dead or Alive 5|code= | |||
00000000 50 53 33 4C 49 43 44 41 00 00 00 01 80 00 00 00 PS3LICDA........ | |||
00000010 00 00 09 00 00 00 08 00 00 00 01 00 00 00 00 01 ................ | |||
00000020 8C D3 A9 D8 00 00 00 00 00 00 00 00 00 00 00 00 ................ | |||
... | |||
00000800 01 42 4C 45 53 30 31 36 32 33 00 00 00 00 00 00 .BLES01623...... | |||
... | |||
}} | |||
== Structure == | |||
{|class="wikitable" | |||
! Offset !! Length!! Description | |||
|- | |||
| 0x0 || ~0x200 || Header | |||
|- | |||
| ~0x200 || 0x600 || Padding | |||
|- | |||
| 0x800 || ''Varies'' || License Table | |||
|- | |||
| ''Varies'' || up to 0x10000 || Padding | |||
|} | |||
The structure is a consequence of how the file is generated in PC and validated by the PS3. | The structure is a consequence of how the file is generated in PC and validated by the PS3. | ||
*CRC32 generation (in PC) | *CRC32 generation (in PC) | ||
<!--previous steps of how is generated the file could be longer to explain and not so easy to deduce--> | <!--previous steps of how is generated the file could be longer to explain and not so easy to deduce--> | ||
**A temporal file<!--or debug LIC.DAT for master disc?--> is created composed by: ''header'' + ''license table''. The crc32 value stored at offset 0x20 is filled with zeroes and works as a placeholder | **A temporal file<!--or debug LIC.DAT for master disc?--> is created composed by: ''header'' + ''license table''. The crc32 value stored at header offset 0x20 is filled with zeroes and works as a placeholder | ||
**Now is calculated the crc32 of the temporal file | **Now is calculated the crc32 of the temporal file | ||
**The crc32 calculated in previous step is stored at offset 0x20 replacing the zeroes placeholder | **The crc32 calculated in previous step is stored at header offset 0x20 replacing the zeroes placeholder | ||
**A padding is added after the '''lic_table_end''' offset to increase the final size of LIC.DAT up to 0x10000 | **A padding is added after the '''lic_table_end''' offset to increase the final size of LIC.DAT up to 0x10000 | ||
*CRC32 validation (in PS3) | *CRC32 validation (in PS3) | ||
**LIC.DAT is readed from disc, and copyed to a different location excluding the padding at the end of the file (cropped from first byte of file up to '''lic_table_end''' offset) | **LIC.DAT is readed from disc, and copyed to a different location excluding the padding at the end of the file (cropped from first byte of file up to '''lic_table_end''' offset) | ||
**The crc32 value stored at offset 0x20 is replaced by zeroes | **The crc32 value stored at header offset 0x20 is replaced by zeroes | ||
**Now is calculated the crc32 of the edited file | **Now is calculated the crc32 of the edited file | ||
**The crc32 calculated in previous step is validated against the crc32 value stored at offset 0x20 of the original LIC.DAT | **The crc32 calculated in previous step is validated against the crc32 value stored at header offset 0x20 of the original LIC.DAT | ||
=== Header === | |||
{|class="wikitable" | {|class="wikitable" | ||
! Offset !! Length !! Example !! Name !! Description | ! Offset !! Length !! Example !! Name !! Description | ||
Line 47: | Line 54: | ||
| 0x8 || 0x4 || 0x00000001 || '''version''' || DAT structure version | | 0x8 || 0x4 || 0x00000001 || '''version''' || DAT structure version | ||
|- | |- | ||
| 0xC || 0x4 || 0x80000000 || '''flag''' | | 0xC || 0x4 || 0x80000000 || '''flag''' || 0x80000000 = '''Retail''' (used in LIC.DAT under directory PS3_GAME)<br>0x00000000 = '''Debug''' (used in LIC.DAT under directory PS3_GM01, PS3_GM02, etc...) | ||
|- | |- | ||
| 0x10 || 0x4 || 0x00000900 || '''lic_table_end''' || License table | | 0x10 || 0x4 || 0x00000900 || '''lic_table_end''' || License table absolute end offset. Calculated by: '''lic_table_start + (lic_num * lic_size)''' | ||
|- | |- | ||
| 0x14 || 0x4 || 0x00000800 || '''lic_table_start''' || License table | | 0x14 || 0x4 || 0x00000800 || '''lic_table_start''' || License table absolute start offset. Always found 0x800 (static) | ||
|- | |- | ||
| 0x18 || 0x4 || 0x00000100 || '''lic_size''' || | | 0x18 || 0x4 || 0x00000100 || '''lic_size''' || The '''size of a license entry''' inside the license table. Always found 0x100 (static) | ||
|- | |- | ||
| 0x1C || 0x4 || 0x00000001 || '''lic_num''' || | | 0x1C || 0x4 || 0x00000001 || '''lic_num''' || The '''number of licenses entries''' inside the license table.<br>0x1 = Single boot disc<br>0x2 = Dual boot disc<br>0x3 = Triple boot disc<br>Etc... | ||
|- | |- | ||
| 0x20 || 0x4 || 0x8CD3A9D8 || '''crc32''' || CRC32 | | 0x20 || 0x4 || 0x8CD3A9D8 || '''crc32''' || CRC32 of an area starting form absolute offset '''0x0 up to the lic_table_end''' (including the CRC32 placeholder filled with zeroes) | ||
|- | |- | ||
| 0x24 || ? || 0x0000... || '''padding''' || is unknown | | 0x24 || ? || 0x0000... || '''padding''' || The header length is unknown, probablly is aligned to 0x200 but there are lot of zeroes up to 0x800 | ||
|} | |} | ||
== License table == | === License table === | ||
Composed by one or more license entries. | Composed by one or more license entries. | ||
=== License entry === | ==== License entry ==== | ||
{|class="wikitable" | {|class="wikitable" | ||
|- | |- | ||
Line 76: | Line 81: | ||
| 0x1 || 0x0A (if '''id_type''' = 0x01)<br>0x2A (if '''id_type''' = 0x02)<br>0x25 (if '''id_type''' = 0x03) || 'BLES01623' || '''id''' || Bootable content identifyer (EBOOT.BIN related) | | 0x1 || 0x0A (if '''id_type''' = 0x01)<br>0x2A (if '''id_type''' = 0x02)<br>0x25 (if '''id_type''' = 0x03) || 'BLES01623' || '''id''' || Bootable content identifyer (EBOOT.BIN related) | ||
|- | |- | ||
| 0x0B (if '''id_type''' = 0x01)<br>0x2B (if '''id_type''' = 0x02)<br>0x26 (if '''id_type''' = 0x03) || up to | | 0x0B (if '''id_type''' = 0x01)<br>0x2B (if '''id_type''' = 0x02)<br>0x26 (if '''id_type''' = 0x03) || up to 0x100 || 0x0000.... || '''padding''' || padding to fill the entry with zeroes up to the '''lic_size''' specifyed in the header | ||
|} | |} | ||
Line 85: | Line 90: | ||
* 0x03 means 0x25 bytes, a regular npdrm ContentID (ex. UP0002-BLES01623_00-0000111122223333) with \0 terminating | * 0x03 means 0x25 bytes, a regular npdrm ContentID (ex. UP0002-BLES01623_00-0000111122223333) with \0 terminating | ||
== Padding == | === Padding === | ||
The padding added at the bottom of the LIC.DAT file seems to be intended to increase size to a multiplier of bluray disc sectors and to protect the laser lens because otherway it is too tiny and so stressing for the laser. | |||
This padding is added in the last step when the file is generated in PC, and removed in the first step before the crc32 hash is validated by the PS3. | This padding is added in the last step when the file is generated in PC, and removed in the first step before the crc32 hash is validated by the PS3. | ||
= Multiboot PS3 Game Discs = | == Multiboot PS3 Game Discs == | ||
There is a special type of PS3 game disc that contains several EBOOT.BIN with several LIC.DAT files. These LIC.DAT files are a bit special because contains the TITLE_ID of all the EBOOT.BIN files of the disc. Some examples of games using this multiboot disc structure are: [https://gamefaqs.gamespot.com/ps3/712099-metal-gear-solid-the-legacy-collection/data Metal Gear Solid The Legacy Collection, Disc 1] (BLJM-91001 on PS3_DISC.SFB), and [https://gamefaqs.gamespot.com/ps3/108529-fighting-edition-tekken-6-tekken-tag-tournament-2/data Fighting edition] (BLES-02129 on PS3_DISC.SFB). | |||
There is a special type of PS3 game disc that contains several EBOOT.BIN with several LIC.DAT. These LIC.DAT files are a bit special because contains the TITLE_ID of all the EBOOT.BIN. | |||
The path names (PS3_GM01, PS3_GM02, etc...) only allows for 2 digits in decimal format... so up to PS3_GM99 + main bootable content in PS3_GAME makes a total of 100. | |||
== | === Example of Dualboot: Metal Gear Solid The Legacy Collection (BLJM-91001) === | ||
Dual boot disc structure, using folders '''PS3_GAME''', and '''PS3_GM01'''. | Dual boot disc structure, using folders '''PS3_GAME''', and '''PS3_GM01'''. | ||
Line 103: | Line 106: | ||
*dev_bdvd/PS3_GAME/LICDIR/LIC.DAT | *dev_bdvd/PS3_GAME/LICDIR/LIC.DAT | ||
**Header | **Header | ||
***<span style="background:# | ***'''<span style="background:#aCa9a3;">magic</span>''' "PS3LICDA" | ||
***<span style="background:# | ***'''<span style="background:#968592;">version</span>''' 1 | ||
***<span style="background:#66ff66;"> | ***'''<span style="background:#66ff66;">flag</span>''' 0x80000000 (retail) | ||
***<span style="background:#ff66ff;"> | ***'''<span style="background:#ff66ff;">lic_table_end</span>''' 0x0A00 | ||
***<span style="background:#f6ff6f;"> | ***'''<span style="background:#f6ff6f;">lic_table_start</span>''' 0x0800 | ||
***<span style="background:# | ***'''<span style="background:#9f96f6;">lic_size</span>''' 0x0100 | ||
***<span style="background:#6ffff6;"> | ***'''<span style="background:#6ffff6;">lic_num</span>''' 2 | ||
***<span style="background:#C1C132;"> | ***'''<span style="background:#C1C132;">crc32</span>''' 01 0F 95 0E | ||
**First License (located at offset 0x800, for the EBOOT.BIN under directory PS3_GAME) | |||
***'''id_type''' = 0x01 | |||
*** | ***'''id''' = BLJM61001 | ||
**Second License (located at offset 0x900, for EBOOT.BIN under directory PS3_GM01) | |||
***'''id_type''' = 0x01 | |||
***'''id''' = BLJM60351 | |||
| | ||
00000000 <span style="background:# | 00000000 <span style="background:#aCa9a3;">50 53 33 4C 49 43 44 41</span> <span style="background:#968592;">00 00 00 01</span> <span style="background:#66ff66;">80 00 00 00</span> PS3LICDA....€... | ||
00000010 <span style="background:#ff66ff;">00 00 0A 00</span> <span style="background:#f6ff6f;">00 00 08 00</span> <span style="background:# | 00000010 <span style="background:#ff66ff;">00 00 0A 00</span> <span style="background:#f6ff6f;">00 00 08 00</span> <span style="background:#9f96f6;">00 00 01 00</span> <span style="background:#6ffff6;">00 00 00 02</span> ................ | ||
00000020 <span style="background:#C1C132;">01 0F 95 0E</span> 00 00 00 00 00 00 00 00 00 00 00 00 ..•............. | 00000020 <span style="background:#C1C132;">01 0F 95 0E</span> 00 00 00 00 00 00 00 00 00 00 00 00 ..•............. | ||
... | ... | ||
Line 126: | Line 132: | ||
*dev_bdvd/PS3_GM01/LICDIR/LIC.DAT: | *dev_bdvd/PS3_GM01/LICDIR/LIC.DAT: | ||
**The | **The only diffrence is the flag, set to debug = 0x00000000 (and the crc32, because the flag is included when the crc32 is calculated) | ||
**This means the file LIC.DAT under directory PS3_GAME is different than any of the others under paths PS3_GM01, PS3_GM_02, etc... | **This means the file LIC.DAT under directory PS3_GAME is different than any of the others under paths PS3_GM01, PS3_GM_02, etc... Because the flag used in the LIC.DAT under the main PS3_GAME folder is set to retail, and the flag for the other LIC.DAT files (under PS3_GM01, PS3_GM02, etc...) is set as debug | ||
**All the others LIC.DAT files (under PS3_GM01, PS3_GM02, etc...) are identical because have the flag set as debug | |||
== Example of Tripleboot: Fighting edition (BLES-02129) == | === Example of Tripleboot: Fighting edition (BLES-02129) === | ||
Triple boot disc structure, using folders '''PS3_GAME''', '''PS3_GM01''', and '''PS3_GM02''' | Triple boot disc structure, using folders '''PS3_GAME''', '''PS3_GM01''', and '''PS3_GM02''' |
Latest revision as of 15:13, 19 January 2022
Description[edit | edit source]
- Checked within Level 2 Kernel and possible via lv2syscall476
- File size is always 0x10000 Bytes.
- Paths
- dev_bdvd/PS3_GAME/LICDIR/LIC.DAT
- dev_bdvd/PS3_GM01/LICDIR/LIC.DAT
- dev_bdvd/PS3_GM02/LICDIR/LIC.DAT
- etc...
Example[edit | edit source]
00000000 50 53 33 4C 49 43 44 41 00 00 00 01 80 00 00 00 PS3LICDA........ 00000010 00 00 09 00 00 00 08 00 00 00 01 00 00 00 00 01 ................ 00000020 8C D3 A9 D8 00 00 00 00 00 00 00 00 00 00 00 00 ................ ... 00000800 01 42 4C 45 53 30 31 36 32 33 00 00 00 00 00 00 .BLES01623...... ...
Structure[edit | edit source]
Offset | Length | Description |
---|---|---|
0x0 | ~0x200 | Header |
~0x200 | 0x600 | Padding |
0x800 | Varies | License Table |
Varies | up to 0x10000 | Padding |
The structure is a consequence of how the file is generated in PC and validated by the PS3.
- CRC32 generation (in PC)
- A temporal file is created composed by: header + license table. The crc32 value stored at header offset 0x20 is filled with zeroes and works as a placeholder
- Now is calculated the crc32 of the temporal file
- The crc32 calculated in previous step is stored at header offset 0x20 replacing the zeroes placeholder
- A padding is added after the lic_table_end offset to increase the final size of LIC.DAT up to 0x10000
- CRC32 validation (in PS3)
- LIC.DAT is readed from disc, and copyed to a different location excluding the padding at the end of the file (cropped from first byte of file up to lic_table_end offset)
- The crc32 value stored at header offset 0x20 is replaced by zeroes
- Now is calculated the crc32 of the edited file
- The crc32 calculated in previous step is validated against the crc32 value stored at header offset 0x20 of the original LIC.DAT
Header[edit | edit source]
Offset | Length | Example | Name | Description |
---|---|---|---|---|
0x0 | 0x8 | 'PS3LICDA' | magic | LIC.DAT identifyer |
0x8 | 0x4 | 0x00000001 | version | DAT structure version |
0xC | 0x4 | 0x80000000 | flag | 0x80000000 = Retail (used in LIC.DAT under directory PS3_GAME) 0x00000000 = Debug (used in LIC.DAT under directory PS3_GM01, PS3_GM02, etc...) |
0x10 | 0x4 | 0x00000900 | lic_table_end | License table absolute end offset. Calculated by: lic_table_start + (lic_num * lic_size) |
0x14 | 0x4 | 0x00000800 | lic_table_start | License table absolute start offset. Always found 0x800 (static) |
0x18 | 0x4 | 0x00000100 | lic_size | The size of a license entry inside the license table. Always found 0x100 (static) |
0x1C | 0x4 | 0x00000001 | lic_num | The number of licenses entries inside the license table. 0x1 = Single boot disc 0x2 = Dual boot disc 0x3 = Triple boot disc Etc... |
0x20 | 0x4 | 0x8CD3A9D8 | crc32 | CRC32 of an area starting form absolute offset 0x0 up to the lic_table_end (including the CRC32 placeholder filled with zeroes) |
0x24 | ? | 0x0000... | padding | The header length is unknown, probablly is aligned to 0x200 but there are lot of zeroes up to 0x800 |
License table[edit | edit source]
Composed by one or more license entries.
License entry[edit | edit source]
Relative Offset | Length | Example | Name | Description |
---|---|---|---|---|
0x0 | 0x1 | 0x1 | id_type | 0x01 = Title ID 0x02 = SKU ID 0x03 = Content ID |
0x1 | 0x0A (if id_type = 0x01) 0x2A (if id_type = 0x02) 0x25 (if id_type = 0x03) |
'BLES01623' | id | Bootable content identifyer (EBOOT.BIN related) |
0x0B (if id_type = 0x01) 0x2B (if id_type = 0x02) 0x26 (if id_type = 0x03) |
up to 0x100 | 0x0000.... | padding | padding to fill the entry with zeroes up to the lic_size specifyed in the header |
Explanation: The first byte indicates type and size of following text:
- 0x01 means 0xA bytes, a regular TitleID (ex. BLES01623) with \0 terminating
- 0x02 means 0x2A bytes, a regular SKU ID (ex. UP0002-BLES01623_00-0000111122223333-E001) with \0 terminating
- 0x03 means 0x25 bytes, a regular npdrm ContentID (ex. UP0002-BLES01623_00-0000111122223333) with \0 terminating
Padding[edit | edit source]
The padding added at the bottom of the LIC.DAT file seems to be intended to increase size to a multiplier of bluray disc sectors and to protect the laser lens because otherway it is too tiny and so stressing for the laser.
This padding is added in the last step when the file is generated in PC, and removed in the first step before the crc32 hash is validated by the PS3.
Multiboot PS3 Game Discs[edit | edit source]
There is a special type of PS3 game disc that contains several EBOOT.BIN with several LIC.DAT files. These LIC.DAT files are a bit special because contains the TITLE_ID of all the EBOOT.BIN files of the disc. Some examples of games using this multiboot disc structure are: Metal Gear Solid The Legacy Collection, Disc 1 (BLJM-91001 on PS3_DISC.SFB), and Fighting edition (BLES-02129 on PS3_DISC.SFB).
The path names (PS3_GM01, PS3_GM02, etc...) only allows for 2 digits in decimal format... so up to PS3_GM99 + main bootable content in PS3_GAME makes a total of 100.
Example of Dualboot: Metal Gear Solid The Legacy Collection (BLJM-91001)[edit | edit source]
Dual boot disc structure, using folders PS3_GAME, and PS3_GM01.
- dev_bdvd/PS3_GAME/LICDIR/LIC.DAT
- Header
- magic "PS3LICDA"
- version 1
- flag 0x80000000 (retail)
- lic_table_end 0x0A00
- lic_table_start 0x0800
- lic_size 0x0100
- lic_num 2
- crc32 01 0F 95 0E
- First License (located at offset 0x800, for the EBOOT.BIN under directory PS3_GAME)
- id_type = 0x01
- id = BLJM61001
- Second License (located at offset 0x900, for EBOOT.BIN under directory PS3_GM01)
- id_type = 0x01
- id = BLJM60351
- Header
00000000 50 53 33 4C 49 43 44 41 00 00 00 01 80 00 00 00 PS3LICDA....€... 00000010 00 00 0A 00 00 00 08 00 00 00 01 00 00 00 00 02 ................ 00000020 01 0F 95 0E 00 00 00 00 00 00 00 00 00 00 00 00 ..•............. ... 00000800 01 42 4C 4A 4D 36 31 30 30 31 00 00 00 00 00 00 .BLJM61001...... ... 00000900 01 42 4C 4A 4D 36 30 33 35 31 00 00 00 00 00 00 .BLJM60351...... ... 0000FFF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
- dev_bdvd/PS3_GM01/LICDIR/LIC.DAT:
- The only diffrence is the flag, set to debug = 0x00000000 (and the crc32, because the flag is included when the crc32 is calculated)
- This means the file LIC.DAT under directory PS3_GAME is different than any of the others under paths PS3_GM01, PS3_GM_02, etc... Because the flag used in the LIC.DAT under the main PS3_GAME folder is set to retail, and the flag for the other LIC.DAT files (under PS3_GM01, PS3_GM02, etc...) is set as debug
- All the others LIC.DAT files (under PS3_GM01, PS3_GM02, etc...) are identical because have the flag set as debug
Example of Tripleboot: Fighting edition (BLES-02129)[edit | edit source]
Triple boot disc structure, using folders PS3_GAME, PS3_GM01, and PS3_GM02
|