fst.bin file structure

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

  1. SleepyPrince

    SleepyPrince GBAtemp Regular

    Aug 9, 2007
    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

    The filenames of each entry ends with a 0x00

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

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

    stormyuan Advanced Member

    Jan 10, 2008
    Nice Work!

  3. abc99

    abc99 Advanced Member

    Nov 25, 2006
  4. ProdigySim

    ProdigySim GBAtemp Regular

    Nov 23, 2005
    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

    Riicky GBAtemp Advanced Fan

    May 15, 2009
    United States
    Levitra spam on gbatemp.....[​IMG] now you can come here to soft-mod your wii or HARD mod your penis