GTA Series IMG DIR: Difference between revisions
Jump to navigation
Jump to search
imported>Ikskoks |
imported>Ikskoks |
||
| (38 intermediate revisions by the same user not shown) | |||
| Line 3: | Line 3: | ||
* ''' Format Type ''': Archive <br> | * ''' Format Type ''': Archive <br> | ||
* ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br> | * ''' [http://en.wikipedia.org/wiki/Endianness Endian Order] ''': Little Endian <br> | ||
* ''' Signature ''': VER2 <br> | * ''' Signature ''': None / VER2 / R*N. <br> | ||
| Line 11: | Line 11: | ||
<pre> | <pre> | ||
// DIR file format (version 1) | // DIR file format (version 1) | ||
// num_of_entries = total_archive_size / 32 | |||
num_of_entries * | num_of_entries * | ||
| Line 17: | Line 19: | ||
4 bytes (uint32) - file size (in sectors) | 4 bytes (uint32) - file size (in sectors) | ||
24 bytes (char) - filename + padding // e.g. "radar00.txd" | 24 bytes (char) - filename + padding // e.g. "radar00.txd" | ||
} | |||
</pre> | |||
</div> | |||
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;"> | |||
<pre> | |||
// IMG file format (version 1) | |||
num_of_entries * | |||
{ | |||
x bytes - file data | |||
} | } | ||
</pre> | </pre> | ||
| Line 42: | Line 57: | ||
</b></tt> | </b></tt> | ||
=== Format Specifications (version 3) === | |||
<div class="toccolours mw-collapsible" id="mw-customcollapsible-myDivision" style="width:800px; overflow:auto;"> | |||
<pre> | |||
// IMG file format (version 3) | |||
// header | |||
4 bytes (char) - signature // "R*N." (Rockstar North) 52 2A 4E A9 | |||
4 bytes (uint32) - version // always 3 | |||
4 bytes (uint32) - number of files | |||
4 bytes (uint32) - info table size (in bytes) | |||
2 bytes (uint16) - length of the info table entry // always 16 | |||
2 bytes (uint16) - unknown | |||
// info table | |||
num_of_files * | |||
{ | |||
4 bytes (uint32) - file size | |||
4 bytes (uint32) - file type | |||
4 bytes (uint32) - file offset (in sectors) | |||
2 bytes (uint16) - used blocks | |||
2 bytes (uint16) - padding | |||
} | |||
// data | |||
num_of_files * | |||
{ | |||
x bytes - file data | |||
} | |||
</pre> | |||
</div> | |||
=== Notes and Comments === | === Notes and Comments === | ||
* Archives can be encrypted with '''AES-128 ECB''' encryption. | |||
* IMG files from XBOX GTA games can be compressed with '''lzo1x-999''' compression. | |||
=== Games === | === Games === | ||
List of games using this file format: | List of games using this file format: | ||
* Bully: Scholarship Edition (PC) (*.IMG / *.DIR) (version 1) | |||
* Grand Theft Auto III (PC) (*.IMG / *.DIR) (version 1) | * Grand Theft Auto III (PC) (*.IMG / *.DIR) (version 1) | ||
* Grand Theft Auto: Vice City (PC) (*.IMG / *.DIR) (version 1) | * Grand Theft Auto: Vice City (PC) (*.IMG / *.DIR) (version 1) | ||
| Line 54: | Line 106: | ||
* Grand Theft Auto: Liberty City Stories | * Grand Theft Auto: Liberty City Stories | ||
* Grand Theft Auto: Vice City Stories | * Grand Theft Auto: Vice City Stories | ||
* Grand Theft Auto IV | * Grand Theft Auto IV (*.IMG) (version 3) | ||
=== MultiEx BMS Script === | === MultiEx BMS Script === | ||
| Line 77: | Line 129: | ||
=== QuickBMS Script === | === QuickBMS Script === | ||
* [https://forum.xentax.com/viewtopic.php?p=184678#p184678 gta_img_universal_script] | |||
=== Compatible Programs === | === Compatible Programs === | ||
* [https://www.elberethzone.net/dragon-unpacker.html#download Dragon Unpacker] | |||
* [https://wiki.xentax.com/index.php/Game_Archive_UnPacker_(GAUP_plugin) Game Archive UnPacker] | |||
* [[Game Extractor|Game Extractor]]<br> | * [[Game Extractor|Game Extractor]]<br> | ||
* [https://gtamods.com/wiki/G-IMG G-IMG] | * [https://gtamods.com/wiki/G-IMG G-IMG] | ||
| Line 95: | Line 149: | ||
* [http://www.gtagarage.com/mods/show.php?id=1503 Spark] | * [http://www.gtagarage.com/mods/show.php?id=1503 Spark] | ||
* [https://gtamods.com/wiki/SparkIV SparkIV] | * [https://gtamods.com/wiki/SparkIV SparkIV] | ||
* [http://www.x-squares.com/File/i/35/X-Archive-Dragon.aspx X-Archive-Dragon] | |||
=== See Also === | === See Also === | ||
| Line 110: | Line 165: | ||
[[Category:Extension_img | Extension: img]] | [[Category:Extension_img | Extension: img]] | ||
[[Category:Extension_dir | Extension: dir]] | [[Category:Extension_dir | Extension: dir]] | ||
[[Category: | [[Category:AES encryption]] | ||
[[Category:LZO compression]] | |||
[[Category:File Format]] | [[Category:File Format]] | ||
Latest revision as of 11:06, 11 June 2022
IMG, DIR
- Format Type : Archive
- Endian Order : Little Endian
- Signature : None / VER2 / R*N.
Format Specifications (version 1)
// DIR file format (version 1)
// num_of_entries = total_archive_size / 32
num_of_entries *
{
4 bytes (uint32) - file offset (in sectors)
4 bytes (uint32) - file size (in sectors)
24 bytes (char) - filename + padding // e.g. "radar00.txd"
}
// IMG file format (version 1)
num_of_entries *
{
x bytes - file data
}
Format Specifications (version 2)
char {4} - Signature (VER2)
uint32 {4} - Number Of Files
// for each file
- uint32 {4} - File Offset [*2048]
- uint32 {4} - File Length [*2048] (includes padding at the end of the file)
- char {X} - Filename
- byte {1} - null Filename Terminator
- byte {0-3} - null Padding so filenameLength+1 is a multiple of 4 bytes
- // repeat until this file entry has length 32 bytes
- uint16 {2} - Unknown ID (incremental from 166 (from start of filename))
- uint16 {2} - Unknown ID (incremental from 166 (from start of filename))
// for each file
- byte {X} - File Data
- byte {X} - Padding to a multiple of 2048 bytes
Format Specifications (version 3)
// IMG file format (version 3)
// header
4 bytes (char) - signature // "R*N." (Rockstar North) 52 2A 4E A9
4 bytes (uint32) - version // always 3
4 bytes (uint32) - number of files
4 bytes (uint32) - info table size (in bytes)
2 bytes (uint16) - length of the info table entry // always 16
2 bytes (uint16) - unknown
// info table
num_of_files *
{
4 bytes (uint32) - file size
4 bytes (uint32) - file type
4 bytes (uint32) - file offset (in sectors)
2 bytes (uint16) - used blocks
2 bytes (uint16) - padding
}
// data
num_of_files *
{
x bytes - file data
}
Notes and Comments
- Archives can be encrypted with AES-128 ECB encryption.
- IMG files from XBOX GTA games can be compressed with lzo1x-999 compression.
Games
List of games using this file format:
- Bully: Scholarship Edition (PC) (*.IMG / *.DIR) (version 1)
- Grand Theft Auto III (PC) (*.IMG / *.DIR) (version 1)
- Grand Theft Auto: Vice City (PC) (*.IMG / *.DIR) (version 1)
- Grand Theft Auto: San Andreas (PC) (*.IMG) (version 2)
- Grand Theft Auto: Liberty City Stories
- Grand Theft Auto: Vice City Stories
- Grand Theft Auto IV (*.IMG) (version 3)
MultiEx BMS Script
ImpType Standard ;
IDString VER2 ;
Get NUMFILES Long 0 ;
SavePos CURPOS 0 ;
For T = 1 To NUMFILES ;
SavePos FOO ;
Get FILEOFF Long 0 ;
Math FILEOFF *= 2048 ;
SavePos FSO ;
Get FILESIZE Long 0 ;
Math FILESIZE *= 2048 ;
Get FILENAME String 0 ;
Log FILENAME FILEOFF FILESIZE FOO FSO ;
Math CURPOS += 32 ;
GoTo CURPOS 0 ;
Next T ;
QuickBMS Script
Compatible Programs
- Dragon Unpacker
- Game Archive UnPacker
- Game Extractor
- G-IMG
- GTA Stories IMG Tool
- IMG Factory
- IMG Console
- ImgEd
- IMG Manager
- IMG Tool
- IMG & Stream Limit Adjuster
- Limit Adjuster
- OpenIV
- Shadow Mapper
- Spark
- SparkIV
- X-Archive-Dragon
See Also