Page 1 of 1

Cri *.cpk archive specifications

Posted: Wed Jul 31, 2013 3:59 pm
by Riigel
Hi there,

i know there are plenty ways to unpack cpk files but i can't find informations about the format specifications ?
Has anybody documents about how the format is build up or how to unpack?

thanks

Re: Cri *.cpk archive specifications

Posted: Wed Jul 31, 2013 9:30 pm
by howfie
both the source code for quickbms and hcs64's cpkunpack are freely available. both have cpk unpack code. as far as i know no specification exists.

Re: Cri *.cpk archive specifications

Posted: Thu Aug 01, 2013 9:57 am
by Riigel
thanks for your reply.

I had already checked these scripts but had problems to understand whats going on.
I'am really surprised that there are no specification available for such a popular file format.

p.s. Is there a graphical debugger for bms scripts?

Re: Cri *.cpk archive specifications

Posted: Thu Aug 01, 2013 11:04 am
by shakotay2
Riigel wrote:p.s. Is there a graphical debugger for bms scripts?
Don't think so. Sure you'll need one?

Just use debug option -v for quickbms.

This is an example output (not for cpk but dzip but shouldn't matter):
In bold the addresses of the archive being extracted.

offset filesize filename
------------------------------
.start_bms start: -1 0 0

00000000 09 1 idstring DZIP

00000004 19 2 comtype COMP_LZF

00000004 06 3 get unk01 long
>set unk01 (0) to 0x00000002

00000008 06 4 get files long
>set files (1) to 0x00000001

So you can see at which address which values to be filled into the vars of the script.

Re: Cri *.cpk archive specifications

Posted: Thu Aug 01, 2013 11:51 am
by Riigel
thank,
i will try the debug mode.

Just a quick Question to the syntax. (Can't find informations in the readme)
"set query->offset long 0"

Is "query->" somthing like a list in .Net?

Re: Cri *.cpk archive specifications

Posted: Thu Aug 01, 2013 1:37 pm
by shakotay2
You could (as a test) replace all the "query->" in the cpk.bms by "query_" and see whether the script will run correctly.

I guess it will.

Re: Cri *.cpk archive specifications

Posted: Thu Aug 01, 2013 3:44 pm
by Falo
The format itself is a little bit complicated to understand, but once you understand how everything works it's easy to write a tool for it,

Image
This is my try to make a tool, it currently supports:
- decompress CRILAYLA
- decrypt UTF if UTF is encrypted
- read TOC, ITOC and ETOC tables
TODO:
- implement GTOC table
- some optimizations
- replace files
- relink files
- repack into cpk/create cpk from folder

It's written in C# and therefore easy to debug in visual studio.
Here source code + binary:
http://www.mediafire.com/download/xgx73 ... oolpack.7z

Re: Cri *.cpk archive specifications

Posted: Thu Oct 06, 2016 2:59 pm
by todzy
I check cpk and in it files have the same names and when unpacking they replace each other.
Only unpacker that work was CpkFileExplorer from https://github.com/esperknight/CriPakTools (Link go here)
Pls look and help me with it, because i try all tools that i find on internet already...
File: https://mega.nz/#!aldiwY4D!wgrYjIrFZsf4 ... ZFeXhdh4hc

Re: Cri *.cpk archive specifications

Posted: Sat Oct 15, 2016 12:21 pm
by jonhsame
both the source code for quickbms and hcs64's cpkunpack are freely available. both have cpk unpack code. as far as i know no specification exists.

Re: Cri *.cpk archive specifications

Posted: Mon Oct 31, 2016 6:03 am
by wmltogether
todzy wrote:I check cpk and in it files have the same names and when unpacking they replace each other.
Only unpacker that work was CpkFileExplorer from https://github.com/esperknight/CriPakTools (Link go here)
Pls look and help me with it, because i try all tools that i find on internet already...
File: https://mega.nz/#!aldiwY4D!wgrYjIrFZsf4 ... ZFeXhdh4hc
Try this fork :https://github.com/wmltogether/CriPakTools/tree/mod
based on the scripts from falo & esperknight