Skip to content

Instantly share code, notes, and snippets.

@num0005
Created October 30, 2019 22:56
Show Gist options
  • Save num0005/a50f99a182e044b2b201c969b90d21ec to your computer and use it in GitHub Desktop.
Save num0005/a50f99a182e044b2b201c969b90d21ec to your computer and use it in GitHub Desktop.
archive format used by Eurofighter Typhoon and possibly other games by DID
meta:
id: xfs_dat
file-extension: dat
endian: le
encoding: ASCII
seq:
- id: header
type: header
- id: sections
type: section
repeat: expr
repeat-expr: header.section_count
types:
header:
seq:
- id: magic
contents: ["DID DAT", 0x1A]
- id: checksum
type: u4
- id: section_count
type: u4
info:
seq:
- id: size # maybe, not sure
type: u4
- id: hash_table_size
type: u4
- id: value
size: 8
hash_table_entry:
seq:
- id: name_hash
type: u4
- id: offset
type: u4
instances:
contents:
pos: offset
type: data_section
hash_table:
seq:
- id: files
type: hash_table_entry
repeat: eos
extended_index:
seq:
- id: file_size
type: u4
- id: filename_size
type: u1
- id: filename
type: str
size: filename_size
data_section:
seq:
- id: size
type: u4
- id: compression
type: u4
- id: data
size: size
section:
seq:
- id: type
type: s4
enum: type
- id: offset
type: u4
enums:
type:
0: info
1: unknown
2: hash_index
3: data
4: extended_indexing
-1: nothing
instances:
contents:
pos: offset
type:
switch-on: type
cases:
'type::info': info
'type::extended_indexing': extended_index
'type::hash_index': hash_table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment