ZenHAX

Free Game Research Forum | Official QuickBMS support | twitter @zenhax | SSL HTTPS://zenhax.com
It is currently Wed Jun 23, 2021 9:48 am

All times are UTC




Post new topic  Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon May 24, 2021 2:52 am 
User avatar

Joined: Fri Apr 20, 2018 12:41 am
Posts: 800
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:
//------------------------------------------------
//--- 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;


Attachments:
File comment: Android Classic
FN_Classic_Android_StringTables.zip [739.53 KiB]
Downloaded 30 times
File comment: STR files from the XMAS DLC for X360
FNK_STR_XMASDLC.zip [4.03 KiB]
Downloaded 27 times

_________________
Hacking Angry Birds since 2016


Last edited by LolHacksRule on Tue May 25, 2021 10:00 pm, edited 1 time in total.
Top
   
PostPosted: Tue May 25, 2021 5:37 pm 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 41
Code:
//------------------------------------------------
//--- 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.

Top
   
PostPosted: Tue May 25, 2021 10:00 pm 
User avatar

Joined: Fri Apr 20, 2018 12:41 am
Posts: 800
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.

_________________
Hacking Angry Birds since 2016


Top
   
PostPosted: Wed May 26, 2021 8:27 am 

Joined: Sun Nov 08, 2020 1:07 pm
Posts: 41
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


Top
   
PostPosted: Wed May 26, 2021 4:33 pm 
User avatar

Joined: Fri Apr 20, 2018 12:41 am
Posts: 800
Yeah this is the most advanced localization file I've seen so far with the way it uses most binary values. I understand.

_________________
Hacking Angry Birds since 2016


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 5 posts ] 

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Limited