Pyimg4

Latest version: v0.8.6

Safety actively analyzes 687767 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 4

0.8

**Major Changes**
- The minimum required Python version is now 3.8.
- The compresison libraries are now an optional install for those who wish to install PyIMG4 without a build system.
- A `RuntimeError` will be raised if you attempt to use any compression functionality without the required libraries installed.
- To install these dependencies, you can use the `compression` extra: `python3 -m pip install pyimg4[compression]`
- The `pyimg4.IM4M` class is now much less restrictive, to aid in IM4M fuzzing (more on the changes below).
- `pyimg4.IM4R.boot_nonce` now prints the boot nonce in the correct endianness.
- Other miscellaneous fixes.

**API Changes**
- `pyimg4.ManifestProperty`
- Can now be called with a fourcc/value pair.
- `pyimg4.ManifestImageProperties`
- Can now be called without any data.
- `pyimg4.IM4M`
- Can now be called without any data.
- Added `IM4M.output()`
- Added `IM4M.add_image_properties()`/`IM4M.remove_image_properties()`
- Added `IM4M.add_property()`/`IM4M.remove_property()`

- `pyimg4.Keybag`
- A `KeybagType` is now only required when calling with a key/IV pair.


**Full Changelog**: https://github.com/m1stadev/PyIMG4/compare/v0.7...v0.8

0.7

Notes
This release reworks a lot of how certain classes work internally, mainly `pyimg4.IM4R`, `pyimg4.ManifestProperty`, and `pyimg4.ManifestImageData`.
- `pyimg4.ManifestProperty` has been renamed to `pyimg4._Property`, and a new `pyimg4.ManifestProperty` class has taken its place, which subclasses it
- Likewise, `pyimg4.ManifestImageData` has been renamed to `pyimg4._PropertyGroup`, and a new `pyimg4.ManifestImageProperties` class has taken its place, which subclasses it
- Multiple different types of properties & property groups found within Image4 formats are stored the same way, thus making it more convenient to only write one class each to parse them!

Major Changes
- Fix compressing payloads with LZFSE
- Add support for payload properties present in newer bootloader images (10)
- Add support for extra properties in Image4 restore info (19)
- Add more test cases
- Add more commands to CLi & improve upon some commands, see below

CLI Changes
- Add `pyimg4 img4 info` for printing information on an Image4 file
- Add `pyimg4 im4m verify` for verifying an IM4M with a build manifest
- `pyimg4 im4m info`
- Add `-v` flag for printing extra information
- `pyimg4 im4p info`
- The payload size is now rounded to 2 decimal places when printed
- Print payload properties, if any
- Add `-v` flag for printing extra information
- Print the decompressed size of a payload that is both LZFSE-compressed and encrypted.
- `pyimg4 im4r info`
- Print extra properties, if any

API Changes
- `pyimg4.ManifestProperty` -> `pyimg4._Property`
- Add `.output()` to output the ASN.1-encoded property
- `.name` -> `.fourcc`
- Accepts `fourcc` and `value` as keyword arguments in place of passing ASN.1 data
- NEW: `pyimg4.ManifestProperty`
- Used to both store a property for an image (such as DGST and EPRO) inside of an Image4 manifest, and store a property for the Image4 manifest itself
- Not meant to be called directly
- `pyimg4.ManifestImageData` -> `pyimg4._PropertyGroup`
- Properties stored as list in `_PropertyGroup._properties`
- Add `.output()` to output all stored ASN.1-encoded properties
- NEW: `pyimg4.ManifestImageProperties`
- Used to store a group of `ManifestProperty`s for an image inside of an Image4 manifest
- Add `.digest` property for fetching digest of image
- NEW: `pyimg4.RestoreProperty`
- Used as a property for Image4 restore info
- Nothing changed from `_Property`
- `pyimg4.IM4R`
- Now subclasses `_PropertyGroup`
- Can add/remove properties via `.add_property()`/`.remove_property()`
- `.boot_nonce` property still exists for easy setting/retrieving of boot nonce
- NEW: `pyimg4.PayloadProperty`
- Used as a property for Image4 payload info
- Nothing changed from `_Property`
- `pyimg4.IM4P`
- Add `.properties` attribute for viewing payload properties
- `pyimg4.IM4PData`
- `keybags` is no longer accepted as an argument
- To add/remove keybags, use `.add_keybag()`/`.remove_keybag()`

Full Changelog: https://github.com/m1stadev/PyIMG4/compare/v0.6.3...v0.7

0.6.3

This update only has bugfixes and slight API changes.

**Major Changes**
- Fix support for some IM4Ps that would be invalid when outputting via `IM4P.output()`
- In `IM4PData`, if you have a payload that is both LZFSE-compressed and encrypted (These are commonly used in bootloader images for A11 and above devices), you now must set the uncompressed size of the payload using `IM4PData.set_lzfse_payload_size()`, or else the IM4P will be invalid when outputting. If you are passing an IM4P to the `IM4P` class, it will automatically do it for you.

**API Changes**
- `pyimg4.Compression`
- Add `Compression.LZFSE_ENCRYPTED` for encrypted + LZFSE-compressed payloads
- Removed `Compression.UNKNOWN`
- This enum was only used for detecting encrypted payloads. You should now transition over to using the `IM4PData.encrypted` property for detecting whether a payload is encrypted.


**Full Changelog**: https://github.com/m1stadev/PyIMG4/compare/v0.6.2...v0.6.3

0.6.2

Mostly a bugfix update, but the API has been slightly changed as well.

**Major Changes**
- Support for "extra" data in `complzss` payloads in the CLI (A.K.A. KPP binary on A7-A9 kernelcaches)
- Fix `pyimg4 im4p extract`
- Cleaner error messages in the CLI

**API Changes**
- `pyimg4.IM4PData`
- `IM4PData.output()` now returns a named tuple with the data and any ASN.1-formatted keybags, if present
- `IM4PData.__repr__()` now returns the length in hexadecimal
- `pyimg4.IM4M`
- `IM4M.apnonce` is now returned as `bytes` instead of `str`
- `IM4M.sepnonce` is now returned as `bytes` instead of `str`


**Full Changelog**: https://github.com/m1stadev/PyIMG4/compare/v0.6.1...v0.6.2

0.6.1

Small update to fix the CLI on Python 3.8 and below.

0.6

**Major Changes**
- Added a CLI tool! ([usage](https://github.com/m1stadev/PyIMG4#usage))
- Use proper names for Image4 format in some places (e.g. IM4P -> Image4 payload)
- Add special methods to `pyimg4._PyIMG4`
- `_PyIMG4.__bytes__`: Returns `_PyIMG4.output()`
- `_PyIMG4.__eq__`: Attempts to compare output to the object being compared's output if the object is a subclass of `_PyIMG4`, or compares the output directly if the object being compared is `bytes`
- `_PyIMG4.__len__`: Returns `len(_PyIMG4.output())`


**API Changes**
- `pyimg4.IM4M`
- Added `IM4M.board_id`
- `IM4M.rsa` -> `IM4M.signature`
- `IM4M.cert` -> `IM4M.certificates`
- `pyimg4.KeybagType`
- `KeybagType.RELEASE` -> `KeybagType.PRODUCTION`
- `KeybagType.INTERNAL` -> `KeybagType.DEVELOPMENT`


**Full Changelog**: https://github.com/m1stadev/PyIMG4/compare/v0.5.2...v0.6

Page 2 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.