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.

Yugioh file

Featured Replies

  • Author
  • Localization

hackspeedok, posted Mon Jan 19, 2015 11:20 am (2745)


I'm translating a Yugioh file. Please help me convert this file to txt and reconvert it. Thanks :)
  • Author
  • Localization

aluigi, posted Mon Jan 19, 2015 1:32 pm (2747)


The file is just a sequence of utf16 unicode strings with a NULL delimiter.
I don't know if the game reads them sequentially (good for you) or at fixed offsets (bad for you).
Do this simple test, open the file with a hex editor and at offset 8 add the following bytes in hex:
Code:
61 00 62 00 63 00 64 00 65 00
They are "abcde", remember to add (insert) the bytes and not to replace them. So the size of your bin file will be bigger of 10 bytes.

If the game crashes or visualizes all the strings with some missing characters at their beginning, it means that it uses the "fixed offsets" method.
If the game works as usual, I can make a script on the file to extract and rebuilding the bin file.
  • Author
  • Localization

hackspeedok, posted Mon Jan 19, 2015 1:44 pm (2751)


aluigi wrote:
The file is just a sequence of utf16 unicode strings with a NULL delimiter.
I don't know if the game reads them sequentially (good for you) or at fixed offsets (bad for you).
Do this simple test, open the file with a hex editor and at offset 8 add the following bytes in hex:
Code:
61 00 62 00 63 00 64 00 65 00
They are "abcde", remember to add (insert) the bytes and not to replace them. So the size of your bin file will be bigger of 10 bytes.

If the game crashes or visualizes all the strings with some missing characters at their beginning, it means that it uses the "fixed offsets" method.
If the game works as usual, I can make a script on the file to extract and rebuilding the bin file.


it work normally :D
  • Author
  • Localization

aluigi, posted Tue Jan 20, 2015 12:21 am (2775)


Ok so let's try... it "may" work.
The following script automatically converts the bin in a txt file and the txt in bin.
Code:
get EXT extension
log MEMORY_FILE 0 0
get SIZE asize
for
    savepos OFFSET
    if OFFSET >= SIZE
        break
    endif
    if EXT == "bin"
        get TEXT unicode
        put TEXT line MEMORY_FILE
    else
        get TEXT line
        put TEXT unicode MEMORY_FILE
    endif
next
get SIZE asize MEMORY_FILE
get NAME basename
if EXT == "bin"
    string NAME = ".txt"
else
    string NAME = ".bin"
endif
log NAME 0 SIZE MEMORY_FILE
You will probably notice that if you don't modify the txt file, when you reconvert it to bin it's not the same as the original.
That's caused by how some characters are decoded and re-encoded, hopefully it will be not a big problem.
Anyway try and let us know if the trick works.
  • Author
  • Localization

hackspeedok, posted Tue Jan 20, 2015 6:47 am (2789)


aluigi wrote:
Ok so let's try... it "may" work.
The following script automatically converts the bin in a txt file and the txt in bin.
Code:
get EXT extension
log MEMORY_FILE 0 0
get SIZE asize
for
    savepos OFFSET
    if OFFSET >= SIZE
        break
    endif
    if EXT == "bin"
        get TEXT unicode
        put TEXT line MEMORY_FILE
    else
        get TEXT line
        put TEXT unicode MEMORY_FILE
    endif
next
get SIZE asize MEMORY_FILE
get NAME basename
if EXT == "bin"
    string NAME = ".txt"
else
    string NAME = ".bin"
endif
log NAME 0 SIZE MEMORY_FILE
You will probably notice that if you don't modify the txt file, when you reconvert it to bin it's not the same as the original.
That's caused by how some characters are decoded and re-encoded, hopefully it will be not a big problem.
Anyway try and let us know if the trick works.


thanks, game didn't crash or error, but desc text of each card not normal, some cards are missing, some card are empty. Can you help me :(
http://i.imgur.com/uSqdNqC.png

http://i.imgur.com/QeaAY9q.png
  • Author
  • Localization

aluigi, posted Tue Jan 20, 2015 9:19 am (2794)


Unfortunately I can't help.
  • Author
  • Localization

hackspeedok, posted Tue Jan 20, 2015 9:44 am (2795)


aluigi wrote:
Unfortunately I can't help.

thank you so much for your script :)
  • Author
  • Localization

hackspeedok, posted Sat Feb 07, 2015 2:14 pm (3092)


