cpk file unpack error [Amagami]
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
cpk file unpack error [Amagami]
https://www.dropbox.com/s/31y94n7h88voy ... O.CPK?dl=0
This cpk file is psp game Amagami's script.
I need your help to unpack.
cpk.bms script doesn't work.
This cpk file is psp game Amagami's script.
I need your help to unpack.
cpk.bms script doesn't work.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
That's a job for CriPakTools that supports also the encrypted archives:
https://github.com/esperknight/CriPakTo ... kTools.exe
Tested and works, if you have never used it create a new folder, put SCENARIO.CPK and the CriPakTools.exe in it, create a file.bat containing the following and launch it:
CriPakTools.exe SCENARIO.CPK ALL
https://github.com/esperknight/CriPakTo ... kTools.exe
Tested and works, if you have never used it create a new folder, put SCENARIO.CPK and the CriPakTools.exe in it, create a file.bat containing the following and launch it:
CriPakTools.exe SCENARIO.CPK ALL
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
Re: cpk file unpack error [Amagami]
thank you for your kind.
as you know, cpk file need a CSV file.
because inside there are many files, but each file has different compression.
how to make CSV file?
there are many files in there.
as you know, cpk file need a CSV file.
because inside there are many files, but each file has different compression.
how to make CSV file?
there are many files in there.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
I don't know about this csv file, the extraction process is completed and the file there have an SCF\x1a magic that means it's a file format (model?), I don't see compression and in any case the cpk files use the CRILAYLA compression which is handled automatically by the script.
I'm sure that other users know about what you refer, I know only about the extraction
I'm sure that other users know about what you refer, I know only about the extraction
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
Re: cpk file unpack error [Amagami]
Thank you
can you help?
https://www.dropbox.com/s/oo2ewuplo8xtp ... I.IMG?dl=0
I think like maybe this file is compressed.
Can you analyze this file?
Thank you.
Sorry, my English is poor....
can you help?
https://www.dropbox.com/s/oo2ewuplo8xtp ... I.IMG?dl=0
I think like maybe this file is compressed.
Can you analyze this file?
Thank you.
Sorry, my English is poor....
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
Not sure at 100% but the following is the script that gives the best decompressed result:
Code: Select all
comtype lzss "11 5 2 2 0"
get SIZE long
savepos OFFSET
get ZSIZE asize
math ZSIZE - OFFSET
get NAME basename
clog NAME OFFSET ZSIZE SIZE
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
Full extraction script
http://aluigi.org/bms/amagami_img.bms
http://aluigi.org/bms/amagami_img.bms
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
Re: cpk file unpack error [Amagami]
Thank you very much !!
Is it possible reimport files?
if file size over, reimport it doesn't work. right?
Is it possible reimport files?
if file size over, reimport it doesn't work. right?
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
The "file size" rule is ever valid so new <= old.
Reimporting is perfectly possible but it's necessary to split the script in two parts because the original script does everything on the fly in memory.
So the first part is the decompression of AMAGAMI.IMG:
While the second part is the extraction from the generated tmp.dat file:
Now, you do not need to extract the files again because they are fine, but use the first script on AMAGAMI.IMG for generating tmp.dat
When you want to reimport the files run reimport.bat selecting the second script, tmp.dat and the folder where you previously extracted the files.
Now run reimport.bat with the first script, amagami.img and the folder where is located tmp.dat.
If you have problem with this specific step I can write a new script that doesn't need reimport.bat.
It's really very easy, it's more difficult to explain it than doing it.
Reimporting is perfectly possible but it's necessary to split the script in two parts because the original script does everything on the fly in memory.
So the first part is the decompression of AMAGAMI.IMG:
Code: Select all
comtype lzss "11 5 2 2 0"
get SIZE long
savepos OFFSET
get ZSIZE asize
math ZSIZE - OFFSET
clog "tmp.dat" OFFSET ZSIZE SIZE
While the second part is the extraction from the generated tmp.dat file:
Code: Select all
get SIZE long
get FILES long
for i = 0 < FILES
get NAME_OFF long
putarray 1 i NAME_OFF
next i
for i = 0 < FILES
get OFFSET long
putarray 0 i OFFSET
next i
putarray 0 i SIZE
for i = 0 < FILES
getarray NAME_OFF 1 i
getarray OFFSET 0 i
math i + 1
getarray SIZE 0 i
math SIZE - OFFSET
goto NAME_OFF
get NAME string
string NAME + "."
log NAME OFFSET SIZE
next
Now, you do not need to extract the files again because they are fine, but use the first script on AMAGAMI.IMG for generating tmp.dat
When you want to reimport the files run reimport.bat selecting the second script, tmp.dat and the folder where you previously extracted the files.
Now run reimport.bat with the first script, amagami.img and the folder where is located tmp.dat.
If you have problem with this specific step I can write a new script that doesn't need reimport.bat.
It's really very easy, it's more difficult to explain it than doing it.
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
Re: cpk file unpack error [Amagami]
offset filesize filename
--------------------------------------
Error: file "tmp.dat"
the reimport option acts as a reimporter and so you cannot reinsert a
file if it's bigger than the original otherwise it will overwrite the
rest of the archive or cannot be loaded correctly:
new size: 2144096 uncompressed
old size: 2144092 uncompressed
- do you want to skip this file? (y/N/force)
y will continue with the next file
N (default) will terminate QuickBMS
force will force the reimporting of the file
force
Error: file "tmp.dat"
the reimport option acts as a reimporter and so you cannot reinsert a
file if it's bigger than the original otherwise it will overwrite the
rest of the archive or cannot be loaded correctly:
new size: 888668 (2144096 uncompressed)
old size: 888666 (2144096 uncompressed)
- do you want to skip this file? (y/N/force)
y will continue with the next file
N (default) will terminate QuickBMS
force will force the reimporting of the file
force
< 00000004 888668 tmp.dat
- 1 files reimported in 442 seconds
coverage file 0 0% 4 888672 . offset 00000004
Press ENTER or close the window to quit
-------------------------------------------
it shows like this window.
first, i select a first script.
second, select a amagami.img.
third, select a unpacked folder.
i tried the test. wrote 4 byte more.
and then i tried the second test.
tried uncompress edited amagami.img (wrote a 4 byte file)
offset filesize filename
--------------------------------------
00000000 0 -.dat
00000000 0 00000001.dat
00000000 242 \.dat
000000f2 4294967138 \.dat
- The following output file already exists:
.dat
Do you want to overwrite it?
y = overwrite (you can use also the 'o' key)
n = skip (default, just press ENTER)
a = overwrite all the files without asking
r = automatically rename the files with the same name
s = skip all the existent files without asking
r
Error: impossible to write 0xffffff62 bytes (total 0xffffff62)
Check your disk space
Last script line before the error or that produced the error:
26 log NAME OFFSET SIZE
Press ENTER or close the window to quit
---------------------------
what should i do??
sorry~!
when i localize this game, i'll probably over those file's size.
because it takes longer to translate into Korean.
--------------------------------------
Error: file "tmp.dat"
the reimport option acts as a reimporter and so you cannot reinsert a
file if it's bigger than the original otherwise it will overwrite the
rest of the archive or cannot be loaded correctly:
new size: 2144096 uncompressed
old size: 2144092 uncompressed
- do you want to skip this file? (y/N/force)
y will continue with the next file
N (default) will terminate QuickBMS
force will force the reimporting of the file
force
Error: file "tmp.dat"
the reimport option acts as a reimporter and so you cannot reinsert a
file if it's bigger than the original otherwise it will overwrite the
rest of the archive or cannot be loaded correctly:
new size: 888668 (2144096 uncompressed)
old size: 888666 (2144096 uncompressed)
- do you want to skip this file? (y/N/force)
y will continue with the next file
N (default) will terminate QuickBMS
force will force the reimporting of the file
force
< 00000004 888668 tmp.dat
- 1 files reimported in 442 seconds
coverage file 0 0% 4 888672 . offset 00000004
Press ENTER or close the window to quit
-------------------------------------------
it shows like this window.
first, i select a first script.
second, select a amagami.img.
third, select a unpacked folder.
i tried the test. wrote 4 byte more.
and then i tried the second test.
tried uncompress edited amagami.img (wrote a 4 byte file)
offset filesize filename
--------------------------------------
00000000 0 -.dat
00000000 0 00000001.dat
00000000 242 \.dat
000000f2 4294967138 \.dat
- The following output file already exists:
.dat
Do you want to overwrite it?
y = overwrite (you can use also the 'o' key)
n = skip (default, just press ENTER)
a = overwrite all the files without asking
r = automatically rename the files with the same name
s = skip all the existent files without asking
r
Error: impossible to write 0xffffff62 bytes (total 0xffffff62)
Check your disk space
Last script line before the error or that produced the error:
26 log NAME OFFSET SIZE
Press ENTER or close the window to quit
---------------------------
what should i do??
sorry~!
when i localize this game, i'll probably over those file's size.
because it takes longer to translate into Korean.
-
- Site Admin
- Posts: 12984
- Joined: Wed Jul 30, 2014 9:32 pm
Re: cpk file unpack error [Amagami]
Here all the step works BUT I guess there is a problem with the recompression algorithm, that's possible because it's a specific setting that has been never used before.
In short, it will be fixed in the next version of quickbms.
In the meantime I show you how the scripts must be used from command-line since it's more easy to understand the process:
Extract:
quickbms 1.bms AMAGAMI.IMG
quickbms 2.bms tmp.dat new_folder
Edit your files in new_folder
Reimport:
quickbms -r -w 2.bms tmp.dat new_folder
quickbms -r -w 1.bms AMAGAMI.IMG
As already said, the recompression algorithm doesn't work so the edited AMAGAMI.IMG WILL NOT WORK.
In short, it will be fixed in the next version of quickbms.
In the meantime I show you how the scripts must be used from command-line since it's more easy to understand the process:
Extract:
quickbms 1.bms AMAGAMI.IMG
quickbms 2.bms tmp.dat new_folder
Edit your files in new_folder
Reimport:
quickbms -r -w 2.bms tmp.dat new_folder
quickbms -r -w 1.bms AMAGAMI.IMG
As already said, the recompression algorithm doesn't work so the edited AMAGAMI.IMG WILL NOT WORK.
-
- Posts: 67
- Joined: Mon Jul 20, 2015 1:12 pm
Re: cpk file unpack error [Amagami]
Thank you for your kind answer!
I waiting for QuickBms's update.
Have a great day!
If I have a question, Il'll be back!
Thank you!
I waiting for QuickBms's update.
Have a great day!
If I have a question, Il'll be back!
Thank you!