How can I open ...

Discussion in 'NDS - ROM Hacking and Translations' started by Pokedom, Jun 19, 2009.

Jun 19, 2009

How can I open ... by Pokedom at 6:39 PM (1,425 Views / 0 Likes) 11 replies

  1. Pokedom
    OP

    Newcomer Pokedom Member

    Joined:
    Feb 19, 2009
    Messages:
    10
    Country:
    Germany
    How can I open the .Z archives and the .p2 files in the unpacked rom Kingdom Hearts 358/2 days ?
     
  2. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
    How? No reply? :(
     
  3. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
  4. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
    Thanks for the help ...
    But what I wanted to know was how to open these same files .p2,
    or how to put the files have inside it, back into it.

    Sorry my bad english. :/
     
  5. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    well it depends on what you used to edit them (sort of a question). Also if you are sure they are now the same format as that to which you took out. So assuming you took it out one way (file cutter with a .bat then dsdcmp with a bat) you would then put it pack with say a hex editor remembering to update the pointer table if it has such. (see below for partial kaph file pointer table)
    Though if they are compressed - truly compressed kaph then you would then have to compress them then insert them while updating the pointer table. so then you take your edited files put them in a general bin file that will be your future kaph file. you will need to know the following info to make the kaph file
    BCAdata Offset;
    BVAdataOffset;
    BMAdataOffset;
    BTPdataOffset;
    BTAdataOffset;
    unknownOffset1;
    unknownOffset2;
    BMDdataOffset
    so if you are missing or don't know these terms (BCA, BVA, BMA, BTP, BTA, BMD files) you may be out of luck as you will have to figure out what the unknown offsets actually point to in the kaph files.
    I got this info from http://forum.xentax.com/viewtopic.php?f=16&t=5394.
    Hopefully you followed that guide to get the kaph decompressed. If you would please be kind enough to document what you used to edit these files together it might be appreciated by others trying to edit the models as well. (say the bat file code for putting all those files together)
    then if assuming you can make the kaph file you need to compress that kaph file then pack the p2 file. but since I don't know the structure of the p2 file I would have to look into it. As I am only going off of what others are saying.
    first build a kaph file. second compress said kaph file. Third build .p2 file in hex editor(however that might be).

    sorry for meandering. harumph... fast will probably swoop in and make this post look silly again...
     
  6. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
    What I wanted was to edit the texts of the game, I've found them, are in a file .p2 (as always), the text files are in .z (easy comprension), but the problem as always is on .p2 ...
     
  7. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    which .p2? where is the text (roughly) offset wise in said p2? which version?
     
  8. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
    The texts are inside the archive .p2, I used NinUnpack to decompress the file .p2, and appeared various other files .z, and these files .z contained the texts of the game.

    What I can't do is to compress these files .z in a file .p2.
     
  9. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    well I found the file structure on xentax. The good news is filecutter and the info from xentax can help you figure out how to cut the original files out without decompression. Why is that important? Well if you can get them out you can get them back in. one way to get them back in is to do it kinda laboriously by putting them in one by one in hex using the previous .p2 files header. you just update the file header with the new files offsets, when/while putting them in.
    look up fasts guide to using filecutter here on gbatemp as you are just reversing that (kinda). Instead of taking the files out you are using the old offsets/filenames to put them back in the right way.
    if you were looking for a tool to do it for you... no, sorry.
    check this link on .p2 file structure.
    note I do this type of thing a lot for other games - recreating the container file. it gets easier with practice.
     
  10. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
  11. Roxxxas

    Newcomer Roxxxas Newbie

    Joined:
    Sep 4, 2013
    Messages:
    6
    Country:
    Brazil
    Thanks for all the help rastsan, I don't know how to say "thank you" in this forum, if you know tell me so I can give you +1 reputation, think I'll change the Kh 358/2 Days to Re: coded, it seems easier to find the text within the game, anyway thanks for everything!
     
  12. rastsan

    Member rastsan 8 baller, Death Wizard

    Joined:
    May 28, 2008
    Messages:
    963
    Location:
    toronto
    Country:
    Canada
    with just a little effort you could get it. It just means figuring out what those two unknown bytes are. which can be done with a memory editor and some assembly - dis assembly (asm). the asm can be viewed by crystaltile2 and a couple other things. may be necessary may not be necessary.
    Even then it is worth it to try rebuilding without figuring out what those bytes are. Just trying is what counts. especially if you already put some work into translating it. but if you really have to give up... that is okay.
     

Share This Page