-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy paththis_is_football_2002.bms
More file actions
128 lines (124 loc) · 4.05 KB
/
Copy paththis_is_football_2002.bms
File metadata and controls
128 lines (124 loc) · 4.05 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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# SCEE London Studio/Team Soho/SCEE - *.PAK files
getdstring pak_archive_sign 8
if pak_archive_sign == "SceeWhPC"
if pak_archive_sign == "SceeWhPk"
else
print " this script have never seen this kind of .PAK file before "
cleanexit
endif
getdstring pak_timestamp 20
get archive_info_size long
get total_files long
getdstring random_garbage 0x80
for t1 = 0 < 28
get file_name_offsets long
next t1
for t2 = 1 < 0x20
getdstring file_extension 4
putarray 1 t2 file_extension
next t2
goto 0x190
get directory_overall_entries long
get directory_overall_info_size long
if directory_overall_entries != 0 && directory_overall_info_size != 0
math current_i = 0
savepos directory_info_offset
xmath directory_entry_info_size "directory_overall_entries * 0x74"
xmath directory_overall_base_offset "directory_info_offset + directory_entry_info_size"
for directory = 0 < directory_overall_entries
math singular_directory_entries = 0
getdstring directory_extension 4
getdstring directory_name 0x60
get directory_entries_01 long
get directory_entries_02 long
get directory_entries_03 long
get directory_offset long
savepos directory_temp_position_01
math directory_offset + directory_overall_base_offset
goto directory_offset
if directory_entries_02 == 0 || directory_entries_02 == 1
if directory_entries_01 > directory_entries_03
math singular_directory_entries == directory_entries_01
elif directory_entries_01 < directory_entries_03
math singular_directory_entries == directory_entries_03
elif directory_entries_01 == directory_entries_03
math singular_directory_entries == directory_entries_03
endif
else
xmath singular_directory_entries "(directory_entries_03 - directory_entries_02) + 1"
endif
for i = 0 < singular_directory_entries
get file_size long
get file_offset long
if pak_archive_sign == "SceeWhPC"
get file_name_hash long
endif
if file_size != 0
math file_offset << 11
string file_name p "%s\%s.%s" directory_name i directory_extension
if file_size & 0xc0000000 # 0x40000000 and 0x80000000
savepos directory_temp_position_02
goto file_offset
get original_file_size long
goto directory_temp_position_02
math file_size & 0x3fffffff
string TMP_NAME2 p "%s[compressed_0x%08x]" file_name original_file_size
log TMP_NAME2 file_offset file_size
else
log file_name file_offset file_size
endif
math current_i + 1
endif
next i
goto directory_temp_position_01
next directory
xmath goto_info_offset "directory_overall_base_offset + directory_overall_info_size"
else
math goto_info_offset == 0x198
endif
goto goto_info_offset
set previous_file_name string ""
for i = current_i < total_files
get file_offset threebyte
get name_recycling_number byte
get name_size byte
get file_id short
get file_size long
if pak_archive_sign == "SceeWhPC"
get file_name_hash long
endif
math file_offset << 11
set individual_file_name string ""
xmath last_name_byte "name_size - 1"
for n = 0 < name_size
get string_char byte
if n = last_name_byte
math extension_number = string_char
endif
string string_char = string_char
string individual_file_name + string_char
next n
if name_recycling_number == 0
set previous_file_name string individual_file_name
strlen previous_name_size previous_file_name
set file_name string individual_file_name
endif
if name_recycling_number != 0
set incomplete_file_name string ""
for n2 = 0 < name_recycling_number
getvarchr string_char previous_file_name n2 byte
string string_char = string_char
string incomplete_file_name + string_char
next n2
string incomplete_file_name + individual_file_name
set file_name string incomplete_file_name
set previous_file_name string incomplete_file_name
endif
if extension_number <= 0x1f
getarray file_extension 1 extension_number
string file_name - 1
string file_name + "."
string file_name + file_extension
endif
log file_name file_offset file_size
next i