-
Notifications
You must be signed in to change notification settings - Fork 3
/
Footer.bt
42 lines (38 loc) · 920 Bytes
/
Footer.bt
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
#ifndef _FOOTER
#define _FOOTER
struct AssetInfo
{
GUID id;
CompressionType compressionType;
byte pad[3] <hidden=true>;
uint64 origOffset <format=hex>;
};
typedef struct(FourCC type)
{
ChunkDescriptor chunk;
local uint64 start <format=hex, hidden=true> = FTell();
switch (chunk.id)
{
case "AINF":
AssetInfo info;
break;
case "META":
Meta meta(type, chunk.size, 0);
break;
case "NAME":
char name[chunk.size];
break;
}
FSeek(start + chunk.size);
} FooterChunk <name=(Str("%s chunk", chunk.id))>;
typedef struct(FourCC type)
{
FormDescriptor form;
local uint64 start <format=hex, hidden=true> = FTell();
while (FTell() < start + form.size)
{
FooterChunk chunk(type);
}
FSeek(start + form.size);
} Footer <name="Extracted file info">;
#endif// _FOOTER