Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

[SOLVED] lego batman 1 localization problem

Featured Replies

  • Author
  • Localization

aoto, posted Wed Jun 02, 2021 9:44 am (64433)


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
  • Author
  • Localization

Zmkiy, posted Thu Jun 03, 2021 3:08 am (64452)


There're 2 offset at 0x0 (size file - 68) and 0xC44 (size dds - 68).
I'm not sure if you've edited this.
  • Author
  • Localization

LinkOFF, posted Thu Jun 03, 2021 2:33 pm (64456)


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)
  • Author
  • Localization

aoto, posted Fri Jun 04, 2021 12:42 pm (64487)


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!!!!!)
  • Author
  • Localization

aoto, posted Fri Jun 04, 2021 12:46 pm (64488)


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
  • Author
  • Localization

aoto, posted Sat Jun 05, 2021 5:12 am (64502)


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!
  • Author
  • Localization

aoto, posted Sat Jun 05, 2021 8:37 am (64508)


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!
  • Author
  • Localization

aoto, posted Sat Jun 05, 2021 7:50 pm (64532)


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!
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.