Unpacking an NDS .pak file

Discussion in 'NDS - ROM Hacking and Translations' started by huckleberrypie, May 17, 2011.

May 17, 2011
  1. huckleberrypie
    OP

    Newcomer huckleberrypie Newbie

    Joined:
    May 16, 2011
    Messages:
    7
    Country:
    United States
    IDK if it's OK to post a sample archive file here, but I'm just wondering as to what sort of packing/compression does this file use?

    [​IMG]

    I'm currently planning to hack/peek at an NDS game and extract something useful out of it for a personal project or two.
     
  2. Rydian

    Member Rydian Resident Furvertâ„¢

    Joined:
    Feb 4, 2010
    Messages:
    27,883
    Location:
    Cave Entrance, Watching Cyan Write Letters
    Country:
    United States
    No, just screenshot a snippet of the first few rows of hex values.
     
  3. huckleberrypie
    OP

    Newcomer huckleberrypie Newbie

    Joined:
    May 16, 2011
    Messages:
    7
    Country:
    United States
    You mean, like, just a screenie and not the file itself? OK, I'll remove it.
     
  4. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    that could be some form of unicode codepage(one that lists englsh in the ff-- range).
    You mgiht also be looking at an image. I have seen the same thing in the map file of simcity creator.

    but 4d doesn't strike me as compressed. But that is not tos say there isn't compression in it. Did you use ct2 to look for any? in hex mode put your cursor at the start of the file then goto tools lz77/huffman compression search...
    In the header box see the 10 that is what it looks for... you will need to change that to 11 20 30 40 and maybe someother types that are eluding me right now. If 10 doesn't return any results, move on to the next and so on.
    (probably doesn't make that much sense).
    anyways if there are results click on one and goto to the start of it. then tools lz77/huffman extract and exrtact and open the file... look through what opens.

    edit: if it is indeed a pak file there are decompressors out there for it depending on the type of pak file. (I think there is one here on gbatemp...hmm)- as there are ps1, ps2, etc type pak files. Unfortunately there may not be compressors.
     
  5. huckleberrypie
    OP

    Newcomer huckleberrypie Newbie

    Joined:
    May 16, 2011
    Messages:
    7
    Country:
    United States
    Thanks for the tip, but the CT2 that I have right now has a rather mangled translation, I'm afraid, and I'm not that sure as to how to use that compression search thingy.
     
  6. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    Okay, the company webfoot technologies, is responsible for the compression. If you would like to compare how they compress take a look at Homie rolllerz the same file: filesystem.pak. they are set up the same way. Possible directory with offset and a flag for either compression or directory(unsure).
    Either way both files have the same structure they may not be identical. They do have the same structure though. so I tried to follow in the one whether it was an offset listing. I can't make anything of it. I have only taken a quick look so far. But I am pretty sure that there is byte reversal. as the 10 shows up as 01 where I am pretty sure the first compressed file starts and seems to repeat in structure for the next compressed file.

    So hucklebarrypie take some time to learn the terms and just sit and play with this file. (or both files in case you start to doubt yourself). If you are lucky maybe one of the other webfoot technologies games has been hacked. but the quick search I did last night did not turn up anything. (try searching in another language). webfoot website to check out other games they have developed and check out whether my hunch is right... that its webfoot technology games with this specific type compression, not thq.

    now in case you are just ripping graphics. Emulators are really good for that. Use the memory dump and look for images in it if screenshots can't help you.

    Sorry I wasn't that much help.
     
  7. huckleberrypie
    OP

    Newcomer huckleberrypie Newbie

    Joined:
    May 16, 2011
    Messages:
    7
    Country:
    United States
    Thanks for the tip. As for ripping, well, I'm actually planning to rip the models out of the game (don't worry, I won't post the ripped stuff here). I managed to get the textures from it using either GLIntercept or 3D Ripper DX (plus an OpenGL-DirectX wrapper), but the way the emulators work kept me from grabbing the meshes from the games. There was a Chinese dude who managed to dump them, but it seemed as though he's not yet finished with it.
     
  8. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    then ask them If you can help, while asking them HOW? then post here I would like to know too.
     
  9. gshock

    Member gshock Advanced Member

    Joined:
    Mar 8, 2008
    Messages:
    63
    Country:
    Canada
    Try using 3DVIA Printscreen. It has native OpenGL support and it's been posted on other emulation forums for capturing OpenGL meshes in emulators.
     
  10. huckleberrypie
    OP

    Newcomer huckleberrypie Newbie

    Joined:
    May 16, 2011
    Messages:
    7
    Country:
    United States
    Tried it, but still I can't capture anything with it, too. Szfzafa from Xentax had a code snippet for Desmume that allows you to dump models to an OBJ file, but IDK where to put it as it was a tad confusing to use.
     
  11. Auryn

    Member Auryn GBAtemp Advanced Fan

    Joined:
    Jul 21, 2011
    Messages:
    529
    Country:
    Switzerland
    I would say
    4 bytes number of entries / 4 bytes CRC of file?? or just pointer section?? / 4 bytes data offset (offset of the first file/ 4 bytes deconpressed filesize / 4 bytes flags file 1? / 4 bytes file n CRC / 4 bytes offset file n / 4 bytes decompressed file n size/ 4 bytes flag file n / .....
     

Share This Page