-
Notifications
You must be signed in to change notification settings - Fork 26
/
RARTemplate.bt
63 lines (56 loc) · 1.49 KB
/
RARTemplate.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
typedef enum<ushort> {
MHD_VOLUME = 0x0001,
MHD_COMMENT = 0x0002,
MHD_LOCK = 0x0004,
MHD_SOLID = 0x0008,
MHD_PACK_COMMENT = 0x0010,
MHD_AV = 0x0020,
MHD_PROTECT = 0x0040,
MHD_PASSWORD = 0x0080,
MHD_FIRSTVOLUME = 0x0100,
MHD_ENCRYPTVER = 0x0200,
} MHDFLAGS;
typedef enum<ushort> {
LHD_SPLIT_BEFORE = 0x0001,
LHD_SPLIT_AFTER = 0x0002,
LHD_PASSWORD = 0x0004,
LHD_COMMENT = 0x0008,
LHD_SOLID = 0x0010,
LHD_LARGE = 0x0100,
LHD_UNICODE = 0x0200,
LHD_SALT = 0x0400,
LHD_VERSION = 0x0800,
LHD_EXTTIME = 0x1000,
LHD_EXTFLAGS = 0x2000,
} LHDFLAGS;
typedef struct _VOLUMEHDR {
ushort header_crc;
uchar header_type;
ushort header_flags;
ushort header_size;
} VOLUMEHDR;
typedef struct _MAINHDR {
ushort HighPosAv;
uint PosAv;
} MAINHDR;
typedef struct _FILEHDR {
uint PackSize;
uint UnpSize;
uchar HostOS;
uint FileCRC;
uint FileTime;
uchar UnpVer;
uchar Method;
ushort NameSize;
uint FileAttr;
} FILEHDR;
typedef struct _PACKED {
uint PpmBlock : 1;
uint KeepTables : 1;
// A canonical huffman tree
// ...
} PACKED;
uchar signature[7];
VOLUMEHDR VolMainHeader;
VOLUMEHDR VolFileHeader;
FILEHDR FileHeader;