For reference I'm try to remove all instances of these:

Code: Select all
get NAME basename
get EXT extension
string NAME + "_cut."
string NAME + EXT
log NAME 0 0
append
get WRL_SIZE asize
for
savepos OFFSET
findloc NEXT_OFF binary "OBMGcGeneralStatic" 0 ""
if NEXT_OFF == ""
math NEXT_OFF = WRL_SIZE
endif
xmath SIZE "NEXT_OFF - OFFSET"
if SIZE != 0
log NAME OFFSET SIZE
endif
if NEXT_OFF == WRL_SIZE
break
endif
math NEXT_OFF + 0x100
goto NEXT_OFF
next
append
Code: Select all
set MOBILE_DATA binary "\x00\x00\x80\x3f\x44\xed\x36\x41\xff\xff\xef\x3f\x71\xf6\xf8\x3f"
get NAME basename
get EXT extension
string NAME + "_mobile."
string NAME + EXT
log NAME 0 0
get WRL_SIZE asize
append
for
savepos OFFSET
findloc NEXT_OFF binary "OBMGcGeneralStatic" 0 ""
if NEXT_OFF == ""
math NEXT_OFF = WRL_SIZE
endif
xmath SIZE "NEXT_OFF - OFFSET"
if SIZE != 0
log NAME OFFSET SIZE
endif
if NEXT_OFF == WRL_SIZE
break
endif
math TMP = NEXT_OFF
append # disable
log MEMORY_FILE TMP 0x80
append # re-enable
putdstring "OBMGcGeneralMobile" 18 MEMORY_FILE
goto 0x20 MEMORY_FILE
put 0xf0 byte MEMORY_FILE
goto 0x80 MEMORY_FILE
putdstring MOBILE_DATA 0x10 MEMORY_FILE
math TMP + 0x80
log MEMORY_FILE TMP 0x80
goto 0x110 MEMORY_FILE
put 0 long MEMORY_FILE
log NAME 0 0x114 MEMORY_FILE
math NEXT_OFF + 0x100
goto NEXT_OFF
next
append
Code: Select all
set MOBILE_CHECK binary "\xF0"
Code: Select all
goto 0x20 MEMORY_FILE
putdstring MOBILE_CHECK 0x1 MEMORY_FILE
Code: Select all
findloc NEXT_OFF binary "OBMGcGeneralStatic" 0 ""
....
math NEXT_OFF + 0x110
Code: Select all
findloc NEXT_OFF binary "OBMGcGeneralMobile" 0 ""
....
math NEXT_OFF + 0x114
Code: Select all
get NAME basename
get EXT extension
string NAME + "_cut."
string NAME + EXT
log NAME 0 0
append
get WRL_SIZE asize
for
savepos OFFSET
findloc NEXT_OFF binary "OBMGcGeneral" 0 ""
if NEXT_OFF == ""
math NEXT_OFF = WRL_SIZE
endif
xmath SIZE "NEXT_OFF - OFFSET"
if SIZE != 0
log NAME OFFSET SIZE
endif
if NEXT_OFF == WRL_SIZE
break
endif
goto NEXT_OFF
getdstring SKIP 12
getdstring CHECK 6
if CHECK == "Static"
math NEXT_OFF + 0x100
else # "Mobile"
math NEXT_OFF + 0x114
endif
goto NEXT_OFF
next
append
Code: Select all
get NAME basename
get EXT extension
string NAME + "_cut."
string NAME + EXT
log NAME 0 0
append
get WRL_SIZE asize
for
savepos OFFSET
findloc NEXT_OFF binary "OBMGc" 0 ""
if NEXT_OFF == ""
math NEXT_OFF = WRL_SIZE
endif
xmath SIZE "NEXT_OFF - OFFSET"
if SIZE != 0
getdstring TMP 18
if TMP == "OBMGcGeneralStatic"
log NAME OFFSET SIZE
endif
endif
if NEXT_OFF == WRL_SIZE
break
endif
math NEXT_OFF + 0x100
goto NEXT_OFF
next
append