-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathCDNIndex.bt
50 lines (46 loc) · 885 Bytes
/
CDNIndex.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
//------------------------------------------------
//--- 010 Editor v7.0 Binary Template
//
// File:
// Authors:
// Version:
// Purpose:
// Category:
// File Mask:
// ID Bytes:
// History:
//------------------------------------------------
struct Record
{
byte Hash[16];
BigEndian();
int Offset;
int Size;
LittleEndian();
};
struct Index
{
local int recCount = 0;
FSeek(FileSize() - 12);
recCount = ReadInt();
FSeek(0);
local byte hash;
local int skip = 1;
local int i = 0;
while (recCount > 0)
{
skip = 1;
for (i = 0; i < 16; ++i)
if (ReadByte(FTell() + i) != 0)
skip = 0;
if (skip == 1)
{
FSeek((FTell() / 4096) * 4096);
}
else
{
Record rec;
recCount -= 1;
}
}
} Idx;