Asphalt Urban GT 2 (PSP) - edit.mfd

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
AlphaTwentyThree
Posts: 909
Joined: Sat Aug 09, 2014 11:21 am

Asphalt Urban GT 2 (PSP) - edit.mfd

Post by AlphaTwentyThree »

Hi there!
Easy format but somehow I can't figure out the data inside the TOC. Can somebody tell me what the fields represent? First long is number of files, then the variables have lengths of 4,2,4,4 - the short variable supposedly a type ID.
Here are the first 5MB: https://www.mediafire.com/file/n3ne3uu0 ... t2.7z/file (file has total size of 0x30431c8e).
A crude script is all I need, I'll enhance it with heuristics afterwards. Just looking for something that gives me correct offset/size pairs...
Thanks for your help!
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Asphalt Urban GT 2 (PSP) - edit.mfd

Post by h3x3r »

Almost got bored but figured it out. But strangely unpacked files have 460 MB instead of ~700 MB. No idea, maybe another TOC somewhere.

EDiT: Fixed thanks to DKDave!

Code: Select all

####################################
get FILENAME basename
get FILES long
savepos TABLE_STARTOFF
getdstring FILES_TMP FILES*14
get TABLECOUNT long
savepos TABLE_ENDOFF
getdstring SKIPTABLE TABLECOUNT*4
savepos DATA_OFF

goto TABLE_STARTOFF
for i = 0 < FILES
   get FILEID long
   get TABLENUM short
   get OFFSET long
   get SIZE long
   savepos TMP
   string NAME p= "%s/%u.dat" FILENAME OFFSET
   if TABLENUM == 1
      log NAME OFFSET SIZE
   else
      goto TABLE_ENDOFF
      getdstring TEMP OFFSET*4
      for x = 0 < TABLENUM
         get TMP_OFFSET long
         string NAME p= "%s/%u.dat" FILENAME TMP_OFFSET
         log NAME TMP_OFFSET SIZE
      next x
   endif
   goto TMP
next i
Last edited by h3x3r on Thu Jun 23, 2022 9:06 am, edited 1 time in total.
DKDave
Posts: 136
Joined: Mon Nov 23, 2020 6:01 pm

Re: Asphalt Urban GT 2 (PSP) - edit.mfd

Post by DKDave »

Just to add to the above:

If your "TABLENUM" value = 1, then OFFSET and SIZE are just that for 1 file within the archive.

If "TABLENUM" > 1, then OFFSET is a start index into TABLE 2 (which is just file offsets preceded by a count value for the whole table) and TABLENUM is the number of file offsets to read. SIZE is then the size of every file in this entry, e.g. the first entry has 0xf4 files at index 0, all of size 0xe6

And that should give you full coverage of the archive (approx. 771 MB), and you should have 43797 files in total.
h3x3r
Posts: 165
Joined: Wed Jun 01, 2016 5:53 pm

Re: Asphalt Urban GT 2 (PSP) - edit.mfd

Post by h3x3r »

Image
Thanks for hints Dave! It is as you said. Now it unpacks all.