Shadow The Hedgehog .ONE (PS2, GC, XBOX)

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
TGE
Posts: 38
Joined: Sat Dec 20, 2014 5:14 pm

Shadow The Hedgehog .ONE (PS2, GC, XBOX)

Post by TGE »

Code: Select all

#ShadowTheHedgehog_One.BMS
#Shadow The Hedgehog (PS2, GC, XBOX) .ONE
#Script by TGE

ComType prs

get ASIZE ASIZE 0

get ZERO long
get ONE_SIZE long
IDSTRING "\x37\x00\x02\x1C"
getdstring VER 12

get ZERO long
get FILE_COUNT long

math LAST_COUNT = FILE_COUNT
math LAST_COUNT -= 1

goto 0x90 0 SEEK_CUR

for i = 0 < FILE_COUNT
   if VER == "One Ver 0.60"
      getdstring FILE_NAME 44
   endif
   if VER == "One Ver 0.50"
      getdstring FILE_NAME 32
   endif
   get SIZE long
   get FILE_OFFSET long
   math FILE_OFFSET += 0xC
   get COMPRESS_FLAG long
   if VER == "One Ver 0.50"
      goto 0xC 0 SEEK_CUR
   endif
   savepos TMP
   
   if VER == "One Ver 0.60"
      goto 0x30 0 SEEK_CUR
   endif
   if VER == "One Ver 0.50"
      goto 0x24 0 SEEK_CUR
   endif
   
   if i != LAST_COUNT
      get NEXT_OFFSET long
      math NEXT_OFFSET += 0xC
      math CMPSIZE = NEXT_OFFSET
      math CMPSIZE -= FILE_OFFSET
   else
      math CMPSIZE = ASIZE
      math CMPSIZE -= FILE_OFFSET
   endif

   if COMPRESS_FLAG == 1
      clog FILE_NAME FILE_OFFSET CMPSIZE SIZE
   else
      log FILE_NAME FILE_OFFSET SIZE
   endif
   goto TMP
next i