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.

How to extract Worms W.M.D Language file (bin...etc)

Featured Replies

  • Author
  • Localization

monako, posted Fri Jul 26, 2019 10:14 pm (50029)


Hi guys.
I'd like to decompress the language file and change it to my native language.
So I looked in DataPC\Language folder, I found these files.
AllTextEng.bin and AllTextEng64.bin file.

How do I decompress these files?
and How can I compress it?
  • Author
  • Localization

LokiReborn, posted Sun Jul 28, 2019 1:58 pm (50053)


monako wrote:
Hi guys.
I'd like to decompress the language file and change it to my native language.
So I looked in DataPC\Language folder, I found these files.
AllTextEng.bin and AllTextEng64.bin file.

How do I decompress these files?
and How can I compress it?


Looking at the 32-bit one quickly the format is pretty simple. The layout is
Long (Value is always 1)
Long (File Length)
Long (Record Count)
Long (Size of Entry?)
-- Start Entry Blocks
-- String Data null terminated

For the Entry block
Long ID
Long Offset

This is an example to do the extract with C#, there are around 3.2k entries however only 2.7k unique entries. You'll need to decide how you want to manage all of the text and work with it.

Code:
        private void extractBtn_Click(object sender, EventArgs e)
        {
            OpenFileDialog OD = new OpenFileDialog();
            if(OD.ShowDialog() == DialogResult.OK)
            {
                byte[] fileIn = File.ReadAllBytes(OD.FileName);
                MemoryStream ms = new MemoryStream(fileIn);
                BinaryReader br = new BinaryReader(ms);
                List entries = new List();
                List output = new List();

                br.ReadInt32(); // Version 1?
                br.ReadInt32(); //File length
                int count = br.ReadInt32();
                int blockSize = br.ReadInt32();

                for (int i = 0; i < count; i )
                {
                    entries.Add(new Entry(br.ReadUInt32(), br.ReadInt32()));
                }

                foreach(Entry en in entries)
                {
                    br.BaseStream.Position = en.offset 8;
                    output.Add(String.Format("{0}\t{1}",en.id, getString(br)));
                }

                File.WriteAllLines(OD.FileName ".txt", output);
                MessageBox.Show("Done.");
            }
        }

        private string getString(BinaryReader br)
        {
            MemoryStream ms = new MemoryStream();

            byte b = 0xFF;
            while (b != 0)
            {
                b = br.ReadByte();

                if (b != 0)
                    ms.WriteByte(b);
            }

            return Encoding.UTF8.GetString(ms.ToArray());
        }

        class Entry
        {
            public uint id;
            public int offset;

            public Entry(uint id, int offset)
            {
                this.id = id;
                this.offset = offset;
            }
        }
  • Author
  • Localization

monako, posted Tue Aug 27, 2019 12:46 am (50451)


LokiReborn wrote:
monako wrote:
Hi guys.
I'd like to decompress the language file and change it to my native language.
So I looked in DataPC\Language folder, I found these files.
AllTextEng.bin and AllTextEng64.bin file.

How do I decompress these files?
and How can I compress it?


Looking at the 32-bit one quickly the format is pretty simple. The layout is
Long (Value is always 1)
Long (File Length)
Long (Record Count)
Long (Size of Entry?)
-- Start Entry Blocks
-- String Data null terminated

For the Entry block
Long ID
Long Offset

This is an example to do the extract with C#, there are around 3.2k entries however only 2.7k unique entries. You'll need to decide how you want to manage all of the text and work with it.

Code:
        private void extractBtn_Click(object sender, EventArgs e)
        {
            OpenFileDialog OD = new OpenFileDialog();
            if(OD.ShowDialog() == DialogResult.OK)
            {
                byte[] fileIn = File.ReadAllBytes(OD.FileName);
                MemoryStream ms = new MemoryStream(fileIn);
                BinaryReader br = new BinaryReader(ms);
                List entries = new List();
                List output = new List();

                br.ReadInt32(); // Version 1?
                br.ReadInt32(); //File length
                int count = br.ReadInt32();
                int blockSize = br.ReadInt32();

                for (int i = 0; i                 {
                    entries.Add(new Entry(br.ReadUInt32(), br.ReadInt32()));
                }

                foreach(Entry en in entries)
                {
                    br.BaseStream.Position = en.offset 8;
                    output.Add(String.Format("{0}\t{1}",en.id, getString(br)));
                }

                File.WriteAllLines(OD.FileName ".txt", output);
                MessageBox.Show("Done.");
            }
        }

        private string getString(BinaryReader br)
        {
            MemoryStream ms = new MemoryStream();

            byte b = 0xFF;
            while (b != 0)
            {
                b = br.ReadByte();

                if (b != 0)
                    ms.WriteByte(b);
            }

            return Encoding.UTF8.GetString(ms.ToArray());
        }

        class Entry
        {
            public uint id;
            public int offset;

            public Entry(uint id, int offset)
            {
                this.id = id;
                this.offset = offset;
            }
        }

Thank you for your reply. But I'm not a programmer.
so I can't use c# programming.
Can you make me an extractor and input tool? :o
  • Author
  • Localization

krdrt5367, posted Mon Sep 16, 2019 4:05 pm (50752)


Please can download the .exe application with the file. :(
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.