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 structure (decrypted)== | ||
All offsets are in little endian (except in the last table where there are two counters in decimal) | All offsets are in little endian (except in the last table where there are two counters in decimal) | ||
Line 17: | Line 5: | ||
1 cluster = 16 blocks = 1024*16 bytes =16384 bytes (0x4000) | 1 cluster = 16 blocks = 1024*16 bytes =16384 bytes (0x4000) | ||
discs_start ----------> 0x000400 (disc1), 0x100400 (disc2), 0x200400 (disc3), 0x300400 (disc4), etc... | |||
discs_keys -----------> 0x000C00 (disc1), 0x100C00 (disc2), 0x200C00 (disc3), 0x300C00 (disc4), etc... | |||
discs_map_tables ----> 0x004400 (disc1), 0x104400 (disc2), 0x204400 (disc3), 0x304400 (disc4), etc... | |||
===Header | ===iso.bin Header=== | ||
1 block = 1024 bytes (0x400) | 1 block = 1024 bytes (0x400) | ||
{| class="wikitable" | {| class="wikitable" | ||
|- | |- | ||
! Block Nº !! Offset !! Length !! Name !! Example !! | ! Block Nº !! Offset !! Length !! Name !! Example !! Dexcription | ||
|- | |- | ||
| 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) || '''ckecksum''' || variable || checksum of the header block... or checksum of the whole file ? | ||
|- | |- | ||
| 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'' || || | ||
|- | |- | ||
|} | |} | ||
=== | ===iso.bin Disc map=== | ||
64 clusters, 1024 blocks, 10485576 bytes (0x100000) | 64 clusters, 1024 blocks, 10485576 bytes (0x100000) | ||
This structure is repeated one time for every disc of the game all them joined together | This structure is repeated one time for every disc of the game all them joined together consecutively, 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="24" style="background-color:#DDDDDD;" | 0 <br /> '''Disc map header''' || rowspan="2" style="background-color:#DDDDDD;" | 1 || 0x0400 || 16 bytes (0x10) || '''magic''' || PSISOIMG0000 || different for "psp minis" (i dont remember)..... probably another for "ps2 classics" (speculation) | ||
|- | |- | ||
| | | 0x0410 || 1008 bytes (0x3F0) || ''padding'' || || | ||
|- | |- | ||
| rowspan=" | | 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 || 0x0C00 || 32 bytes (0x20) || '''disc_key ?''' || variable || <------------------ key to decrypt the disc1.iso ? | ||
|- | |- | ||
| | | 0x0C20 || 992 bytes (0x3E0) || ''padding'' || || | ||
|- | |- | ||
| | | style="background-color:#DDDDDD;" | 4 || 0x1000 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| rowspan=" | | rowspan="5" style="background-color:#DDDDDD;" | 5 || 0x1400 || 724 bytes (0x2D4) || ''padding'' || || | ||
|- | |- | ||
| | | 0x16D4 || 2 bytes (0x02) || '''block size ?''' || 1024 || <--- this is wrong, but matches for the first disc | ||
|- | |- | ||
| | | 0x16D6 || 2 bytes (0x02) || '''number of clusters''' || 64 || its always 64 clusters (so seems to be right) | ||
|- | |- | ||
| | | 0x16D8 || 2 bytes (0x02) || '''number of blocks ?''' || 1024 || <--- this is wrong, but matches for the first disc | ||
|- | |- | ||
| | | 0x16DA || 294 bytes (0x126) || ''padding'' || || | ||
|- | |- | ||
| | | style="background-color:#DDDDDD;" | 6 || 0x1800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| | | style="background-color:#DDDDDD;" | 7 || 0x1C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| | | style="background-color:#DDDDDD;" | 8 || 0x2000 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 9 || 0x2400 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 10 || 0x2800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 11 || 0x2C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 12 || 0x3000 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 13 || 0x3400 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 14 || 0x3800 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | style="background-color:#DDDDDD;" | 15 || 0x3C00 || 1024 bytes (0x400) || ''not used'' || || | ||
|- | |- | ||
| style="background-color:#DDDDDD;" | | | 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 /> '''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 table below | |||
| rowspan="2" style="background-color:#DDDDDD;" | 1 <br /> ''' | |||
|- | |- | ||
| 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''' || || || || | ||
|- | |- | ||
|} | |} | ||
====Disc map table==== | ====iso.bin Disc map table==== | ||
The table has an area reserved of 1032192 bytes. Divided in 32256 entries, of 32 bytes each entry. The number of used entryes in the file_table can vary (seems to be dependant of the .iso contents). The number of entries availables to store data is affected by a checksum (16 bytes) that is present only in the the last block of each cluster (in block nº16 of every cluster) | The table has an area reserved of 1032192 bytes. Divided in 32256 entries, of 32 bytes each entry. The number of used entryes in the file_table can vary (seems to be dependant of the .iso contents). The number of entries availables to store data is affected by a checksum (16 bytes) that is present only in the the last block of each cluster (in block nº16 of every cluster) | ||
When this checksum is between used entryes... his length is 32 bytes (it "steals" the area of one entry) | When this checksum is between used entryes... his length is 32 bytes (it "steals" the area of one entry) | ||
Line 174: | Line 104: | ||
! 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 || unknown | ||
|- | |- | ||
| 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 | ||
|- | |||
|} | |} | ||
=== | ===iso.bin Common Disc table=== | ||
Composed by a variable number of entries (depends of the number of files/folders inside the discs), 12 bytes each entry | Composed by a variable number of entries (depends of the number of files/folders inside the discs), 12 bytes each entry | ||
Line 194: | Line 125: | ||
! 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 ?) | |||
* ( | |||
* | |||
==Decrypting owned ISO.BIN.EDATs and MINIS.EDATs== | ==Decrypting owned ISO.BIN.EDATs and MINIS.EDATs== | ||
QUESTION: Am I allowed to post binaries compiled with the SCE SDK?<br> | |||
You can use this code snippet, which is based on a sdk sample, in your program to decrypt EDATs you have activated on your system: | |||
< | |||
<pre> | <pre> | ||
#define PSP_EMULATOR_KLIC | #define PSP_EMULATOR_KLIC {0x2A,0x6A,0xFB,0xCF,0x43,0xD1,0x57,0x9F,0x7D,0x73,0x87,0x41,0xA1,0x3B,0xD4,0x2E} | ||
#define BUF_SIZE (16*1024) | #define BUF_SIZE (16*1024) | ||
#define NP_POOL_SIZE (128*1024) | #define NP_POOL_SIZE (128*1024) | ||
Line 349: | Line 164: | ||
#include <np.h> | #include <np.h> | ||
#include <np/drm.h> | #include <np/drm.h> | ||
uint8_t np_pool[NP_POOL_SIZE]; | uint8_t np_pool[NP_POOL_SIZE]; | ||
uint8_t read_buf[BUF_SIZE]; | uint8_t read_buf[BUF_SIZE]; | ||
Line 372: | Line 182: | ||
ret = sceNpDrmIsAvailable2(&k_licensee, edata_file); | ret = sceNpDrmIsAvailable2(&k_licensee, edata_file); | ||
if (ret != CELL_OK) { | if (ret != CELL_OK) { | ||
printf("EDAT not activated\n"); | printf("EDAT not activated\n", ret); | ||
return ret; | return ret; | ||
} | } | ||
Line 379: | Line 189: | ||
ret = cellFsOpen(edata_file, CELL_FS_O_RDONLY, &fd1, &arg, sizeof(arg)); | ret = cellFsOpen(edata_file, CELL_FS_O_RDONLY, &fd1, &arg, sizeof(arg)); | ||
if (ret != CELL_FS_OK) { | if (ret != CELL_FS_OK) { | ||
printf("Error opening for reading\n"); | printf("Error opening for reading\n", ret); | ||
return ret; | return ret; | ||
} | } | ||
Line 385: | Line 195: | ||
ret = cellFsOpen(raw_file, CELL_FS_O_RDWR|CELL_FS_O_CREAT, &fd2, NULL, 0); | ret = cellFsOpen(raw_file, CELL_FS_O_RDWR|CELL_FS_O_CREAT, &fd2, NULL, 0); | ||
if (ret != CELL_FS_OK) { | if (ret != CELL_FS_OK) { | ||
printf("Error opening file\n"); | printf("Error opening file\n", ret); | ||
cellFsClose(fd2); | cellFsClose(fd2); | ||
return ret; | return ret; | ||
Line 422: | Line 232: | ||
ret = cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); | ret = cellSysmoduleUnloadModule(CELL_SYSMODULE_SYSUTIL_NP); | ||
ret = cellSysmoduleUnloadModule(CELL_SYSMODULE_FS); | ret = cellSysmoduleUnloadModule(CELL_SYSMODULE_FS); | ||
</pre> | </pre> | ||
=== | =Decrypted Content= | ||
Please help with your own uploads to better understand the structure. | |||
==Links to Samples of Decrypted ISO.BIN.EDATs== | |||
<pre> | |||
Angry Birds(USA) http://www.multiupload.nl/UM81ZBTR8E | |||
=== | </pre> | ||
==Links to Samples of Decrypted MINIS.EDATs== | |||
<pre> | |||
Angry Birds(USA) http://www.multiupload.nl/6PJP0E6JHH | |||
</pre> | |||
==Links to Samples of Decrypted MINIS2.EDATs== | |||
<pre> | <pre> | ||
</pre> | </pre> | ||