-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathfrequency_ark.bms
More file actions
78 lines (72 loc) · 1.6 KB
/
frequency_ark.bms
File metadata and controls
78 lines (72 loc) · 1.6 KB
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
71
72
73
74
75
76
77
78
# Frequency - *.ARK
open FDDE "ark" 0
comtype gzip
get sig long
if sig != 0x004b5241
cleanexit
endif
get version long
get dirOffset long
get numFiles long
get relPathOffset long
get numPaths long
get stringTabOffset long
get numStrings long
get sizeHdrAndDir long
get sectorSize long
goto 0x40
get path string
goto dirOffset
for i1 = 0 < numFiles
get a01 long
putarray 1 i1 a01
get a02 long
putarray 2 i1 a02
get a03 short
putarray 3 i1 a03
get a04 short
putarray 4 i1 a04
get a05 long
putarray 5 i1 a05
get a06 long
putarray 6 i1 a06
get a07 long
putarray 7 i1 a07
next i1
goto relPathOffset
for i2 = 0 < numPaths
get b01 long
putarray 8 i2 b01
get b02 long
putarray 9 i2 b02
next i2
goto stringTabOffset
for i3 = 0 < numStrings
get c0 string
putarray 10 i3 c01
next i3
for z = 0 < numFiles
set file_name string ""
getarray nameHash 1 z
getarray nameOffset 2 z
goto nameOffset
get name string
getarray relPathIndex 3 z
getarray pathHash 8 relPathIndex
getarray pathOffset 9 relPathIndex
goto pathOffset
get path string
getarray sectorOffset 4 z
getarray sector 5 z
xmath file_offset "(sector << 11) + sectorOffset"
getarray length_if_normal_file 6 z
getarray length_if_gzip_file 7 z
string file_name p "%s/%s" path name
if length_if_normal_file == length_if_gzip_file
log file_name file_offset length_if_normal_file
else
set file_name_without_the_gz string file_name
string file_name_without_the_gz > ".gz"
clog file_name_without_the_gz file_offset length_if_normal_file length_if_gzip_file
endif
next z