-
Notifications
You must be signed in to change notification settings - Fork 3
BIF File Format
mrfearless edited this page Jan 22, 2019
·
13 revisions
BIFF Header v1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | CHAR | Signature 'BIFF' |
4 | 4 | CHAR | Version 'V1 ' |
8 | 4 | DWORD | Number of FileEntries |
12 | 4 | DWORD | Number of TileEntries |
16 | 4 | DWORD | Offset to FileEntries |
BIFF FileEntries v1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | DWORD | ResourceLocator |
4 | 4 | DWORD | ResourceOffset |
8 | 4 | DWORD | ResourceSize |
12 | 2 | WORD | ResourceType |
14 | 2 | WORD | Unknown |
Note: ResourceLocator
- The IE resource manager uses 32-bit values as a 'resource index', which codifies the source of the resource as well as which source it refers to. The layout of this value is:
- bits 31-20: source index (the ordinal value giving the index of the corresponding BIF entry)
- bits 19-14: tileset index
- bits 13- 0: non-tileset file index ( 12 bit value, that matches the value used in the BIF file)
BIFF TileEntries v1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | DWORD | ResourceLocator |
4 | 4 | DWORD | ResourceOffset |
8 | 4 | DWORD | Tiles count |
12 | 4 | DWORD | Tile size |
16 | 2 | WORD | ResourceType |
18 | 2 | WORD | Unknown |
BIF_ Header v1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | CHAR | Signature 'BIF ' |
4 | 4 | CHAR | Version 'V1 ' |
8 | 4 | DWORD | Filename Length *1 |
12 | *1 | CHAR | Filename |
16 + SIZEOF(Filename) | 4 | DWORD | Uncompressed Data Length |
20+ SIZEOF(Filename) | 4 | DWORD | Compressed Data Length *2 |
24+ SIZEOF(Filename) | *2 | BYTE | Compressed Data |
BIFC Header v1.0
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | CHAR | Signature 'BIFC' |
4 | 4 | CHAR | Version 'V1.0' |
8 | 4 | DWORD | Uncompressed BIFF size |
BIFC Block v1.0
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | DWORD | Uncompressed Block Size |
4 | 4 | DWORD | Compressed Block Size *1 |
8 | *1 | BYTE | Compressed Data |
BIFF Header v1.1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | CHAR | Signature 'BIFF' |
4 | 4 | CHAR | Version 'V1.1' |
8 | 4 | DWORD | Number of FileEntries |
12 | 4 | DWORD | NULL |
16 | 4 | DWORD | Offset to FileEntries |
BIFF FileEntries v1.1
Offset | Size | Type | Description |
---|---|---|---|
0 | 4 | DWORD | ResourceLocator |
4 | 4 | DWORD | ResourceFlags |
8 | 4 | DWORD | ResourceOffset |
12 | 4 | DWORD | ResourceSize |
16 | 2 | WORD | ResourceType |
18 | 2 | WORD | Unknown |
Note: ResourceLocator
- The IE resource manager uses 32-bit values as a 'resource index', which codifies the source of the resource as well as which source it refers to. The layout of this value is:
- bits 31-20: source index (the ordinal value giving the index of the corresponding BIF entry)
- bits 19-14: tileset index
- bits 13- 0: non-tileset file index ( 12 bit value, that matches the value used in the BIF file)
Note: ResourceFlags
- BIF index is now stored in ResourceFlags,
(flags & 0xFFF00000) >> 20). The rest appears to define 'fixed' index.
Note: There are no TileEntries in BIF v1.1 files