Editing ISO.BIN.EDAT
Jump to navigation
Jump to search
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: | ||
== ISO.BIN.EDAT == | ==ISO.BIN.EDAT== | ||
This is an encryted container format, first step to work with it is to decrypt it <!--more info an internal links to other wiki pages needed--><br> | |||
After decryption we shoould refer to it as ISO.BIN.DAT (without the "E"... so the EDAT became a DAT) | |||
After decryption | |||
==ISO.BIN.DAT (decrypted)== | ==ISO.BIN.DAT (decrypted)== | ||
Line 30: | Line 28: | ||
! Block Nº !! Offset !! Length !! Name !! Example !! Description | ! Block Nº !! Offset !! Length !! Name !! Example !! Description | ||
|- | |- | ||
| rowspan="5" style="background-color:#DDDDDD;" | 0 <br /> '''common_header''' || 0x0000 || | | rowspan="5" style="background-color:#DDDDDD;" | 0 <br /> '''common_header''' || 0x0000 || 16 bytes (0x10) || '''magic''' || PSTITLEIMG000000 || | ||
|- | |- | ||
| 0x0010 || | | 0x0010 || 496 bytes (0x1F0) || ''padding'' || || | ||
|- | |- | ||
| 0x0200 || | | 0x0200 || 100 bytes (0x64) || '''discs_start_offsets''' || 00 04 00 00 || 25 chunks of 4 bytes ... each chunk = start position of each disc, in games with only 1 disc only the first 4 bytes are used | ||
|- | |- | ||
| 0x0264 || | | 0x0264 || 16 bytes (0x10) || '''game_id''' || _SLES_12345 || common identifyer for all discs | ||
|- | |- | ||
| 0x0274 || | | 0x0274 || 396 bytes (0x18C) || ''padding'' || || | ||
|- | |- | ||
|} | |} | ||
Line 47: | Line 45: | ||
This structure is repeated one time for every disc of the game all them joined together consecutivelys (the example below is from ff8), the whole space is reserved even when there is no data used | This structure is repeated one time for every disc of the game all them joined together consecutivelys (the example below is from ff8), the whole space is reserved even when there is no data used | ||
{| class="wikitable | {| class="wikitable" | ||
|- | |- | ||
! Cluster Nº !! Block Nº !! Offset !! Length !! Name !! Example !! Notes | ! Cluster Nº !! Block Nº !! Offset !! Length !! Name !! Example !! Notes | ||
|- | |- | ||
| rowspan=" | | rowspan="25" style="background-color:#DDDDDD;" | 0 <br /> '''Disc map header''' || rowspan="3" style="background-color:#DDDDDD;" | 1 || 0x0400 || 12 bytes (0x0c) || '''magic''' || PSISOIMG0000 || In "PSP Minis" It's NPUMDIMG ([[Environments|NP]] UMD Image) ..... probably another for "ps2 classics" (speculation) | ||
|- | |- | ||
| | | 0x040c || 4 bytes (0x04) || isosize || || Offset from the start of the PSISOIMG section to the next section<br>For uncompressed images this is usually 0x100000 + size of iso-image padded to 0x9300<br>If the disc contains CD-DA tracks then this number will also include all the ATRACK encoded audio that follows after the disk image. | ||
|- | |- | ||
| | | 0x0410 || 1008 bytes (0x3F0) || ''padding'' || || | ||
|- | |- | ||
| | | rowspan="2" style="background-color:#DDDDDD;" | 2 || 0x0800 || 16 bytes (0x10) || '''disc_id''' || _SLES_12345 || in games with several discs each disc has a different id | ||
|- | |- | ||
| | | 0x0810 || 1008 bytes (0x3F0) || ''padding'' || || | ||
|- | |- | ||
| rowspan="2" style="background-color:#DDDDDD;" | 3 || | | rowspan="2" style="background-color:#DDDDDD;" | 3 || 0x0C00 || 1020 bytes (0x3FС) || '''disc_TOC''' || variable || style="background-color:#DDDDDD;" | Table of content, like CUE sheet, supports upto 99 entries (102 entries total). See '''Disc toc table''' below | ||
|- | |- | ||
| | | 0x0FFC || 4 bytes (0x4) || disc_start_offset || 0x100000 || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 4 || | | style="background-color:#DDDDDD;" | 4 || 0x1000 || 1024 bytes (0x400) || '''audio tracks table''' || || style="background-color:#DDDDDD;" | Datas of audio tracks (2-65). offset, size, and more. See '''Audio tracks table''' below | ||
|- | |- | ||
| rowspan="5" style="background-color:#DDDDDD;" | 5 || | | rowspan="5" style="background-color:#DDDDDD;" | 5 || 0x1400 || 544 bytes (0x220) || '''audio tracks table''' || || style="background-color:#DDDDDD;" | Datas of audio tracks (66-99). offset, size, and more. See '''Audio tracks table''' below | ||
|- | |- | ||
| | | 0x1620 || 180 bytes (0xB4) || ''game params'' || || <!-- doesnt makes sense to start using a block with a padding, i bet it was an unused area in the file/s i was looking at when i made this table --> style="background-color:#DDDDDD;" | See '''Game Params Table''' below | ||
|- | |- | ||
| | | 0x16D4 || 4 bytes (0x04) || '''subchannel offset''' || 0x100400 || Offset to where subchannel data is stored. This is used with libcrypt. | ||
|- | |- | ||
| | | 0x16D8 || 4 bytes (0x04) || '''subchannel count''' || 0x178 || Number of subchannel blocks. Each block is 12 bytes. Content is unknown. | ||
|- | |- | ||
| | | 0x16DC || 292 bytes (0x124) || ''padding'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 6 || | | style="background-color:#DDDDDD;" | 6 || 0x1800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 7 || | | style="background-color:#DDDDDD;" | 7 || 0x1C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 8 || | | style="background-color:#DDDDDD;" | 8 || 0x2000 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 9 || | | style="background-color:#DDDDDD;" | 9 || 0x2400 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 10 || | | style="background-color:#DDDDDD;" | 10 || 0x2800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 11 || | | style="background-color:#DDDDDD;" | 11 || 0x2C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 12 || | | style="background-color:#DDDDDD;" | 12 || 0x3000 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 13 || | | style="background-color:#DDDDDD;" | 13 || 0x3400 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 14 || | | style="background-color:#DDDDDD;" | 14 || 0x3800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | 15 || | | style="background-color:#DDDDDD;" | 15 || 0x3C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| rowspan="2" style="background-color:#DDDDDD;" | 16 || | | rowspan="2" style="background-color:#DDDDDD;" | 16 || 0x4000 || 16 bytes (0x10) || '''checksum''' || 1CCE0033 60C6E8A6 B36A972D 00EAFDBF || seems to be the checksum of this block, and because this block is always unused... this checksum is always the same | ||
|- | |- | ||
| | | 0x4010 || 1008 bytes (0x3F0) || ''padding'' || || | ||
|- | |- | ||
| rowspan="2" style="background-color:#DDDDDD;" | 1 <br /> ''' | | rowspan="2" style="background-color:#DDDDDD;" | 1 <br /> '''Disc map table''' || style="background-color:#DDDDDD;" | 17 || 0x4400 || variable || '''Disc map table''' || || rowspan="3" style="background-color:#DDDDDD;" | divided in chunks of 32 bytes. See '''Disc map table''' table below | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | Up to 32 || || || || | | style="background-color:#DDDDDD;" | Up to 32 || || || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | Up to 64 <br /> ''' | | style="background-color:#DDDDDD;" | Up to 64 <br /> '''Disc map table''' || || || || | ||
|- | |- | ||
|} | |} | ||
Line 119: | Line 111: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! Offset !! Length !! Name !! Example !! Notes | ||
|- | |- | ||
| 0x00 || 1 byte (0x01) || '''TYPE''' || 0x41/0x01 || entry flags | |||
|- | |- | ||
| 0x01 || | | 0x01 || 1 byte (0x01) || '''TNO''' || 00 || always zero | ||
|- | |- | ||
| 0x02 || | | 0x02 || 1 byte (0x01) || '''POINT''' || 0xA0/0xA1/0xA2/0x01/0x02/0x03/etc || increases | ||
|- | |- | ||
| 0x03 || | | 0x03 || 1 byte (0x01) || '''MIN''' || varies || decimal | ||
|- | |- | ||
| 0x04 || | | 0x04 || 1 byte (0x01) || '''SEC''' || varies || decimal | ||
|- | |- | ||
| 0x05 || | | 0x05 || 1 byte (0x01) || '''FRAME''' || varies || decimal | ||
|- | |- | ||
| 0x06 || | | 0x06 || 1 byte (0x01) || '''ZERO''' || 00 || always zero | ||
|- | |- | ||
| 0x07 || | | 0x07 || 1 byte (0x01) || '''PMIN''' || varies || decimal | ||
|- | |- | ||
| 0x08 || | | 0x08 || 1 byte (0x01) || '''PSEC''' || varies || decimal | ||
|- | |- | ||
| 0x09 || | | 0x09 || 1 byte (0x01) || '''PFRAME''' || varies || decimal | ||
|- | |- | ||
|} | |} | ||
Line 148: | Line 139: | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! | ! Offset !! Length !! Name !! Example !! Notes | ||
|- | |- | ||
| 0x00 || 4 || '''offset''' || || | |||
|- | |- | ||
| 0x04 || | | 0x04 || 4 || '''size''' || || | ||
|- | |- | ||
| 0x08 || | | 0x08 || 4 || '''unknown_0''' || || always zeroed | ||
|- | |- | ||
| 0x0C || | | 0x0C || 4 || '''and more \o/''' || || encryption key | ||
|- | |- | ||
|} | |} | ||
====Game Params Table==== | |||
There is a setting related with PS1 libcrypt protection in this area (located at <s>relative</s> absolute offset 0x12B0 for single disc or 0x16B0 in the first disc for Multidisc, lenght 0x4 little endian), see: [https://www.psx-place.com/threads/ps1-libcrypt-support-on-ps3-official-emus-research-thread.35836/page-7#post-316873 talk] | |||
Libcrypt in emulator is supported by supplying ready 16 bit key in little endian format (0xA371 in CTR example). | |||
List of keys can be obtained using [https://github.com/Red-J/LibcryptMagic-Word-Finder-PSX Libcrypt Magic Word Finder PSX] | |||
====Disc map table==== | ====Disc map table==== | ||
Line 174: | Line 168: | ||
! Entry Nº !! Offset !! Length !! Name !! Example !! Notes | ! Entry Nº !! Offset !! Length !! Name !! Example !! Notes | ||
|- | |- | ||
| rowspan="5" style="background-color:#DDDDDD;" | 1 || 0x00 || | | rowspan="5" style="background-color:#DDDDDD;" | 1 || 0x00 || 4 bytes (0x04) || '''file_offset''' || 0 || file offset from start of .iso root (for the first entry is always 0) | ||
|- | |- | ||
| 0x04 || | | 0x04 || 2 bytes (0x02) || '''file_size''' || variable || this size determines the displacement of the next file (in the next entry) | ||
|- | |- | ||
| 0x06 || | | 0x06 || 2 bytes (0x02) || '''file_type ?''' || 01 00 || usually 1... and 0 for the last entry | ||
|- | |- | ||
| 0x08 || | | 0x08 || 16 bytes (0x10) || '''file_checksum''' || variable || First 16 bytes of the sha1 of the uncompressed data | ||
|- | |- | ||
| 0x18 || | | 0x18 || 8 bytes (0x08) || ''padding'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | Up to 32256 || || || || || same structure than the previous entry | | style="background-color:#DDDDDD;" | Up to 32256 || || || || || same structure than the previous entry | ||
|- | |||
|} | |} | ||
Line 194: | Line 189: | ||
! Entry Nº !! Offset !! Length !! Name !! Example !! Notes | ! Entry Nº !! Offset !! Length !! Name !! Example !! Notes | ||
|- | |- | ||
| rowspan="4" style="background-color:#DDDDDD;" | 1 || 0x00 || | | rowspan="4" style="background-color:#DDDDDD;" | 1 || 0x00 || 4 bytes (0x04) || '''file_offset ?''' || 0 || always increases | ||
|- | |- | ||
| 0x04 || | | 0x04 || 2 bytes (0x02) || '''file_type ?''' || 01 01 || always 01 01 | ||
|- | |- | ||
| 0x06 || | | 0x06 || 3 bytes (0x03) || '''counter 1''' || || some kind of counter, in decimal, always increases <-------- related with "sectors" inside the .iso ? | ||
|- | |- | ||
| 0x09 || | | 0x09 || 3 bytes (0x03) || '''counter 2''' || || another counter, in decimal, always increases, its in relationship with the previous counter (this one is always 200 bytes bigger than the previous one) | ||
|- | |- | ||
|} | |} | ||
There are 2 "special" entries to mark the "start of a disc" (FFFFFFFF 00000000 FFFFFFFF), and the "end of a disc" (FFFFFFFF FFFFFFFF FFFFFFFF). Between the start and the end, there are a variable number of entries. | |||
There is also an added string at the end of the last disc (after the last FFFFFFFF FFFFFFFF FFFFFFFF entry)... is a 40 bytes unknown area (in my example my game had 4 discs so maybe this area is divided in chunks of 10 bytes for each disc) | |||
So as an example... for a game with 4 discs this table is: | |||
* first entry of disc 1 ---> FFFFFFFF 00000000 FFFFFFFF (start of disc 1) | |||
* next entries of disc 1 --> data from disc.... the number is variable | |||
* last entry of disc 1 ---> FFFFFFFF FFFFFFFF FFFFFFFF (end of disc 1) | |||
* first entry of disc 2 ---> FFFFFFFF 00000000 FFFFFFFF (start of disc 2) | |||
* next entries of disc 2 --> data from disc.... the number is variable | |||
* last entry of disc 2 ---> FFFFFFFF FFFFFFFF FFFFFFFF (end of disc 2) | |||
* first entry of disc 3 ---> FFFFFFFF 00000000 FFFFFFFF (start of disc 3) | |||
* next entries of disc 3 --> data from disc.... the number is variable | |||
* last entry of disc 3 ---> FFFFFFFF FFFFFFFF FFFFFFFF (end of disc 3) | |||
* first entry of disc 4 ---> FFFFFFFF 00000000 FFFFFFFF (start of disc 4) | |||
* next entries of disc 4 --> data from disc.... the number is variable | |||
* last entry of disc 4 ---> FFFFFFFF FFFFFFFF FFFFFFFF (end of disc 4) | |||
* unknown area of 40 bytes (10 bytes for each disc ?) | |||
* | |||
* | |||
== Minis ISO.BIN structure == | == Minis ISO.BIN structure == | ||
Line 427: | Line 406: | ||
=== Decrypting with PSL1GHT === | === Decrypting with PSL1GHT === | ||
* https://github.com/euss/psp_edat_decryptor (not my code, just git'ed it for convenience) | |||
* | * mirrors: [http://mir.cr/0XXBT99Z], [http://mir.cr/1SNVEH2D], [http://mir.cr/ZKZJFPET] | ||
* | |||
==About PS2 Classics== | ==About PS2 Classics== |