fst.bin file structure

Discussion in 'Wii - Hacking' started by SleepyPrince, Mar 13, 2008.

Mar 13, 2008

fst.bin file structure by SleepyPrince at 6:11 AM (4,361 Views / 0 Likes) 4 replies

  1. SleepyPrince
    OP

    Member SleepyPrince GBAtemp Regular

    Joined:
    Aug 9, 2007
    Messages:
    173
    Country:
    Hong Kong
    As there isn't any documentation on fst.bin, I have written one for those who want to know.

    The fst.bin file is divided into 2 parts, 1st is file entries & 2nd is filenames

    file entries
    each file entry is a 0xC segment
    (00) (filename offset 3Bytes) (offset>>2 4Bytes) (filesize 4Bytes)
    (01) (dir name offset 3Bytes) (parent entry # 4Bytes) (folder end entry 4Bytes)

    1st byte
    indicate whether it is a file or a folder, 00 for files and 01 for folders

    2nd - 4th bytes
    offset of the file/dir name from the start of the filenames segment (the starting address is mentioned below)

    5th - 8th bytes
    for files:
    It is the same offset you can see in trucha signer, but divided by 4 (>>2)
    (I dont know how to calculate whether a file is on the 1st or 2nd layer as there are more offsets involved)

    for dirs:
    It is the entry # of the parent directory, the 1st (ROOT) entry is entry #0
    so all 1st level dirs has the value of 0 on this location

    9th - 12th bytes
    for files:
    It is simply the size of the file.

    for dirs:
    It is the entry # of the last entry under the directory (including sub dirs & sub dir files)

    ROOT entry
    the fst.bin starts with the ROOT entry, it is slightly different from other dir entries

    01 | 00 00 00 | 00 00 00 00 | (Total number of entries 4Bytes)

    as the ROOT entry does not have a name nor a parent entry
    it always has the structure above
    therefore the filenames starts from: Total number of entries * 0xC

    filenames
    The filenames of each entry ends with a 0x00

    paddings
    the fst.bin is padded with 0x00 to 4bytes multiple

    (the presentation could be much better if this forum support tables)
     
  2. stormyuan

    Newcomer stormyuan Advanced Member

    Joined:
    Jan 10, 2008
    Messages:
    57
    Country:
    Taiwan
    Great!
    Nice Work!

    Thx~
     
  3. abc99

    Newcomer abc99 Advanced Member

    Joined:
    Nov 25, 2006
    Messages:
    53
    Country:
  4. ProdigySim

    Member ProdigySim GBAtemp Regular

    Joined:
    Nov 23, 2005
    Messages:
    191
    Country:
    United States
    You should really add this to the wiibrew Wiki. People have done stuff like this for opening.bnr and _update.inf, too. Just make a new page for fst.bin with that information.
     
  5. Riicky

    Member Riicky GBAtemp Advanced Fan

    Joined:
    May 15, 2009
    Messages:
    607
    Location:
    Reading,Pennsylvania
    Country:
    United States
    Levitra spam on gbatemp.....[​IMG] now you can come here to soft-mod your wii or HARD mod your penis
     

Share This Page