Decompressing .pac_ files

Discussion in 'NDS - ROM Hacking and Translations' started by Plasma Shadow, Aug 22, 2011.

Aug 22, 2011
  1. Plasma Shadow
    OP

    Member Plasma Shadow GBAtemp's Artificial Lifeform

    Joined:
    May 15, 2009
    Messages:
    1,508
    Location:
    I have no fucking idea.
    Country:
    United Kingdom
    I need to know how you can decompress/compress .pac_ files.
    Onc there decompressed how do you view them?


    Please help me. :3
     
  2. FAST6191

    Reporter FAST6191 Techromancer

    pip
    Joined:
    Nov 21, 2005
    Messages:
    21,716
    Country:
    United Kingdom
    .pac is something of a generic extension (I have seen a couple of a things with the extension to say nothing of http://www.romhacking.net/docs/541/ ) but I assume this is for that inazuma sequel. I pulled apart pac files for the fire version (not that it matters- if the other version has anything more than token differences I will be stunned).

    Anyhow the _ at the end of the name/extension is often a give away for compression but more than that the 10 that it starts with does just as well. This would be the so called type 10 LZ compression handled by everything as indeed it was by dsdecmp- http://code.google.com/p/dsdecmp/ although just about every GBA or DS decompression tool will support this method. In the files I looked at it appeared to be file wide rather than per sub file as per some others in the original game (and I guess some of the other files in this but I did not check that) which is nice for you.

    After this they appear to conform largely to http://www.romhacking.net/docs/%5B541%5Dpac%20format.txt

    First 4 bytes are number of sub files, next are entries for each file with file location (from the start of the file) and the next for the file length). The final 4 bytes from the header are the length of the following section by the looks of things (the main difference from the above format).

    Once decompressed
    Code:
    00000000 0300 0000 2000 0000 0040 0000 2040 0000 .... ....@.. @..
    00000010 2000 0000 4040 0000 6800 0000 8840 0000ÂÂ...@@..h....@..
    00000020 0000 0000 0000 0000 0000 0000 0000 0000 ................
    0300 0000 just says 3 files contained within so losing that and adjusting the width

    Code:
    00000000 0000 0020 0000 4000 ... ..@.
    00000008 0000 4020 0000 0020 ..@ ... 
    00000010 0000 4040 0000 0068 ..@@...h
    00000018 0000 4088ÂÂÂÂÂÂÂÂÂÂ ..@.
    The first file very much does start at 20 and runs for 4000
    At 4020 there is a file 20 long (it is the palette in this case)
    At 4040 there is a file 68 long (the file ends at 40A8)- I am not sure what this file in although my money is still on it being a graphics map file of some form.
    Less the initial 20 hex (40A8 - 20 all in hex= 4088)

    As for viewing you have just extracted the files so what they contain can be anything- some of mine had 4bpp GBA style imagery and what looked like a palette and maybe some mapping data (if you have an image, a palette and a file where everything is counting up then that would be my bet) but I saw the files scattered across the rom and a quick test saw 8bpp as well, other stuff had 128 wide tiles@ GBA 4bppp (goalImg in this case).

    If indeed it is largely imagery you might have lucked out and only need to use the values to line up your tile editor before recompressing it at the end- you should not have to add anything to the file to edit imagery.
     
  3. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    You could have just asked me. I tried to explain it to you earlier. That is why I told you to let me handle it.
    in your case you can decompress it with batchlz77 and recompress it back the same way. alot of the .pac_ files in that game are mixed use and are more of a container file specified by other files in the game. (you can find reference to several files in just one).

    Some hold text, some hold graphics. the graphics can be viewed in crystaltile2 by going to view then tile view. the hex can be viewed by view then hex editor. though in hex view if you wanted to see the japanese you would need to change the codepage.

    Since you seem to be not listening to me when I said to let me handle that... I am wondering if i should continue to help you with your project.
     
  4. Plasma Shadow
    OP

    Member Plasma Shadow GBAtemp's Artificial Lifeform

    Joined:
    May 15, 2009
    Messages:
    1,508
    Location:
    I have no fucking idea.
    Country:
    United Kingdom
    I used DSDecmpt to decompress it now what do i do?n(btw im new to the hex)
     
  5. Plasma Shadow
    OP

    Member Plasma Shadow GBAtemp's Artificial Lifeform

    Joined:
    May 15, 2009
    Messages:
    1,508
    Location:
    I have no fucking idea.
    Country:
    United Kingdom
    rastsan im sorry....ill leave it now.....bu can you help me find the TASK's ?
     
  6. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    open the file in crystaltile2 then change the view to hex then change the code page to japanese.
     
  7. Plasma Shadow
    OP

    Member Plasma Shadow GBAtemp's Artificial Lifeform

    Joined:
    May 15, 2009
    Messages:
    1,508
    Location:
    I have no fucking idea.
    Country:
    United Kingdom
    What File?
     

Share This Page