KasperskyOS Community Edition 1.3

cas-inspect tool

The KasperskyOS Community Edition is delivered with the cas-inspect tool (toolchain/bin/cas-inspect executable file), which lets you get information about the contents of KPA package when working with SDK.

Syntax of the shell command for running the cas-inspect tool:

cas-inspect [-h|--help] [--version] {-i|--input} <PACKAGE> --verify [<COMMAND>] [-o <path>]

Parameters:

  • {-i|--input} <PACKAGE>

    Path to the KPA package (*.kpa file).

  • <COMMAND>

    Commands:

    • dump – prints to standard output the KPA package manifest and information about KPA package components, which includes the size in bytes (Size), offset in bytes (Offset – relative to the end of the KPA package manifest, and Absolute – relative to the start of the KPA package), and the checksum (Digest). This parameter is applied by default.
    • read <manifest|blobs|<hash> – prints the KPA package manifest (read manifest), the contents of all KPA package components (read blobs), or the contents of one KPA package component with the defined checksum (read <hash>). When using the -o <path> parameter, the output is printed to a file. Otherwise, it is printed to the standard output.
    • list – prints the checksum, offset (in bytes) relative to the start of the KPA package, and the size (in bytes) for all KPA package components to the standard output.
    • read-files <FILES>... – prints the contents of a KPA package component based on the component file name. You can specify multiple names of KPA package component files if you separate these names with a space. When using the -o <path> parameter, the output is printed to a file.
    • list-files – prints to standard output a list of all names of KPA package component files included in the KPA package manifest.
  • -o <path>

    Path to the file or directory for saving data when using the commands read {manifest|blobs|<hash>} and read-files <FILES>.... When printing the KPA package manifest (read manifest) or the contents of the KPA package component with the defined checksum (read <hash>), you must specify the file path. When printing the contents of all program components (read blobs), you must specify the path to the directory where each program component will be saved in a separate file with a name matching the checksum of the specific component. When printing the contents of all KPA package components (read-files <FILES>...), you must specify the path to the directory where each KPA package component will be saved in a separate file with the name of the specific component.

  • --verify

    Verification of the presence of all KPA package components specified in its manifest and the absence of unspecified KPA package components, and calculation of the checksums of KPA package components and their comparison with those specified in the KPA package manifest.

  • -h|--help

    Help text.

  • --version

    Tool version.

Examples of shell commands for running the cas-inspect tool:

# Prints the KPA package manifest and information about # KPA package components. cas-inspect -i helloworld.kpa # Prints the KPA package manifest and information about # KPA package components to the console, and verifies the availability of the KPA package components # specified in the manifest and the checksums of # KPA package components. cas-inspect -i helloworld.kpa --verify # Prints the KPA package manifest to a file. cas-inspect -i helloworld.kpa read manifest -o ./manifest # Prints the contents of the KPA package component with the defined # checksum to a file. cas-inspect -i helloworld.kpa read 5d8071308518a7bb003aa084fc995 d2f09b79e9e52f8cd296cb3ee2644ad3951 -o ./comp # Prints the contents of each KPA package component to a separate file. cas-inspect -i helloworld.kpa read blobs -o . # Prints information about KPA package components to the console. cas-inspect -i helloworld.kpa list