forked from kaitai-io/kaitai_struct_formats
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfallout2_dat.ksy
70 lines (70 loc) · 1.35 KB
/
fallout2_dat.ksy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
meta:
id: fallout2_dat
application: Fallout 2
file-extension: dat
xref:
wikidata: Q32097899
license: CC0-1.0
endian: le
types:
pstr:
seq:
- id: size
type: u4
- id: str
type: str
size: size
encoding: ASCII
footer:
seq:
- id: index_size
type: u4
- id: file_size
type: u4
index:
seq:
- id: file_count
type: u4
- id: files
type: file
repeat: expr
repeat-expr: file_count
file:
seq:
- id: name
type: pstr
- id: flags
type: u1
enum: compression
- id: size_unpacked
type: u4
- id: size_packed
type: u4
- id: offset
type: u4
instances:
contents_raw:
io: _root._io
pos: offset
size: size_unpacked
if: flags == compression::none
contents_zlib:
io: _root._io
pos: offset
size: size_packed
process: zlib
if: flags == compression::zlib
contents:
value: 'flags == compression::zlib ? contents_zlib : contents_raw'
if: flags == compression::zlib or flags == compression::none
instances:
footer:
pos: _io.size - 8
type: footer
index:
pos: _io.size - 8 - footer.index_size
type: index
enums:
compression:
0: none
1: zlib