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)
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)