ZenHAX

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

All times are UTC




Post new topic  Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Wed Jun 02, 2021 9:44 am 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
hi, my english not good, so please Be patient, thanks.
I localize lego batman 1, i translated txt file to chinese. find the font file, and i Understand the file structure.
but if i change the font size, This game won't start, if i just overwrite this font file hex and don't change file size, this game work and displays chinese.
so i think The problem lies in game exe file.It limits the font file size.(if i delete some hex change font file size, the game not work)
But I don’t know anything about EXE file. if you Know how to solve it,please tell me.
thanks.

this is game exe file and font file
https://drive.google.com/file/d/1TeXHUKMJajeAknQkGPbxqiSRWe9oCXAP/view?usp=sharing


Last edited by aoto on Sat Jun 05, 2021 7:46 pm, edited 1 time in total.

Top
   
PostPosted: Thu Jun 03, 2021 3:08 am 

Joined: Mon Mar 09, 2020 3:14 pm
Posts: 22
There're 2 offset at 0x0 (size file - 68) and 0xC44 (size dds - 68).
I'm not sure if you've edited this.


Top
   
PostPosted: Thu Jun 03, 2021 2:33 pm 
User avatar

Joined: Thu Aug 11, 2016 6:52 pm
Posts: 34
0x00 - size without footer (-68 bytes)
0x08 - size of table
0x1C (or 0x20) - number of entries?
0x48 - size of first table?
0xC44 - size of dds without footer (-68 bytes)


Top
   
PostPosted: Fri Jun 04, 2021 12:42 pm 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
Zmkiy wrote:
There're 2 offset at 0x0 (size file - 68) and 0xC44 (size dds - 68).
I'm not sure if you've edited this.


OMG!I always thought it was fileHead And ignore it.
but i Checked other files. this is real file size flag!
I don't know if the change will work, but this information really escaped my attention!
thank you!!!(I don't know how to say thank you in English,so thankkkkkkkkkk you!!!!!)


Top
   
PostPosted: Fri Jun 04, 2021 12:46 pm 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
LinkOFF wrote:
0x00 - size without footer (-68 bytes)
0x08 - size of table
0x1C (or 0x20) - number of entries?
0x48 - size of first table?
0xC44 - size of dds without footer (-68 bytes)


thank you!This problem should be right in the 0x00.I thought this was the file header and ignored it.
0x08 - Except for the size after DDS
0x1C - Number of characters included DDS
0x20 - characters mapping
0x48 - size of Number of characters included DDS


Top
   
PostPosted: Sat Jun 05, 2021 5:12 am 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
Code:
//------------------------------------------------
//--- 010 Editor v11.0.1 Binary Template
//
//      File: LegoBatman1_font.bt
//   Authors: aoto
//   Version: 1.0
//   Purpose: Parse FNT font files
//  Category: FNT
// File Mask: *.FNT
//  ID Bytes:
//   History:
//      1.0 2021-6-4    aoto: Initial release.
//------------------------------------------------
struct FNT {
    LittleEndian();
    DWORD fileSize;
    DWORD offsetTag;
    DWORD offsetFnt1;    // exclude DDS size,but include DDS msg.
    BYTE flags1[8];    // aways zero.
    DWORD dwVersion;
    DWORD offsetFnt2;    // exclude DDS && DDS msg size.
    DWORD dwNumChars;
    DWORD dwNumUnicodeTables;
    float height;   // height of char.
    float baseLine;
    float spaceWidth;   // 'space' key width
    BYTE flags2[20];    // aways zero.

    struct CharsMappingArray {
        DWORD offsetCharsMappingArrayHead;
        DWORD offsetCharsMappingArraySize;
        BYTE flags3[20];    //aways zero.
        local int i;
       for(i = 0; i < dwNumChars; i++) {
          float charX;
          float charY;
          float charWidth;
       }
    } charsMappingArray;
   
    struct UnicodeTablesArray {
        local int j;
        for(j = 0; j < dwNumUnicodeTables; j++){
            WORD wUnicodeChar;  // unicode char number
            WORD wFontMappingIndex; // Index of the char mapping from the image (except 'space' that uses the spaceWidth)
        }
    } unicodeTablesArray;

    BYTE flags4[24];    // aways zero.
   
    struct DDS {
        DWORD DDS_height;
        DWORD DDS_width;
        BYTE flags5[36];    // aways zero.
        DWORD DDS_PIXELFORMAT_flags;
        BYTE flags6[8];
        DWORD unknowNum1;   //is 6
        BYTE flags7[4];
        DWORD DDS_mipMapCount;
        DWORD DDS_size;
        BYTE flags8[8];
        DWORD unknowNum2;    //is 3
        DWORD unknowNum3;    //is 1
        BYTE flags9[40];
        BYTE DDS_file[DDS_size];
    } dds;
   
    struct UnknowBlock {
        DWORD offsetUnknow;
        local int i;
        for(i = 0; i < (offsetUnknow / 4 - 1); i++){
            WORD Unknow1;
            WORD Unknow2;
        }
    } unkonwBlock;

} fnt;


this is i edit 010editor template for this game font file.
i insert one glyph.
insert 0x8F4 12bytes.
insert 0xBE4 4bytes.
change 0x00(file size - 68 bytes) + 16 bytes.
change 0x08 + 16 bytes.
change 0x18 + 16 bytes.
change 0x48 + 12 bytes.
DDS just export write and import it(file size not change).
can't open game.

if i just write and not insert(font file size not change), game work and show glyph change.
Could it be related to the footer?
thanks!


Top
   
PostPosted: Sat Jun 05, 2021 8:37 am 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
i found lego star wars font file.
I put this file directly into batman folder, the game is open!
I compared the two files and tried to modify without changing the size,I found that the most likely problem is the footer.

I found that just keeping the 32BYTES footer game can run normally.
batman font file footer is 0x6270
Quote:
10 00 00 00 90 9D FA FF 90 9D FA FF BC 9D FA FF
BC 9D FA FF BC 9D FA FF BC 9D FA FF BC 9D FA FF
BC 9D FA FF BC 9D FA FF BC 9D FA FF BC 9D FA FF
7C A9 FA FF 84 A9 FA FF 88 A9 FA FF 90 A9 FA FF
9C A9 FA FF

starwars font file footer is 0x1000
Quote:
0B 00 00 00 00 F0 EF FF 00 F0 EF FF 2C F0 EF FF
2C F0 EF FF 2C F0 EF FF 2C F0 EF FF 2C F0 EF FF
2C F0 EF FF 2C F0 EF FF 2C F0 EF FF 2C F0 EF FF

I can't see what information this represents, please help me. thanks!


Top
   
PostPosted: Sat Jun 05, 2021 7:50 pm 

Joined: Tue May 25, 2021 2:54 am
Posts: 6
this footer 0x00 > 7
0x04,0x08 => Binary => (1 <-> 0) = fileSize(fileHeader) - 1bytes
0x0C,0x10,0x14,0x18,0x1C => Binary => (1 <-> 0) = fileSize(fileHeader) - 45bytes
The rest can be deleted.
Thanks to the people who helped me.it's work!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 8 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