Помогите разобраться в принципе работы CRI File System Tools 2.40.13.0

Скачать можно отсюда

Спойлер

https://yadi.sk/d/aN8mV0uaAhtjoQ

Служит для работы с форматом файлов .cpk.
Сама программа проста в работе (может как распаковывать этот формат, так и создавать новый .cpk из любых файлов). Сложности у меня с её консольной версией (работает через CMD командную строку виндовс).
инструкция по работе с консольной версией в архиве по ссылке выше (называется CRI_File_System_Tools_Manual_e.chm).
Вот текст из инструкции (лучше ознакомиться в оригинале, т.к там есть и фото).
Два вопроса к знающим: как через эту программу Распаковать файл формата .cpk. И как потом полученные папки запаковать обратно. Работа с обычной (не через cmd) версией не подходит- запакованный с её помощью архив игра не видит и не запускается. Требуется именно работа через версию 2.49.32 (консольная).

Спойлер

About console version CRI Packed File Maker
Overview of the tool

Console version CRI Packed File Maker is the console tool to create a CPK file.
Note that the addition function and group function in the description are the functions of the FileMajik PRO.

Features

Easy to customize
Console version CRI Packed File Maker inputs information for packing files in a CSV file (text file where parameters are separated by a comma).
You can embed this tool into your own system so that, for example, your original tool in your system generates a CSV file and then call this the tool.



Configuration of the tool

The configuration of the tool is as follows:
Configuration of the tool File name Description
cpkmakec.exe Executable file of the Console version CRI Packed File Maker.
CpkMaker.dll DLL file required for the executable file of the main body.
This DLL file is shared with the GUI version tool.



Data flow

This tool creates a CPK file using a CSV file as input.


fs_cpk_makec_data_flow.png

Спойлер

Command format
Start the command prompt, and in the command line, input a command in the following format.


[Format] cpkmakec Input_CSV_filename Output_CPK_filename Options
[Input] Input_CSV_filename : Input CSV file name
Output_CPK_filename : Output CPK file name
Options : Command option



Input CSV file name

The text file of CSV file format describing the file to be included in the CPK file.
When a directory is specified instead of the CSV file name, the files under the specified directory will be packed.

Output CPK file name

Specify the CPK file you want to output.
If the CPK has already existed, the file is overwritten.

Command option

Options to switch various functions. The following options are provided:
If nothing is input in the command line, the description of the command appears.

-dir=[Current Directory]

Specify the current directory where you want to execute commands.
If omitted, the location where you executed a command is considered the current directory.

-align=[Alignment size]

Specify the alignment size of the data.
For the alignment, you can specify a value between 1 and 32768 in the power of 2.
For example, when "-align=8" is specified, the data has the allocation boundary of 8-byte alignment.
If omitted, the data have 2048-byte alignment

-code=[SJIS|EUC|UTF-8]

Specify the text code of a CSV file.
-code=SJIS Load a CSV file as in Shift JIS. Default.
-code=SJIS Load a CSV file as in EUC.
-code=UTF-8 Load a CSV file as in UTF-8 (Unicode).


-mode=[ID|FILENAME| FILENAME ID |FILENAMEGROUP|IDGROUP]

Specify information you want to include in the CPK file.
-mode=ID "ID Only"
Includes the ID in the CPK file. Default.
-mode=FILENAME "Filename Only"
Includes the fine name in the CPK file. The ID is not included.
-mode=FILENAMEID "Filename + ID"
Includes the ID and file name in the CPK file.
-mode=FILENAMEGROUP "Filename + Group (Attribute)" (FileMajik PRO)
Includes the file name and group information in the CPK file.
-mode=IDGROUP "ID + Group (Attribute)" (FileMajik PRO)
Includes the ID and group name in the CPK file.
-mode=FILENAMEIDGROUP "Filename + ID + Group (Attribute) " (FileMajik PRO)
Includes the file name, ID, and group name in the CPK file.


-header=[Header Filename]

Outputs the header file (.h) where the ID information is defined.
If the file name is omitted, the name of this is the same as the output CPK file name.

-mask

Encrypts the directory information in the CPK file.
If omitted, this function is disabled.
The data itself is not encrypted.

