READ THE RULES: Click here

Follow us on Facebook: https://www.facebook.com/xentax/ :)

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 » Wed Jul 31, 2013 3:59 pm

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

User avatar
howfie
double-veteran
double-veteran
Posts: 929
Joined: Fri Jul 08, 2011 12:06 pm
Location: Torrance, CA
Has thanked: 9 times
Been thanked: 263 times

Re: Cri *.cpk archive specifications

Post by howfie » Wed Jul 31, 2013 9:30 pm

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 » Thu Aug 01, 2013 9:57 am

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: 2768
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 688 times
Been thanked: 1427 times

Re: Cri *.cpk archive specifications

Post by shakotay2 » Thu Aug 01, 2013 11:04 am

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.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

Riigel
n00b
Posts: 11
Joined: Thu Jul 07, 2011 6:32 pm
Has thanked: 1 time

Re: Cri *.cpk archive specifications

Post by Riigel » Thu Aug 01, 2013 11:51 am

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: 2768
Joined: Fri Apr 20, 2012 9:24 am
Location: Nexus, searching for Jim Kirk
Has thanked: 688 times
Been thanked: 1427 times

Re: Cri *.cpk archive specifications

Post by shakotay2 » Thu Aug 01, 2013 1:37 pm

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.
Bigchillghost, Reverse Engineering a Game Model: viewtopic.php?f=29&t=17889
extracting simple models: viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip
"You quoted the whole thing, what a mess."

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 » Thu Aug 01, 2013 3:44 pm

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 » Thu Oct 06, 2016 2:59 pm

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 » Sat Oct 15, 2016 12:21 pm

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 » Mon Oct 31, 2016 6:03 am

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