Aluigi, can you edit your script ? I need you extract each "." of "...." at the end of each description as "*". Thanks.
Example: If the monster is destroyed and sent to the Graveyard, destroy this Token******.
http://i.imgur.com/UKUwQ3l.png
  • Author
  • Localization

hackspeedok, posted Sun Feb 08, 2015 1:10 pm (3109)


Aluigi please help me
  • Author
  • Localization

aluigi, posted Sun Feb 08, 2015 4:49 pm (3110)


I don't know what you mean but use a hex editor to perform the modifications.
quickbms extracts files, working with strings is not its primary job yet.
  • Author
  • Localization

hackspeedok, posted Wed Feb 25, 2015 5:03 pm (3469)


Aluigi, can you help me to see this index file ?
https://mega.co.nz/#!htMhCbRA!K5cEAH3oU ... 7pjwPkbfic
And, your script didn't work with BIN files in new version (crash when import new file), but i had a way to edit its. However, that way is quite slow and i hope you edit your script if you have free time. This link is a BIN file in new version
https://mega.co.nz/#!Eh1j2KLI!W5I4mfZ7E ... WfQpsz6KYY
  • Author
  • Localization

aluigi, posted Wed Feb 25, 2015 10:26 pm (3475)


I have checked the script and it's correct.
I guess that a possible reason for the crash may be the bad handling of some unicode chars, but it's not something I can change.
Try replacing the bad chars with ANSI chars.
  • Author
  • Localization

hackspeedok, posted Thu Feb 26, 2015 1:08 am (3476)


aluigi wrote:
I have checked the script and it's correct.
I guess that a possible reason for the crash may be the bad handling of some unicode chars, but it's not something I can change.
Try replacing the bad chars with ANSI chars.

I will check again. Can you help me see index file?
  • Author
  • Localization

aluigi, posted Thu Feb 26, 2015 9:34 pm (3486)


From now on I have to automatically avoid to check threads about game language files and localization.
The reason is that I have no tools to easily work on this type of files.

I was writing a script for converting the file to text and viceversa, it was ok when I noticed two problems:
- there is a 32bit value in the Index that is not clear what it represent
- the Desc contains also multi-line strings ("\r\n") so it's not possible to store the string "as-is" on the output text file

Long story short, the following script is totally useless and I post it here just as reference... do NOT use it:
Code:
log MEMORY_FILE  0 0
log MEMORY_FILE2 0 0
get EXT extension

if EXT == "bin"

    put 0xff byte MEMORY_FILE
    put 0xfe byte MEMORY_FILE

    get NAME filename
    string NAME R= "Desc" "Indx"
    open FDSE NAME
    string NAME R= "Indx" "Desc"
    open FDSE NAME 1

    get DESC_SIZE asize 1
    get INDEX_SIZE asize
    xmath STRINGS "INDEX_SIZE / 8"
    for i = 0 < STRINGS
        get DUMMY long
        get OFFSET long

        if OFFSET != DESC_SIZE
            goto OFFSET 1
            do
                get TMP short 1
                if TMP == 0
                    put 0x0d short MEMORY_FILE
                    put 0x0a short MEMORY_FILE
                else
                    put TMP short MEMORY_FILE
                endif
            while TMP != 0
        endif
    next i

    get SIZE asize MEMORY_FILE
    get NAME basename
    string NAME = ".txt"
    log NAME 0 SIZE MEMORY_FILE

else

    get UNICODE_MAGIC short
    put 0 long MEMORY_FILE  # Desc

    get TEXT_SIZE asize
    for TEXT_OFFSET = 0 < TEXT_SIZE
        savepos OFFSET MEMORY_FILE

        do
            get TMP short
            if TMP == 0x0d  # ignore
            elif TMP == 0x0a
                put 0 short MEMORY_FILE
            else
                put TMP short MEMORY_FILE
            endif
        while TMP != 0x0a
        savepos TEXT_OFFSET

        savepos NEXT_OFFSET MEMORY_FILE
        if NEXT_OFFSET & 3
            put 0 short MEMORY_FILE
        endif

        put 0 long MEMORY_FILE2
        put OFFSET long MEMORY_FILE2
    next

    get NAME basename
    string NAME = ".bin"

    string NAME R= "Desc" "Indx"
    get SIZE asize MEMORY_FILE2
    log NAME 0 SIZE MEMORY_FILE2

    string NAME R= "Indx" "Desc"
    get SIZE asize MEMORY_FILE
    log NAME 0 SIZE MEMORY_FILE

endif
  • Author
  • Localization

hackspeedok, posted Fri Feb 27, 2015 3:02 am (3492)


thanks
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.