News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: CRIWARE CPK Tool (for listing/extracting/inserting)  (Read 23062 times)

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
CRIWARE CPK Tool (for listing/extracting/inserting)
« on: August 02, 2014, 01:02:50 pm »
I've released a tool for modifying CRIWARE's CPK archive format.  I've uploaded the tool and the source code for it at : https://github.com/esperknight/CriPakTools  This is based off of code uploaded by Falo to the XeNTaX forums and modified by Nanashi3.  I made it into a command line tool and added the ability to update the files within it.

This is *hopefully* for all versions of the CPK format (I'm sure there'll be some that'll break...)  I've tested it so far with Corpse Party 2U and Time Travelers.

I'd appreciate it if anyone could test it with other games and let me know the results :)

So far it only updates existing files within the archive (irregardless of size).  I don't plan on adding the ability to add new files.  It also doesn't compress any of the files either but I may add that later on (right now it's not needed for CP2U).

I'm hoping this helps out with anyone wanting to translate any PSP games that use this archive format.

FAST6191

  • Hero Member
  • *****
  • Posts: 3008
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #1 on: August 02, 2014, 07:16:18 pm »
Nice one, cri middleware do seem to get about a bit in games I find myself looking at.

Others reading http://www.cri-mw.com/product/adoption/platform/index.html has a list of games that use their software. Sadly the by product for older products is not available at time of posting so you might have to sift through the products also using cri middleware's audio/video stuff.

VicVergil

  • Hero Member
  • *****
  • Posts: 726
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #2 on: August 02, 2014, 11:25:30 pm »
That list is all over the place, also missing the Tsumigi DS game (a JP-only Zelda PH clone by EA where everything is a cpk file).
But it's still really helpful :)
Thanks a lot for the tool, it's a life saver: hopefully it's more efficient than the older BMDTools script.

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #3 on: August 02, 2014, 11:56:21 pm »
Thanks FAST6191 for the list, that'll help for me to try to test various games with it.

From looking at that list, I see stuff missing as well such as Corpse Party 2U and Time Travelers.

Also from looking at it, theoretically anything that is noted as using FileMajik PRO should work.  I'm thinking older ones may break this though as CP2U appears to be using a newer version (I don't have it handy at the moment.. but definitely newer).  I didn't pay attention to what Time Travelers was using.  I recall seeing in the code that for the ITOC it was looking for FileL/FileH but for CP2U it wants DataL/DataH (I may have these reversed...).  So it may break due to that I'm thinking.

And this should work better than BMDTools as mine can expand the files while I believe BMDTools would only do a straight replace (it didn't compress right?).  Those scripts didn't work either with CP2U (I tried everything to avoid coding this as this archive format is a real pain :) )


Dashman

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #4 on: August 03, 2014, 06:35:44 am »
This is funny, just yesterday I discovered that there were some CPK Tools made by some Chinese team that CrashmanX had translated and was using to translate G Generation Overworld for the PSP (not on GHANMI's list btw) an just an hour or so later esperknight releases his own tool. It's like the universe is trying to tell me something :laugh:

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #5 on: August 03, 2014, 08:40:52 am »
This is funny, just yesterday I discovered that there were some CPK Tools made by some Chinese team that CrashmanX had translated and was using to translate G Generation Overworld for the PSP (not on GHANMI's list btw) an just an hour or so later esperknight releases his own tool. It's like the universe is trying to tell me something :laugh:

It's telling you you really want to make you're own CPK toolset ;)

I think I tried those Chinese tools and sadly they didn't work for CP2U (I swear CP2U just likes to crush your hopes and dreams...  Very fitting though :) ).  I believe those use the official sdk that was release/leaked but they created a wrapper around it to make it a lot easier to use.  I could be wrong though as I can't find the toolset I'm thinking of that may be it...

I'm wondering now if CP2U is the only one that doesn't work with the official tools -_-

Edit :

Seems you can build CP2U using the official tools.... Another showed me how it can be done (seems DATA0 is a bit special... Or it could still be me ;) ).  Seems my utility isn't really needed after all but hey :)  Maybe it'll help as it's a bit simpler :D
« Last Edit: August 03, 2014, 01:13:06 pm by esperknight »

Dashman

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #6 on: August 03, 2014, 06:22:46 pm »
I'd rather save myself the trouble if there's already existing tools :P

By the way, I commented this with Crash and he mentioned that some games (like G Generation games) come with a Filelist.bin that gives the names for the files inside the CPK. You think you could add support for those, so that you can output something with nicer names than "0123456.bin"? Maybe you already did, sorry if that's the case, I didn't check.

esperknight

  • Full Member
  • ***
  • Posts: 130
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #7 on: August 04, 2014, 08:58:06 am »
I can take a look definitely.  Makes me wonder if I already do though which is why I thought CP2U 's DATA0 took file names not ids.....  Mind PMing the file?  Save me a bit of time searching and making sure I got the right one :)

Dashman

  • Full Member
  • ***
  • Posts: 212
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #8 on: August 04, 2014, 11:38:59 am »
PM sent ;)

mailwl

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #9 on: November 14, 2014, 02:13:31 am »
Don't know bug or not, but if filename starts with "/", then the proggie trying to create file at c:\... path (and system doesn't allow it).
for example, from NPJH-50459 - 7th Dragon 2020 containt file "/7thDragon2020.dst" in cpk-archive

Edit: I was wrong, the exact filename without "/", full path is empty, but proggie replaces empty path with "/"
« Last Edit: November 14, 2014, 02:48:15 am by mailwl »

CrashmanX

  • Jr. Member
  • **
  • Posts: 9
    • View Profile
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #10 on: June 23, 2015, 01:45:52 am »
Somehow I only now found this thread on your modified CPK script. Didn't even know Dash had asked you to look into it. Though I'm curious, did you ever figure out if you could use the Filelist.Bin with the Dataumd.CPK?

We've been making due without it thanks to the help of a user on GBATemp and their program to rebuild the UMD simply by throwing all the files back in the exact same order they came out. However if we were able to correctly identify which file was what we'd be able to track down lots of missing data and we'd have a much, much easier time working with things. We might even be able to make better translations.

BlackDog61

  • Hero Member
  • *****
  • Posts: 784
    • View Profile
    • Super Robot Wars A Portable translation thread
Re: CRIWARE CPK Tool (for listing/extracting/inserting)
« Reply #11 on: October 25, 2015, 06:17:18 pm »
Hey, EsperKnight,

[EDIT]
So how does one handle the first-level packaging, before CPK files are found?

Black
« Last Edit: October 25, 2015, 06:47:13 pm by BlackDog61 »