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.

GuJian 3 to ITA

Featured Replies

  • Author
  • Localization

Hexaae, posted Sun Feb 02, 2020 4:05 pm (53677)


I'd like to translate the chinese game GuJian3, and I've found the "new_sword_legends.bms" for it...
Trying it on the idx game file I get this error:

Code:
- open input file D:\Steam\steamapps\common\Gujian3\data\_index\303.idx
- open script bms\new_sword_legends.bms
- set output folder GuJian3\

  offset           filesize   filename
--------------------------------------

Error: the compressed LZMA input is wrong or incomplete (0)
Info:  algorithm   16
       offset      000000000000006c
       input size  0x00000000000239c8 145864
       output size 0x0000000000080000 524288
       result      0xffffffffffffff9c -100

Error: the uncompressed data (-100) is bigger than the allocated buffer (524288)

Last script line before the error or that produced the error:
  48  clog MEMORY_FILE OFFSET CHUNK_ZSIZE CHUNK_SIZE
  • Author
  • Localization

SaraKale, posted Wed Mar 11, 2020 10:45 am (54565)


I also encountered the same problem, did you solve it?
  • Author
  • Localization

Hexaae, posted Wed Mar 11, 2020 11:31 am (54566)


Unfortunately no... still waiting for help :(
  • Author
  • Localization

SaraKale, posted Wed Mar 11, 2020 1:33 pm (54568)


Don't be sad! Try contacting Aluigi? I don't know how to contact Aluigi :(
  • Author
  • Localization

Shokoniraya, posted Thu Mar 12, 2020 5:11 am (54578)


SaraKale wrote:
Don't be sad! Try contacting Aluigi? I don't know how to contact Aluigi :(

according to error, it has problem in compression type, no one can help without a sample file
  • Author
  • Localization

SaraKale, posted Thu Mar 12, 2020 3:39 pm (54582)


Shokoniraya wrote:
SaraKale wrote:
Don't be sad! Try contacting Aluigi? I don't know how to contact Aluigi :(

according to error, it has problem in compression type, no one can help without a sample file


303.idx file has been uploaded, you can click the link to download, Thank you very much!
https://mega.nz/#F!l0o3SBSC!uF3vm1TSgoJwK5gidu71gw
  • Author
  • Localization

haibaer, posted Fri Mar 20, 2020 1:54 pm (54811)


Maybe I can help if you guys haven't found any solution. I'll update a new script as soon as possible.
  • Author
  • Localization

SaraKale, posted Tue Mar 31, 2020 1:51 pm (55416)


haibaer wrote:
Maybe I can help if you guys haven't found any solution. I'll update a new script as soon as possible.

Aluigi updated the script, which can be downloaded from the following address:
http://aluigi.org/bms/new_sword_legends.bms
But some files are encrypted with the algorithm of xxtea, and some people provide the key, But I don't know how to use it? Is there an xxtea script?
Code:
cutscene\1010\cs_1010_1a.xxx: 84bf71f9a6a44fa3f3e1a266166dac7297f6018b
cutscene\1010\cs_1010_1b.xxx: 3cdfdf73bef25ae40a40215025fcabaffca2c72a
interface\resource\movie\cg00100b.xxx: 25bcfb70b5cc7e0f2253ffe8a9e3d6e831aad2f5
interface\resource_en\movie\optxt.xxx: 73be7f337c0c248926630719cdbe927895866a41
maps\m01\elems.xxx: 4a40a9712bfdc8e79c46b0ab735130d947dfe6f1
sounds_console\bgm.xxx: 5ff3f69e1d15a67f5d578dbc4d7ce263c1e83135
sounds_console\bgm_p1.xxx: b388c0bf15d0b39c684a0af3c2c3b925c00598b0
sounds_console\voice.xxx: 7ba2771ca1907e9f7348f38a5b8b3881d44db8a2
sounds_console\voice_npc.xxx: 960513d4e71a2b003eda159891e102c43e344eed
sounds_console\voice_p1.xxx: 1b2466ac36ee2e9c2fce01f76dbb1e873df42c06
  • Author
  • Localization

aluigi, posted Wed Apr 01, 2020 8:00 am (55428)


Just a little note about xxtea. xxtea is not a standard algorithm (like xxtea key = 100% job done) because there are some settings, different endianess and even customizations that force you to reverse engineering the algorithm.
quickbms supports all the settings so, with some patience and luck, you can find the correct settings if it's not the default one.
End of my little technical note :D
  • Author
  • Localization

Kaplas, posted Wed Apr 01, 2020 11:03 am (55437)


Here is the C# code for decrypting the files. Each data chunk is 1000 bytes length.
Code:
        private static uint[] GetKey(string key)
        {
            var temp = new byte[16];
            byte[] hexKey = Encoding.ASCII.GetBytes(string.Concat(key, key.Substring(24, 8)));

            for (int i = 0; i < 16; i )
            {
                temp[i] = (byte)(hexKey[i] ^ hexKey[i 16] ^ hexKey[i 32]);
            }

            var result = new uint[temp.Length / sizeof(uint)];
            Buffer.BlockCopy(temp, 0, result, 0, temp.Length);

            return result;
        }

        private static void DecryptChunk(byte[] buffer, int size, IReadOnlyList key)
        {
            int chunkCount = size / 256;

            for (int i = 0; i < chunkCount; i )
            {
                var data = new uint[64];
                Buffer.BlockCopy(buffer, i * 256, data, 0, 256);
                DecryptBlock(data, 64, key);
                Buffer.BlockCopy(data, 0, buffer, i * 256, 256);
            }

            // Process the last block
            int lastBlockLength = (size - (chunkCount * 256)) / 4;
            if (lastBlockLength > 0)
            {
                var data = new uint[lastBlockLength];
                Buffer.BlockCopy(buffer, chunkCount * 256, data, 0, lastBlockLength * 4);
                DecryptBlock(data, lastBlockLength, key);
                Buffer.BlockCopy(data, 0, buffer, chunkCount * 256, lastBlockLength * 4);
            }

            // Process the last bytes
            int lastBytesCount = size - (chunkCount * 256) - (lastBlockLength * 4);
            if (lastBytesCount > 0)
            {
                for (int i = size - lastBytesCount; i < size; i )
                {
                    buffer[i] = (byte)(buffer[i] ^ (size - i) ^ 0xB7);
                }
            }
        }

        // It's a XXTEA algorithm
        // See: https://en.wikipedia.org/wiki/XXTEA
        private static void DecryptBlock(IList data, int blockLength, IReadOnlyList key)
        {
            uint counter = (uint)(((0x34 / blockLength) 6) * -0x61c88647);
            while (counter != 0)
            {
                uint keyBase = (counter >> 2) & 3;
                uint next = data[0];
                for (int i = blockLength - 1; i >= 0; i--)
                {
                    uint previous = (i - 1) >= 0 ? data[i - 1] : data[blockLength - 1];

                    uint value1 = (next << 2) ^ (previous >> 5);
                    uint value2 = (next >> 3) ^ (previous << 4);
                    uint value3 = next ^ counter;
                    uint value4 = previous ^ key[(int)((i & 3) ^ keyBase)];

                    data[i] = data[i] - (value1 value2 ^ value3 value4);

                    next = data[i];
                }

                counter = 0x61c88647;
            }
        }


Anyway, none of the .xxx files has the game texts. I think they are encrypted inside the .exe file.
  • Author
  • Localization

SaraKale, posted Wed Apr 01, 2020 12:07 pm (55439)


i see,Forgive me for not understanding the encryption algorithm, I'm sorry! :cry: Do I need to upload the EXE file?
  • Author
  • Localization

alanm, posted Thu Nov 04, 2021 5:00 pm (67365)


Sorry for replying to old thread. Has anyone figure out how to extract text from the game .exe for translation? I have no clue what encryption is used to encrypt the dialog text. But I did find where the game store the decrypted dialog text in memory and manage to memory dump it to a file. this is just the cutscene subtitle text, not every UI strings in the game.
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.