Unpacking an archive in a DS rom - .mdat

Discussion in 'NDS - ROM Hacking and Translations' started by reynaldo20, Jan 21, 2014.

  1. reynaldo20
    OP

    reynaldo20 Newbie

    Newcomer
    5
    0
    Jan 10, 2013
    Venezuela
    Hello friends, I come to ask please explain how to unzip this type of file. When extracting a file IEAR the texts are in that format (.mdat). If they can make an application, would be much better.
     
  2. Kelebek

    Kelebek GBAtemp Regular

    Member
    165
    62
    May 25, 2012
    What game is it from?
     
  3. reynaldo20
    OP

    reynaldo20 Newbie

    Newcomer
    5
    0
    Jan 10, 2013
    Venezuela
    The game is Luminous Arc 1
     
  4. FAST6191

    FAST6191 Techromancer

    pip Reporter
    23,824
    9,718
    Nov 21, 2005
    United Kingdom
    Hmm I have actually played around with the files of Luminous Arc 1 before but mainly from the sound perspective (it has a very odd sound setup). That said I have also looked at iear (sands of destruction had them).

    Anyway grabbed a few mdat files from data\Msg2.iear as an example.

    Are you sure mdat is the whole thing for text? The header for the Msg2.iear file lists 20 files (it is the code box in a second) and mdat only crops up 5 times in the whole file. Likewise pulling the mdat file out of it it becomes apparent there are no pointers or anything like that, it does not appear to be fixed width either. This would then indicate that the other files are probably helper files. I have not got a solid confirmation yet but it looks like some of those other files are the pointers and such (the data in them certainly lines up like that).

    The file list
    Code:
    00000020 0000 00C0 0000 1170
    00000028 0000 1230 0000 0030
    00000030 0000 1260 0000 0220
    00000038 0000 1480 0000 0030
    00000040 0000 14B0 0000 05F0
    00000048 0000 1AA0 0000 0070
    00000050 0000 1B10 0000 02F0
    00000058 0000 1E00 0000 0070
    00000060 0000 1E70 0000 06F0
    00000068 0000 2560 0000 0020
    00000070 0000 2580 0000 02A0
    00000078 0000 2820 0000 0020
    00000080 0000 2840 0000 0CC0
    00000088 0000 3500 0000 0090
    00000090 0000 3590 0000 0710
    00000098 0000 3CA0 0000 0090
    000000A0 0000 3D30 0000 5A00
    000000A8 0000 9730 0000 0090
    000000B0 0000 97C0 0000 20E0
    000000B8 0000 B8A0 0000 0090
    

    As for doing something after that... afraid that tends to fall to the ROM hacker in question. Common archive formats might have tools made but the text stuff, unless it is a common format and the DS has few of those, is the domain of the person doing the hacking. If you fancy yourself as a translator rather than a hacker then something might be able to be done. I or someone else will hopefully be able to pull some of the data out for you to translate and then insert so as to try to attract a hacker to your cause.
     
  5. reynaldo20
    OP

    reynaldo20 Newbie

    Newcomer
    5
    0
    Jan 10, 2013
    Venezuela
    I'll spend the Msg2.iear decompressed file. You see it in the archives. Mdat to add the txt extension can be read texts, others seem to be help files .... or something.
     

    Attached Files:

  6. Kelebek

    Kelebek GBAtemp Regular

    Member
    165
    62
    May 25, 2012
    Yeah, each mdat table is followed by a mind table, that contains the start/length of each entry. The mdat tables themselves are just a bunch of opcodes. 030dxxxx is the text, the x's are probably a character code. Dunno about the rest, they'd control effects and stuff I imagine.

    The mind tables are pretty simple, 0x10 header: long magic, long length (minus header), and entry count at 0x18. Then the entries start at 0x20, 8 bytes per entry: short number, short length, long offset. Offset is the mdat table starting from after the header, so it's always from 0x10.