image4-util

Crates.ioimage4-util
lib.rsimage4-util
version0.5.2
sourcesrc
created_at2023-05-09 17:47:41.900243
updated_at2023-08-06 13:45:50.613748
descriptionPure Rust tool for handling Image4 files (aka IMG4, IM4P, IM4M, IM4R).
homepage
repositoryhttps://gitlab.com/turbocooler/image4-rs
max_upload_size
id860716
size110,239
(turbocool3r)

documentation

README

image4-util

Crate

Pure Rust tool for handling Image4 files (aka IMG4, IM4P, IM4M, IM4R).

Features

  • Extract payload contents from either Image4 containers (IMG4) or Image4 payload files (IM4P).
  • Create either full Image4 containers or Image4 payload files.
  • Decrypt encrypted images using known AES key and IV.
  • Decompress images compressed using LZSS and LZFSE (LZVN is not supported yet).
  • Parse, create and sign Image4 manifests. Both signed and unsigned manifests are supported.
  • Create certificates for signing Image4 manifests.

Installation

cargo install image4-util

Logging

The logging implementation is based on the env_logger crate. There are 3 log levels: info, warn and error (non-release builds support the debug log level). By default, only warning and error levels are enabled. You can set a different minimum log level using the IMAGE4_LOG environment variable (set to off to turn off the logging completely).

Example:

By default image4-util isn't verbose:

$ image4-util extract --iv xxx --key xxx -v llb.im4p
[?] File at llb.bin exists. Do you want to replace it? yes
$

It's quite verbose, however, if you enable the info log level.

$ IMAGE4_LOG=info image4-util extract --iv xxx --key xxx llb.im4p
[*] Extracting file at 'llb.im4p' to 'llb.bin'.
[*] 4CC tag: illb
[*] Builder string: iBoot-7429.41.5
[?] File at llb.bin exists. Do you want to replace it? yes
[*] Decompressed 606278 bytes into 1319704 bytes.
[*] Success.
$

Here instead of xxx will be your actual key and IV.

Minimum Supported Rust Version

This crate requires at least Rust 1.65. An MSRV change will be accompanied by a minor version bump

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Commit count: 182

cargo fmt