Content-Transfer-Encoding: binary
Contents |
Disclaimer
It IS a possibility that I may have made some minor mistakes. Feel free to correct them. -hdd512
General
Almost every game disc has a ".IMG" file usually located in the same folder as all the other drivers it uses. They are packages containing drivers for the IOP. They usually include SYSMEM, LOADCORE, SIFCMD, SIFMAN, THREADMAN, IOMAN, MODLOAD, FILEIO, CDVDMAN, CDVDFSV, LOADFILE, TIMEMANI, ROMDRV, EESYNC, SYSCLIB, and STDIO.
Game discs may have multiple .IMG files, and the names of the files varies from game to game. There are generally three types of these files.
- Standard IOP.IMG files.
- DNAS.IMG files.
- The PS2's bios is also in this format.
The ROM0 of the ps2 bios is in the exact same format as described below with the one execption that it begins with what I think is the kernel. The DNAS variety is virtually the same as the standard one with the exception that it contains routines to read the security sector on game discs so the ps2 can send the disc IDs to DNAS servers for verification. They may also contain some other DNAS services that I'm not aware of at this time.
Behavior and usage
Each game disc has a main executable, which references the .IMG file in the same manner that it references drivers. The PS2 will then load and execute whatever is in the package. It appears to be possible to add drivers to the package and have the game accept them. For example, I was able to take the DEV9.IRX, ATAD.IRX, and HDD.IRX out of Timesplitters 2's modules directory(the hdd was disabled in this game but the drivers remained on the disc) and add them to its IOP.IMG and have the game load and execute them without breaking it. So how do I
know it really used
them? When I added PFS.IRX to the package it crashed to a pink screen.
Structure
Each .IMG file begins with a list of its contents, which is referred to as ROMDIR. Each list item is 16 bytes long, and has a 10 byte long space for the item's name minus its extension. Then a 2 byte long integer tells how long its description in EXTINFO is, followed by a 16bit integer telling the item's size.
The list seems to always begin with RESET, with looks to be a mere placeholder. Whether its necessary or not I don't know. The second item in the list is always ROMDIR, which represents this very list which it is a part of. ROMDIR tells how long this list is. The third item is EXTINFO. EXTINFO is the section appearing immediately after this list and contains descriptions of the items. EXTINFO also contains the file dates and I suspect some of the data is their attributes.
Last of all, each item, be it one of the drivers or a list info, all begin at the beginning of a 16 byte line. Meaning that if a given item is not a multiple of 16 bytes, then it will have some bytes added to the end of it to make the next item line up at the beginning of a 16 byte line.
Below is the ROMDIR and EXTINFO as it appears in Timesplitters 2's IOP.IMG.
Offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 00000000 52 45 53 45 54 00 00 00 00 00 08 00 00 00 00 00 RESET........... 00000010 52 4F 4D 44 49 52 00 00 00 00 48 00 30 01 00 00 ROMDIR....H.0... 00000020 45 58 54 49 4E 46 4F 00 00 00 00 00 30 02 00 00 EXTINFO.....0... 00000030 4C 4F 41 44 43 4F 52 45 00 00 20 00 79 26 00 00 LOADCORE.. .y&.. 00000040 53 49 46 43 4D 44 00 00 00 00 28 00 79 27 00 00 SIFCMD....(.y'.. 00000050 53 49 46 4D 41 4E 00 00 00 00 20 00 31 17 00 00 SIFMAN.... .1... 00000060 54 48 52 45 41 44 4D 41 4E 00 28 00 FD 99 00 00 THREADMAN.(.�.. 00000070 49 4F 4D 41 4E 00 00 00 00 00 20 00 01 31 00 00 IOMAN..... ..1.. 00000080 4D 4F 44 4C 4F 41 44 00 00 00 24 00 4D 46 00 00 MODLOAD...$.MF.. 00000090 46 49 4C 45 49 4F 00 00 00 00 20 00 95 50 00 00 FILEIO.... .�P.. 000000A0 43 44 56 44 4D 41 4E 00 00 00 1C 00 C5 1A 01 00 CDVDMAN.....�... 000000B0 43 44 56 44 46 53 56 00 00 00 20 00 D5 9E 00 00 CDVDFSV... .՞.. 000000C0 4C 4F 41 44 46 49 4C 45 00 00 20 00 61 2D 00 00 LOADFILE.. .a-.. 000000D0 54 49 4D 45 4D 41 4E 49 00 00 20 00 B5 17 00 00 TIMEMANI.. .�... 000000E0 52 4F 4D 44 52 56 00 00 00 00 20 00 29 0F 00 00 ROMDRV.... .)... 000000F0 45 45 53 59 4E 43 00 00 00 00 18 00 09 06 00 00 EESYNC.......... 00000100 53 59 53 43 4C 49 42 00 00 00 20 00 DD 27 00 00 SYSCLIB... .�'.. 00000110 53 54 44 49 4F 00 00 00 00 00 18 00 31 0D 00 00 STDIO.......1... 00000120 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00000130 00 00 04 01 04 06 02 20 00 00 44 03 32 30 30 32 ....... ..D.2002 00000140 30 36 30 34 2D 31 30 33 39 30 31 2C 63 6F 6E 66 0604-103901,conf 00000150 66 69 6C 65 2C 69 6F 70 72 70 32 35 33 2E 69 6D file,ioprp253.im 00000160 67 2C 78 6F 6B 61 6E 6F 40 72 65 6C 2D 6C 69 6E g,xokano@rel-lin 00000170 75 78 2F 7E 2F 74 6D 70 5F 32 35 33 00 00 00 00 ux/~/tmp_253.... 00000180 00 00 04 01 23 05 02 20 04 02 00 02 00 00 10 03 ....#.. ........ 00000190 4D 6F 64 75 6C 65 5F 4D 61 6E 61 67 65 72 00 00 Module_Manager.. 000001A0 00 00 04 01 23 05 02 20 07 02 00 02 00 00 18 03 ....#.. ........ 000001B0 49 4F 50 5F 53 49 46 5F 72 70 63 5F 69 6E 74 65 IOP_SIF_rpc_inte 000001C0 72 66 61 63 65 00 00 00 00 00 04 01 23 05 02 20 rface.......#.. 000001D0 02 02 00 02 00 00 10 03 49 4F 50 5F 53 49 46 5F ........IOP_SIF_ 000001E0 6D 61 6E 61 67 65 72 00 00 00 04 01 23 05 02 20 manager.....#.. 000001F0 03 02 00 02 00 00 18 03 4D 75 6C 74 69 5F 54 68 ........Multi_Th 00000200 72 65 61 64 5F 4D 61 6E 61 67 65 72 00 00 00 00 read_Manager.... 00000210 00 00 04 01 23 05 02 20 03 02 00 02 00 00 10 03 ....#.. ........ 00000220 49 4F 2F 46 69 6C 65 5F 4D 61 6E 61 67 65 72 00 IO/File_Manager. 00000230 00 00 04 01 23 05 02 20 07 02 00 02 00 00 14 03 ....#.. ........ 00000240 4D 6F 6C 64 75 6C 65 5F 46 69 6C 65 5F 6C 6F 61 Moldule_File_loa 00000250 64 65 72 00 00 00 04 01 23 05 02 20 0E 02 00 02 der.....#.. .... 00000260 00 00 10 03 46 49 4C 45 49 4F 5F 73 65 72 76 69 ....FILEIO_servi 00000270 63 65 00 00 00 00 04 01 04 06 02 20 1D 02 00 02 ce......... .... 00000280 00 00 0C 03 63 64 76 64 5F 64 72 69 76 65 72 00 ....cdvd_driver. 00000290 00 00 04 01 04 06 02 20 1D 02 00 02 00 00 10 03 ....... ........ 000002A0 63 64 76 64 5F 65 65 5F 64 72 69 76 65 72 00 00 cdvd_ee_driver.. 000002B0 00 00 04 01 23 05 02 20 02 02 00 02 00 00 10 03 ....#.. ........ 000002C0 4C 6F 61 64 4D 6F 64 75 6C 65 42 79 45 45 00 00 LoadModuleByEE.. 000002D0 00 00 04 01 23 05 02 20 02 02 00 02 00 00 10 03 ....#.. ........ 000002E0 54 69 6D 65 72 5F 4D 61 6E 61 67 65 72 00 00 00 Timer_Manager... 000002F0 00 00 04 01 23 05 02 20 01 02 00 02 00 00 10 03 ....#.. ........ 00000300 52 4F 4D 5F 66 69 6C 65 5F 64 72 69 76 65 72 00 ROM_file_driver. 00000310 00 00 04 01 23 05 02 20 01 02 00 02 00 00 08 03 ....#.. ........ 00000320 53 79 6E 63 45 45 00 00 00 00 04 01 23 05 02 20 SyncEE......#.. 00000330 02 02 00 02 00 00 10 03 53 79 73 74 65 6D 5F 43 ........System_C 00000340 5F 6C 69 62 00 00 00 00 00 00 04 01 23 05 02 20 _lib........#.. 00000350 03 02 00 02 00 00 08 03 53 74 64 69 6F 00 00 00 ........Stdio...
![[Main Page]](http://www.eurasia.nu/images/svico_t.gif)