-forcecompress

Attempts to forcibly compress all the files.

-fileunification

Centralizes the files having the same content.
Putting multiple duplicated files into one file reduces the size of the CPK file.

-add

Makes addition to the CPK file. (FileMajik PRO)
Compare the files written in the CSV file with the CPK file to which information is to be added, and add information of only the updated files.
If a file has been deleted from the CSV file, the file in the CPK file will be deleted. At this time, the CPK file size does not decrease.
Note that when addition is made, the files may not be allocated as expected.
Addition is unavailable in the ID mode.
If the file where compression is specified cannot be actually compressed, the file may be added.

-addrange=[CSV file name]

The option to output in CSV format the information on the range of CPK file update caused by additional build.
The CSV file records the start position (byte) and the size (byte) as the update range; the range of one record per row.
Both of the information to be recorded are singed decimal 64-bit integers.
When this option is specified for clean build, the entire CPK files is considered to be updated, and this update range will be output.
Example of update range to be output by additional build Note
0, 2048 Update range of CPK file header
45023232, 409800 Update range of CPK file end
Example of update range to be output by clean build Notes
0, 45023416 Entire CPK file

Do not assume that there are only one or two updates. The update range may vary in response to future specification changes.
Using this information allows you to minimize the data required to be transmitted to the actual environment. Note that this is somewhat high level because the user must correctly re-build the CPK file on their own.

-duplicate

Duplicates a group file. (FileMajik PRO)
If a file described in the CSV file belong to multiple groups, materializes and packs those files. Duplicating files may increase the performance of group load.
Without this option specified, only the group file written first is materialized, and the subsequent group files refer to the first file.
For example, when groups for the files are specified as "GroupA, GroupB" for this option, the files are duplicated and packed into two groups.

-crc

Adds the CRC information of each content file to the CPK file. (FileMajik PRO)
Use this option only when performing the CRC check on each file.
The size of the CPK file increases by 4 bytes per file.

-nogroupsort

Disables the file allocation sort for each group. (FileMajik PRO)
When outputting a CPK file with group information, the related files are closely allocated with each other for each group. With this option specified, the files are allocated in the order of the files written in a CSV file.
This is useful when individually loading files for optional file allocation. On the other hand, the performance of group load may decrease.

-rand

Uses random values to pad the area that is usually filled with zeros in the CPK file. (FileMajik PRO)

-shortdefine

Shortens the definition name written in the header name to be output. (FileMajik PRO)
Only the file name is used while the definition name usually consists of the file name and the directory name.

-nolocalinfo

Not includes local information in the CPK file. (FileMajik PRO)
The local information is necessary for addition, and thus without it, addition cannot be performed. Meanwhile, without this information, the CPK file size can be reduced. (In the ID Only file mode, this information is not include from the beginning.)

-nodatetime

Disables the time stamp in the CPK file. (FileMajik PRO)
The time stamp is necessary information for addition, and thus without it, addition cannot be performed.
Use this option when a problem occurs if the binary information changes every time a CPK file is created.

-notoptocinfo

Moves the file information in the CPK file from the beginning of the file to the end. (FileMajik PRO)
For CPK File Builder Ver. 1.07 and later and CRI Packed File Maker Ver. 2.07 and later, the file information is placed at the beginning of the file by default. Use this option to reset to the conventional file allocation.
Moving the file information to the beginning of the CPK file may speed up the mount processing.

-compper=[Percentage]

Specifies the threshold of the compressibility for compression.
With -compper=50.0 specified, compression is performed when the compressibility of the file is 50% or less. In that case, the file with the compressibility of 80% is not to be compressed.

-compfilesize=[FileSize]

Specifies the threshold of the file size for compression.
With -compfilesize=10000 specified, a file whose original size is 10000 bytes or less is not compressed. At this time, a file whose size is 5000 bytes or more is uncompressed.

-groupalign=[GroupAlignmentSize]

Specify the first file alignment in the grouped files valid for a group load.
This is enabled only when the group information is valid.

-attralign=[AttribuleAlignmentFile]

