HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

How to translate the files of a game
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

Post by LolHacksRule »

I'm currently datamining Halfbrick's games, I found the in-game text, but it's embedded in a STR file, being a String Table. I tried to document the format. Anyone want to finish off the template or make a script to extract the strings?

Code: Select all

//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
//      File: Halfbrick Studios Fruit Ninja/Mortar Engine String Table File
//      Authors: LolHacksRule
//      Version: 1
//      Purpose: Gets data out of the binary.
//      Category: Deserializing
//      File Mask:
//      ID Bytes:
//      History:
//------------------------------------------------

BigEndian();

struct StringTableFileBin {
    struct StringTableFileHeader {
        int    StringTableVersion;
        char   unk[64]; //Hash?
    } tableFileHdr<bgcolor=cGreen>;

    struct StringDataTable {
       
        long    strTBLChunkSize;
        //if (tableFileHdr.StringTableVersion == 3)
            //long    strTBLUnk;
        //long    strTBLStringListSize;

        //long      unknown;
        //long      unknown2;

        struct StringParamTable {
            long    strSize;
        } stringParams;

        struct StringTableStringList {
            string textString[stringParams];
        } StringDataStringsList[3]<bgcolor=cGreen>;
    } StringTableDataContent;
} StringTableContent;
Last edited by LolHacksRule on Tue May 25, 2021 10:00 pm, edited 1 time in total.
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

Post by gameside »

Code: Select all

//------------------------------------------------
//--- 010 Editor v10.0.2 Binary Template
//
//      File: HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)
//      Authors: GameSide
//      Version: 0.1
//      Purpose: for learning game stringTable format
//      Category: modding
//      File Mask:
//      ID Bytes:
//      History:
//------------------------------------------------
local int i <hidden=true> = 0;


struct Header {
    int version;
    byte unknown[64]; // looks like string Ids to me
    int32 strTableChunkSize;
    FSkip(4); //Skip zero
    int32 strTableSize;
};

struct Gstr(int32 size) {
    char str[size];
};

struct TableInfo {
    int32 offset;
    int32 size1;
    int32 size2;
};

Header header;

FSeek(80+header.strTableSize);
int32 ICount;
TableInfo unData[ICount] <optimize=true, name="StringTableInfo">;

for( i = 0; i < ICount; i++ )
{
    FSeek(unData[i].offset+80);
    Gstr gstring((unData[i].size1 == unData[i].size2) ? unData[i].size1 : unData[i].size2) <name="String">;
}



here is a template I created for all str file inside of FN_Classic_Android_StringTables.zip
about other file, I don't have time to check it now, maybe later...
Last edited by gameside on Thu May 27, 2021 11:13 am, edited 1 time in total.
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

Post by LolHacksRule »

Thank you so much. I was looking for a QuickBMS script as well if possible but this template could probably give me an idea on how to make one.
gameside
Posts: 66
Joined: Sun Nov 08, 2020 1:07 pm

Re: HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

Post by gameside »

LolHacksRule wrote:Thank you so much. I was looking for a QuickBMS script as well if possible but this template could probably give me an idea on how to make one.

QuickBms is a little hard to work with for this file, at least you can't import string back to file with reimport mode
So you need to create 2 script, one for export string from file, and one to import back based of infotable
LolHacksRule
Posts: 865
Joined: Fri Apr 20, 2018 12:41 am

Re: HalfBrick Studios Fruit Ninja/Mortar Engine *.STR (String Table)

Post by LolHacksRule »

Yeah this is the most advanced localization file I've seen so far with the way it uses most binary values. I understand.