Question about Uncompressing and compressing bins

Discussion in 'NDS - ROM Hacking and Translations' started by matthewn4444, Mar 7, 2009.

  1. matthewn4444
    OP

    Member matthewn4444 GBAtemp Regular

    Joined:
    Jun 21, 2007
    Messages:
    201
    Country:
    United States
    I looked around the in forums and didn't really find a clear answer. In 7th dragon, there are a lot of bin files, and I was wondering how to uncompress them, and then later compress them back to the bin files. Also, I believe that there are multiple font files (probably all in the font bin files) and I want to know how to direct them the text to them to translate into english. I read a little on pointers but I need to try it myself to understand. I'm sorry if this thread is an inconvenience since I am still a noob at translating.
     
  2. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,745
    Country:
    United Kingdom
    "Disclaimer" I have not pulled apart this game yet so this is general advice.

    bin is a generic extension across all of computing let alone the DS and has no real meaning like sdat, nftr, narc and the like have for the DS. I would back your call that the font or at least part of it is in the font.bin files, how they are stored is a different matter (try in a tile viewer/editor first, they could be tiled fonts, they could be assembled from parts (see the likes of http://deufeufeu.free.fr/wiki/index.php?ti...rmat_.28font.29 ) or they could be even more complex (see NFTR).

    Also how confident are you the files are compressed (I assume you mean compression as in shrunk not how do I unpack the file into something more usable)? It can be quite hard to tell without a frame of reference (if the text is character set you recognise, see something like http://www.romhacking.net/docs/281/ you can but graphics can be hard, especially without resorting to assembly coding)
    If they are compressed you will have to identify the compression, the most common compression on the DS is LZ77 (or at least it is known as that even if it is not always strictly LZ77) followed by huffman and a whole host of others.
    LZ77 compression, crystaltile2 has fairly decent compression detection and there are several automated checking tools, check around http://www.romhacking.net/ as well as crystaltile2).

    As for pointers there are several guides but think of them like a contents section for a book but instead of pages they work for sentences and sometimes paragraphs.
     
  3. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
    They're not compressed, but some are archives of multiple files. For instance, the first 4 bytes of evtdat.bin represent the number of files n it contains, followed by n 4-byte pointers to the start of each file.
     
  4. matthewn4444
    OP

    Member matthewn4444 GBAtemp Regular

    Joined:
    Jun 21, 2007
    Messages:
    201
    Country:
    United States
    I'm sorry for asking this and it is kinda off topic from compressions. But in 7th dragon, I was spending a couple of hours to find text but I couldn't find any. If you don't mind, how would you approach finding text in this game (say I wanted to look up the skills text)? And thanks for the fast responses from before.
     
  5. nIxx

    Member nIxx GBAtemp Maniac

    Joined:
    Sep 30, 2007
    Messages:
    1,459
    Location:
    Germany
    Country:
    Germany
    Open for example the evtdat.bin and use SJIS encoding there is some text. (there are a few other bins that have text too)
    But if you replace japanese text with a longer englisch text it´s possible that you need to change the offsets where the text starts.

    EDIT: Had a bit time so i wrote an Unpacker/Packer for it [​IMG]
    http://www.megaupload.com/?d=27C8HTWA
    Don´t forget that this does not work with every bin file. (I tried only evtdat.bin and fldeffdat.bin)
     
  6. matthewn4444
    OP

    Member matthewn4444 GBAtemp Regular

    Joined:
    Jun 21, 2007
    Messages:
    201
    Country:
    United States
    Thanks a lot for the help. I finally can see the text. It's funny since the last time I did this was last year and I forgot a lot of stuff. Anyways. I play around with these files and I'm wondering, are most Japanese games use SHIFT-JIS (like the table)? And if you any good sites for beginners at pointers and offsets please let me know though I have read some ones on romhacking already, I still need to get familiar with it. In addition, pointers are not always at the beginning of the file, but is it possible that it can be in another file? (like can pointers in 1 file point to the text in another file?) And I'm sorry for noob-ness.
     
  7. DarthNemesis

    Member DarthNemesis GBAtemp Maniac

    Joined:
    Feb 19, 2008
    Messages:
    1,208
    Country:
    United States
    Most Japanese games do use Shift-JIS (although this one only uses it for kana, not for kanji). You may also find some Unicode.
     
  8. matthewn4444
    OP

    Member matthewn4444 GBAtemp Regular

    Joined:
    Jun 21, 2007
    Messages:
    201
    Country:
    United States
    Thanks for the response. Is there a file i need to download so I can type kanji and katana/hiragana on windhex? I'm trying to make the table with kanji (I'm using tablet) but I can't seem to get the characters on it. Instead of placing a Japanese character, I get "??" in the place of where I copied it to. If anyone has any ideas please help.
     
  9. Shyvnal

    Member Shyvnal GBAtemp Regular

    Joined:
    Apr 8, 2007
    Messages:
    169
    Location:
    UK, Birmingham
    Country:
    United Kingdom
    I'm sure you how a table works.
    Normally the kanji would be xxxx, instead there yyyy. Without a table for the kanji they'll all be ??
    If you know where the kanji should be (ie "・の・Чに・まれた!") the ・ should be yyyy, make a table so its:
    yyyy = ・
    Where ・ = whatever the kanji is
    Theres probably an easier way but whatever
     
  10. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,745
    Country:
    United Kingdom
    If you copy and paste even if it displays a ?? it should still retain the underlying hex. Also table files are not some complex format, you can edit them by hand with a hex editor quite easily.

    Also kana have an order of sorts (far more so than any kanji) and a decent table maker like TaBuLar has the option to add sets of characters at once:
    http://www.romhacking.net/utils/55/

    Another program I quite like is getmyhex, it might not be of all that much use here but keep it handy:
    http://www.romhacking.net/utils/504/

    Also crystaltile2, it has some decent language support.
     
  11. psycoblaster

    Member psycoblaster Divine

    Joined:
    Jan 26, 2008
    Messages:
    2,132
    Location:
    Seoul.. (in Korea)
    Country:
    Korea, South
    Few weeks ago, I made my own program that merges two table file together, one for the mapping and one for the characters. (Very simple...)
    Also, if the mapping is in order, (kind of like 8800, 8801, 8802, etc) then you can create it, too.

    It was meant to be used for korean translation purposes, (because you overwrite the kanji with korean characters, and etrian odyssey used a basic custom encoding)

    So it might be able to help you, if you figure out the rule of the kanji character mapping...
     

Share This Page