Final Fantasy 5 (iOS) .bin

Extraction and unpacking of game archives and compression, encryption, obfuscation, decoding of unknown files
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Final Fantasy 5 (iOS) .bin

Post by puggsoy »

This was challenging but fun :) It requires the data0.bin file to be in the same directory as the files you're extracting (since that's the index file).

Code: Select all

# Final Fantasy 5 (iOS) .bin format
#
# Written by puggsoy
# script for QuickBMS http://quickbms.aluigi.org

open FDSE "data0.bin" 1

idstring FFDL
idstring 1 FFDL

get FILENUM basename
string FILENUM | data

goto 8 1
get NAMESPOS long 1

goto 0x14 1
savepos POS 1

for POS = POS < NAMESPOS
   get NAMEOFF long 1
   math NAMEOFF += NAMESPOS
   get SIZE long 1
   get SIZE2 long 1
   get NUM long 1
   get OFFSET long 1
   get DUMMY long 1
   
   if NUM == FILENUM
      savepos TEMP 1
      goto NAMEOFF 1
      get NMSZ byte 1
      getdstring NAME NMSZ 1
      goto TEMP 1
      
      goto OFFSET
      getdstring TYPE 3
      
      if TYPE == "INP"
         math OFFSET += 4
         math SIZE -= 4
      elif TYPE == "ICP"
         string NAME += ".icp"
      endif
      
      log NAME OFFSET SIZE
   endif
   
   savepos POS 1
next

I'm planning to make a converter for .icp files soon (they're PNGs that need to be manipulated in a certain way).
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Final Fantasy 5 (iOS) .bin

Post by hackspeedok »

Thanks. Reimport supported, puggsoy?
hackspeedok
Posts: 404
Joined: Mon Oct 06, 2014 6:41 pm

Re: Final Fantasy 5 (iOS) .bin

Post by hackspeedok »

And if you use ios, can you help me with this viewtopic.php?f=9&t=710
Series game of Kairosoft are interested
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Final Fantasy 5 (iOS) .bin

Post by puggsoy »

I don't do reimporting, but from what I know this script doesn't support it, sorry.

As for the Ninja Village file, mobile games (iOS, Android, etc) are similar to PC in the fact that they often have custom formats, so extracting from one game can be much different than extraction from another. For the specific case of that Ninja Village file, I don't know how to decompress or decrypt it. I will try using QuickBMS to check all compression types but if that doesn't work then I can't help you.

EDIT: Oh by the way, apparently this script works for Final Fantasy Dimensions too, I think it uses the same file types.
aluigi
Site Admin
Posts: 12984
Joined: Wed Jul 30, 2014 9:32 pm

Re: Final Fantasy 5 (iOS) .bin

Post by aluigi »

As far as I can see the script supports reimporting because there are no strange compressions and no memory files used for the files extraction.
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Final Fantasy 5 (iOS) .bin

Post by puggsoy »

Oh OK then, awesome. As I said I don't do reimporting so I wasn't sure, good to know it does :)
puggsoy
Posts: 161
Joined: Sat Dec 13, 2014 1:01 am

Re: Final Fantasy 5 (iOS) .bin

Post by puggsoy »

icp2png

Code: Select all

Usage: icp2png inFile outDir
    inFile: The .icp file to convert. Can alternatively be a folder containing the files to convert
    outDir: The folder to save the converted files to

For converting the .icp files. Again, this should work with FF Dimensions as well.

EDIT: Sorry, apparently it doesn't work yet. I'll try figure out what's wrong soon.

EDIT2: OK it works now, same link.