GTA: Modification Area
Would you like to react to this message? Create an account in a few clicks or log in to continue.
GTA: Modification Area

A website for the GTA modding scene

Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Big-game starts raising Schneider's profile
Gta3.img file EmptySun Mar 04, 2012 2:28 am by lavivi

» [Help] cleo created lighting
Gta3.img file EmptyThu Oct 14, 2010 1:03 am by findmy012

» Mission Question
Gta3.img file EmptyThu Oct 14, 2010 1:02 am by findmy012

» [IV] Spoiler Script
Gta3.img file EmptyThu Oct 14, 2010 1:02 am by findmy012

» Mission mod [help]
Gta3.img file EmptySat Sep 18, 2010 5:50 pm by jayd00

» Bc7 Mod Help
Gta3.img file EmptyFri Aug 20, 2010 11:19 am by pengpeng

» Found a bug
Gta3.img file EmptyFri Dec 18, 2009 4:22 am by _CJ360_

» [IV] Novitec Rosso 599 GTB
Gta3.img file EmptyTue Nov 17, 2009 4:22 pm by Kotton

» Hello/Guidance Request
Gta3.img file EmptyMon Oct 12, 2009 6:45 am by Adler

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Affiliates
image

Image

Image

Image

Image

Image

Image

Image

Image

Image

image

Image

steve-m.com

Image


----- Русский -----

Если ваш сайт содержит большую коллекцию SCM/CLEO-скриптов (больше 16), напишите на мой e-mail, и я добавлю его в список. Приветствуются скрипты, которые не встречаются на других сайтах ... Спасибо. ))))


----- English -----

If your website has a big enough collection of SCM/CLEO scripts (more than 16) notify me by e-mail
, and I will add it to the list. The unique scripts are preferable ... Thank you. ))))
Log in

I forgot my password



March 2024
MonTueWedThuFriSatSun
    123
45678910
11121314151617
18192021222324
25262728293031

Calendar Calendar


You are not connected. Please login or register

Gta3.img file

Go down  Message [Page 1 of 1]

1Gta3.img file Empty Gta3.img file Sun Feb 08, 2009 9:17 am

gtasbigfoot

gtasbigfoot
Admin

Description


The gta3.img file is a file, which holds, models, textures, col, animations, and more.
It can be opened and edited with any made IMG editor, most notably, Alci's IMG Editor, and ImgTool 2.0


Structure


Version 2 archives, introduced with GTA San Andreas, combine .dir and .img files into one .img file. The directory has the same format as in version 1, but is located at the beginning of the archive. Files are again aligned to 2 KB boundaries. File offsets are relative to the start of the whole archive, not to the end of the file list.

Code:

Header:

 4 byte - CHAR[4]  - FourCC, always "VER2"
 4 byte - DWORD    - number of entries (n)

Entry: (repeated n times)

 4 byte - DWORD    - offset of file inside archive (in blocks)
 4 byte - DWORD    - size of file (in blocks)
24 byte - CHAR[24]  - name of file

A major drawback of this format is the complicated extendability. If you have to add many files, it might happen that you run out of space for the directory, and have to move the first file(s) to the end.


Relating to GTA 4


GTA IV introduced yet another .img file format. Not only the format is new, also there can be encrypted archives. The internal IMG parser of the game works with 2 KB buffers, which means that the 2 KB bounds from earlier versions (blocks) are still present.
IMG Header

The header of an unencrypted file always has a size of 20 bytes.

Code:

4 byte - DWORD      - Identifier (0xA94E2A52 if the archive is not encrypted)
4 byte - DWORD      - Version (always 3, if not the format would be differ)
4 byte - DWORD      - Number of Items
4 byte - DWORD      - Table Size (in bytes)
2 byte - WORD      - Size of Table Items (needs to be always 0x10)
2 byte - WORD      - Unknown

IMG Table

The table holds information about the items. Each item header has a size of 16 bytes .

Code:

4 byte - DWORD      - Itemsize (in bytes)
4 byte - DWORD      - Resource type
4 byte - DWORD      - Offset (in blocks)
2 byte - WORD      - Used Blocks
2 byte - WORD      - Padding

Item Names' length will be calculate as :

Table Size - (Number of Items * Item Size)

Next that string will be split by '\x0'


A res source type is identified by the 4b DWORD value:

Code:
   
* 0x01: Generic
* 0x08: Texture archive
* 0x20: Bounds
* 0x6E: Model file
* 0x24: xpfl


Links


San Andreas
ImgTool 2.0
Alci's IMG Editor


GTA IV
G-Tools
Spark IV
Open GTA IV

http://gtamodding.com

Back to top  Message [Page 1 of 1]

Permissions in this forum:
You cannot reply to topics in this forum