-
Notifications
You must be signed in to change notification settings - Fork 11
/
mas.bms
97 lines (90 loc) · 2.59 KB
/
mas.bms
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
# ISI Gmotor engine MAS files (script 0.2a)
# works universally with any game included:
# ACTC, rFactor, ARCA, BMW M3, Sports Cart GT, NASCAR SimRacing/Thunder, F1 Challenge, SimRaceway and possibly others
# script for QuickBMS http://quickbms.aluigi.org
set MAS_TYPE0 binary "GMOTORMAS10\0\0\0\0\0"
set MAS_TYPE1 binary "\xC8\xCF\xD2\xD8\xCE\xD8\xE6\xC9\xCA\xDD\xD8\xBE\xBB\xA6\xBF\x90"
set MAS_TYPE3 binary "CUBEMAS4.10\0\0\0\0\0"
set SRW_TYPE binary "SRW0000"
set FILES_SIZE long 256
getdstring SIGN 16
if SIGN == MAS_TYPE0
set MAS_TYPE long 0
elif SIGN == MAS_TYPE1
set MAS_TYPE long 1
get DUMMY long
elif SIGN == MAS_TYPE3
set MAS_TYPE long 3
else
goto 0
getdstring SIGN 7
if SIGN == SRW_TYPE
print "use my simraceway.bms script on this archive\nthen use mas.bms on the obtained decrypted output file"
cleanexit
endif
goto 0
getdstring SIGN 3
if SIGN == "IFD"
get MAS_TYPE long # ??? (tested with 1 only)
get DUMMY long
else
set MAS_TYPE long 2
set FILES_SIZE long 0x20
goto 0
endif
endif
print "set MAS_TYPE %MAS_TYPE%"
get FILES long
get DATA_SIZE long
math ZSIZE = 0
if SIGN == "IFD"
get ZSIZE long
endif
savepos OFFSET
math BASE_OFF = FILES
math BASE_OFF *= FILES_SIZE
if ZSIZE == 0
log MEMORY_FILE OFFSET BASE_OFF
else
clog MEMORY_FILE OFFSET ZSIZE BASE_OFF
math BASE_OFF = ZSIZE
endif
math BASE_OFF += OFFSET
for i = 0 < FILES
if MAS_TYPE == 0
get DUMMY long MEMORY_FILE
get OFFSET long MEMORY_FILE
get SIZE long MEMORY_FILE
get ZSIZE long MEMORY_FILE
getdstring NAME 240 MEMORY_FILE
elif MAS_TYPE == 1
get DUMMY long MEMORY_FILE
getdstring NAME 236 MEMORY_FILE
get OFFSET long MEMORY_FILE
get SIZE long MEMORY_FILE
get ZSIZE long MEMORY_FILE
get DUMMY long MEMORY_FILE
elif MAS_TYPE == 2
getdstring NAME 0x10 MEMORY_FILE
get OFFSET long MEMORY_FILE
get SIZE long MEMORY_FILE
get ZSIZE long MEMORY_FILE
get DUMMY long MEMORY_FILE
elif MAS_TYPE == 3
get DUMMY long MEMORY_FILE
get OFFSET long MEMORY_FILE
get SIZE long MEMORY_FILE
get ZSIZE long MEMORY_FILE
get DUMMY long MEMORY_FILE
getdstring NAME 236 MEMORY_FILE
endif
math OFFSET += BASE_OFF
if ZSIZE == 0
math ZSIZE = SIZE
endif
if SIZE == ZSIZE
log NAME OFFSET SIZE
else
clog NAME OFFSET ZSIZE SIZE
endif
next i