This is the option used to specify alignment for each attribute.
As the attribute alignment file, input the file containing the attribute name and the alignment size separated with each other with a comma. When specifying multiple attributes, write one attribute per line.
This is enabled only when the group information is valid.

-view

Shows the detailed information on the CPK after creating a CPK file.

-noerrorstop

When an error occurs, the tool does not wait for a key input.

Order of allocating files

The actual order of allocating files in the CPK file differs depending on the CPK file mode.
ID Only Allocates the files in the ascending order of IDs.
Filename Only Allocates the files in the order of those written in the CSV file.
Filename + ID Allocates the files in the order of those written in the CSV file.
Filename + Group (Attribute) Allocates the files in the same group or having the same attribute closely with each other.
With -nogroupsort specified, the files are allocated in the order of those written in the CSV file.
ID + Group (Attribute) Allocates the files in the same group or having the same attribute closely with each other.
With -nogroupsort specified, the files are allocated in the order of those written in the CSV file.
Filename + ID + Group (Attribute) Allocates the files in the same group or having the same attribute closely with each other.
With -nogroupsort specified, the files are allocated in the order of those written in the CSV file.


Order of files belonging to a group

The order of files belonging to a group differs depending on the specified option.
With -nogroupsort specified The files are allocated in the order of those written in the CSV file.
Other than the above The files are allocated for group load to be most optimally performed. (Undefined)


Displaying CPK file information

You can display the information on a created CPK file.

Specify only a CPK file name for the command argument.



[e.g.] Displaying the information in the CPK file, sample.cpk

cpkmakec sample.cpk


By specifying also the following comma option, the CPK file information can be output in the CSV format.
-exportcpkinfo=[OutputCsvFilename]

Outputs the CPK file information in the CSV format.



CPK file verification function

You can compare and verify the content of a created CPK file with that of the original file.

[e.g.] Verifying the CPK file, sample.cpk, created with input.csv.

cpkmakec input.csv sample.cpk -verify


Check if the content file in the CPK is consistent with the original file, and if not matched, an error occurs.
If an error occurs, the environment variable, errorlevel, is other than 0.

Спойлер

CSV file format
This section describes how to write a CSV file where file information is to be input.

When not using groups or attributes

In a CSV file, write the file information per line.

File path name, ID, Compress/Uncompress




The file path name does not necessarily have to be the full path.
The file path must be able to be referred to from the current directory at the time of execution.
If ID is omitted, the value of the previous ID plus 1 is applied. If all the values are omitted, numbers starting with 0 are applied.
The same ID cannot be specified multiple times.
If Compress/Uncompress is omitted, this item is set to Uncompress.
The wording, Compress or Uncompress, can be substituted with C or UC, respectively.
The path separator can be "\" or "/".

The following shows an example:

c:\data\tex1.dat, 100, Compress
c:\data\tex2.dat, , Compress
c:\music\bgm1.snd, 200, Uncompress
c:\music\bgm2.snd, , Uncompress




You can specify the content file name in the CPK file as you like.
To specify the name, add a content file name for the second value.
A content file name can include the directory.


The following shows an example:

c:\data\tex1.dat, data\tex1.dat, 100, Compress
c:\data\tex2.dat, data\tex2.dat, 101, Compress
c:\music\bgm1.snd, music\bgm1.dat, 200, Uncompress
c:\music\bgm2.snd, music\bgm2.dat, 201, Uncompress



"data\\tex1.dat" and such others are the content file names. A content file name does not have to be the same as the original file name.

When using groups or attributes

When using group information, write as follows:


File path name, content file name, ID, Compress/Uncompress, group name, attribute name


If a file belongs to multiple groups, enclose the groups with double quotations while separating those groups with a comma.

An attribute can be omitted.



The following shows an example:
c:\data\tex1.dat, data\tex1.dat, 0 , C, "GROUP_A", ATTR_A
c:\data\tex2.dat, data\tex2.dat, 1 , C, "GROUP_A", ATTR_A
c:\music\bgm1.snd, music\bgm1.snd, 2 , UC, "GROUP_A, GROUP_B", ATTR_A
c:\music\bgm2.snd, music\bgm2.snd, 3 , UC, "GROUP_B", ATTR_A

Комментарии: 0
Ваш комментарий