TES4 BSA LayoutEdit
File StructureEdit
Name | Type/Size | Info |
---|---|---|
header | Header | |
directory entries | Directory Entry[directory count] | |
files | File Block[directory count] | |
file names | zstring[file count] | only present if "file strings" is set |
data | File Data[file count] |
HeaderEdit
Name | Type/Size | Info | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tag | char[4] | "BSA\x00" | ||||||||||||||||||||||||||
version | uint32 | 103/104/105 | ||||||||||||||||||||||||||
header size | uint32 | 0x24 | ||||||||||||||||||||||||||
archive flags | uint32 |
|
||||||||||||||||||||||||||
directory count | uint32 | |||||||||||||||||||||||||||
file count | uint32 | |||||||||||||||||||||||||||
directory names length | uint32 | includes null terminators | ||||||||||||||||||||||||||
file names length | uint32 | includes null terminators | ||||||||||||||||||||||||||
archive type | uint16 |
|
||||||||||||||||||||||||||
padding | uint16 |
Directory EntryEdit
Name | Type/Size | Info | ||||||
---|---|---|---|---|---|---|---|---|
hash | Hash | |||||||
file count | uint32 | |||||||
|
||||||||
file entries offset | uint32 | subtract "file names length" to get the absolute offset | ||||||
|
File BlockEdit
Name | Type/Size | Info |
---|---|---|
directory name | bzstring | only present if "directory strings" is set |
files | File Entry[...] |
File EntryEdit
Name | Type/Size | Info |
---|---|---|
hash | Hash | |
size | uint32 | bit 1 << 30 indicates the file has the opposite compression of the archive
bit 1 << 31 indicates if the file has been checked yet (internal usage) |
offset | uint32 | bit 1 << 31 is used as a flag |
File DataEdit
Name | Type/Size | Info | ||||||
---|---|---|---|---|---|---|---|---|
|
||||||||
decompressed size | uint32 | only present if the file is compressed | ||||||
data | uint8[...] |
HashEdit
Name | Type/Size | Info |
---|---|---|
last | uint8 | |
last2 | uint8 | |
length | uint8 | |
first | uint8 | |
crc | uint32 |
TES4 BSL LayoutEdit
File StructureEdit
Name | Type/Size | Info |
---|---|---|
header | Header | same header, except tag is "BSL\x00" |
root directory | dzstring | |
directory entries | Directory Entry[directory count] | |
file entries | File Entry[file count] |
Directory EntryEdit
Name | Type/Size | Info |
---|---|---|
file count | uint32 | |
directory name | dzstring |
File EntryEdit
Name | Type/Size | Info |
---|---|---|
size | uint32 | bits 1 << 31 and 1 << 30 are reserved for flags
see also File Entry -> size |
last write time | uint64 | see also FILETIME |
file name | dzstring |
BA2 LayoutEdit
Files within BA2s are unsorted.
File StructureEdit
Name | Type/Size | Info |
---|---|---|
header | Header | |
chunks | Chunk[file count] | |
file data | uint8[...] | |
strings | wstring[file count] |
HeaderEdit
Name | Type/Size | Info | ||||||
---|---|---|---|---|---|---|---|---|
magic | char[4] | "BTDX" | ||||||
version | uint32 | 1/2/3/7/8 | ||||||
contents format | char[4] | "GNRL" / "DX10" / "GNMF" | ||||||
file count | uint32 | |||||||
string table offset | uint64 | absolute offset, 0 if not present | ||||||
|
||||||||
|
ChunkEdit
Name | Type/Size | Info |
---|---|---|
header | Chunk Header | |
data | Chunk Data[chunk count] |
Chunk HeaderEdit
Name | Type/Size | Info | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
id | Hash | ||||||||||||||||||||||
data file index | uint8 | ||||||||||||||||||||||
chunk count | uint8 | ||||||||||||||||||||||
chunk header size | uint16 | GNRL: 0x10
DX10: 0x18 GNMF: 0x30 |
|||||||||||||||||||||
|
|||||||||||||||||||||||
|
Chunk DataEdit
Name | Type/Size | Info | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data file offset | uint64 | absolute offset | |||||||||
compressed size | uint32 | 0 if not compressed | |||||||||
decompressed size | uint32 | ||||||||||
|
|||||||||||
sentinel | uint32 | 0xBAADF00D |
HashEdit
Name | Type/Size | Info |
---|---|---|
file | uint32 | |
extension | uint32 | |
directory | uint32 |