2024-01-02 07:02:55 +00:00
|
|
|
# icf-reader
|
|
|
|
|
|
|
|
Tools for decoding, decrypting and encrypting ICFs
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
```shell
|
2024-01-02 10:40:16 +00:00
|
|
|
Usage: icf-reader.exe <COMMAND>
|
|
|
|
|
|
|
|
Commands:
|
|
|
|
encrypt Fixes some common ICF errors, then encrypt the given ICF
|
|
|
|
decrypt Decrypts the given ICF
|
|
|
|
decode Decodes the given ICF (optionally to a JSON file)
|
|
|
|
encode Encodes a JSON file from the decode subcommand to an ICF
|
|
|
|
help Print this message or the help of the given subcommand(s)
|
|
|
|
|
|
|
|
Options:
|
|
|
|
-h, --help Print help
|
2024-01-02 07:02:55 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
Encrypting the ICF will also correct CRC checksums, so worrying about the
|
|
|
|
correct checksum is not needed.
|
|
|
|
|
2024-01-02 10:40:16 +00:00
|
|
|
## Creating an ICF file from JSON
|
|
|
|
The JSON file is an array of `IcfData`, which follows the format below:
|
|
|
|
```typescript
|
2024-03-22 09:06:06 +00:00
|
|
|
// Version can also be specified as a string with *exactly* three components:
|
|
|
|
// - "80.54.01": OK
|
|
|
|
// - "80.54.01.00": NG
|
2024-01-02 10:40:16 +00:00
|
|
|
interface Version {
|
|
|
|
major: number;
|
|
|
|
minor: number;
|
|
|
|
build: number;
|
|
|
|
}
|
|
|
|
|
|
|
|
interface IcfInnerData {
|
|
|
|
type: "System" | "App",
|
|
|
|
id: string, // Must be 3 characters for "System" and 4 characters for "App"
|
|
|
|
version: Version,
|
|
|
|
required_system_version: Version,
|
|
|
|
datetime: string, // ISO8601 string yyyy-MM-dd'T'HH:mm:ss
|
2024-01-02 17:34:18 +00:00
|
|
|
is_prerelease: boolean,
|
2024-01-02 10:40:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IcfOptionData {
|
|
|
|
type: "Option",
|
|
|
|
option_id: string, // Must be 4 characters
|
|
|
|
datetime: string, // ISO8601 string yyyy-MM-dd'T'HH:mm:ss
|
2024-01-02 17:34:18 +00:00
|
|
|
is_prerelease: boolean,
|
2024-01-02 10:40:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
interface IcfPatchData {
|
|
|
|
type: "Patch",
|
|
|
|
|
|
|
|
sequence_number: number, // Incremented for every patch, starting from 1
|
|
|
|
|
|
|
|
source_version: Version,
|
|
|
|
source_datetime: string, // ISO8601 string yyyy-MM-dd'T'HH:mm:ss
|
|
|
|
source_required_system_version: Version,
|
|
|
|
|
|
|
|
target_version: Version,
|
|
|
|
target_datetime: string, // ISO8601 string yyyy-MM-dd'T'HH:mm:ss
|
|
|
|
target_required_system_version: Version,
|
2024-01-02 17:34:18 +00:00
|
|
|
|
|
|
|
is_prerelease: boolean,
|
2024-01-02 10:40:16 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
type IcfData = IcfInnerData | IcfOptionData | IcfPatchData;
|
|
|
|
```
|
|
|
|
|
|
|
|
At least one entry of type `System` and `App` must be specified.
|
|
|
|
|
|
|
|
When done, create your ICF using `icf-reader.exe encode input.json output.icf`.
|
|
|
|
|
2024-01-02 07:02:55 +00:00
|
|
|
## Building
|
|
|
|
```
|
|
|
|
ICF_KEY=<key> ICF_IV=<iv> cargo build --release
|
|
|
|
|
|
|
|
ls target/release/icf-reader.exe
|
|
|
|
```
|