Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Cri *.cpk archive specifications

The Original Forum. Game archives, full of resources. How to open them? Get help here.
Post Reply
Riigel
n00b
Posts: 11
Joined: Thu Jul 07, 2011 6:32 pm
Has thanked: 1 time

Cri *.cpk archive specifications

Post 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
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 10 times
Been thanked: 274 times

Re: Cri *.cpk archive specifications

Post 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.
Riigel
n00b
Posts: 11
Joined: Thu Jul 07, 2011 6:32 pm
Has thanked: 1 time

Re: Cri *.cpk archive specifications

Post 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?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4283
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1146 times
Been thanked: 2242 times

Re: Cri *.cpk archive specifications

Post 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.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
Riigel
n00b
Posts: 11
Joined: Thu Jul 07, 2011 6:32 pm
Has thanked: 1 time

Re: Cri *.cpk archive specifications

Post 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?
User avatar
shakotay2
MEGAVETERAN
MEGAVETERAN
Posts: 4283
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 1146 times
Been thanked: 2242 times

Re: Cri *.cpk archive specifications

Post 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.
Tuts: a) Bigchillghost, viewtopic.php?f=29&t=17889
b) Extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
"Quoting the whole thing. Would u ever stop this nonsense?"
User avatar
Falo
advanced
Posts: 78
Joined: Fri Oct 23, 2009 1:29 pm
Been thanked: 33 times

Re: Cri *.cpk archive specifications

Post 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
todzy
n00b
Posts: 11
Joined: Thu Sep 25, 2014 2:47 pm
Has thanked: 1 time

Re: Cri *.cpk archive specifications

Post 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
jonhsame
ultra-n00b
Posts: 1
Joined: Sat Oct 15, 2016 12:16 pm
Contact:

Re: Cri *.cpk archive specifications

Post 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.
dich vu thong cong nghet gia re thong cong nghet uy tin tim nguoi giup viec nha chuyen nghiep
wmltogether
ultra-n00b
Posts: 1
Joined: Fri Nov 25, 2011 1:39 pm

Re: Cri *.cpk archive specifications

Post 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
Post Reply