Repository navigation
Conversation
Symptom: the reader and writer used a layout of their own - a 4-byte header where ALZip writes 8, size-field widths read from the wrong nibble (0x20 taken as 4 bytes, ALZip means 2), size fields expected on directory entries that have none, and an invented end record. Real ALZip archives misparsed after the first entry and our output was not ALZip. Change, following unalz and XADMaster: - "ALZ\x01" + version header, "BLZ\x01" local headers with 0/1/2/4/8 byte size fields, "CLZ\x01"/"CLZ\x02" end records, split-marker and comment records recognised, CP949 names; - methods: stored, deflate, and ALZip's bzip2 variant (no stream header, "DLZ\x01" block markers, no block CRC or randomised bit, "DLZ\x02" end; Bzip2Decompressor's block body is now reusable for it); obfuscated deflate (method 3) is refused; - ZipCrypto decryption with the 12-byte header check, and encryption on create; every member verified against its CRC-32; - the in-place modifier wrote the invented layout and is removed; edits go through the verified rebuild. Evidence: unalz's CC0 test archives written by ALZip (stored, deflate, ALZ bzip2, ZipCrypto, CP949 names, directories) extract exactly as unalz 0.2.1 extracts them; unalz extracts three archives our writer produced (stored, deflate, encrypted, a CP949 name), and the writer reproduces the unencrypted two byte for byte. Sourcing: rung 1, alkegi/unalz (MIT) and XADMaster XADALZipParser (LGPL-2.1), notice beside the code; fixtures CC0.
Retain ALZip and main reference resources together, keep main artwork, and regenerate Core and Archives API documentation for the ALZ bzip2 support and real-layout reader. Verified: Release solution build, 148 focused format/codec/documentation/provenance tests passed with 3 tool-dependent skips, documentation generation completed without errors.
ALZip and NSIS both changed the bzip2 block decoder, while the maintenance table omitted supported wiping. Share the ALZip block-body entry point with both standard and NSIS framing and correct the table. Verified solution build, 197 focused tests covering both formats and bzip2, and three package documentation generators.
Adding a second named payload to Intel HEX could silently discard a file because the shared image builder kept only the first payload in filesystem enumeration order. Reject multiple non-metadata payloads, including an empty first payload, before any output is written. Tests verify creation refusal and byte-preserving add refusal. Verified all three regressions fail before the fix and pass after it, 93 focused tests, 34280 required tests with 1582 skips and no failures, and three package documentation checks.
Bring the firmware payload validation fix onto current main after partitioned-disk support merged. Verified solution build, 299 focused tests and all three package documentation checks; the preceding required suite passed 34280 tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ALZip read and wrote a layout of its own: a 4-byte header, wrong size-field widths, and size fields on directory entries. This replaces it with the real format, following unalz (MIT) and XADMaster's XADALZipParser (LGPL-2.1).
Reader
BLZ\x01local headers with 0/1/2/4/8-byte size fields, and theCLZ\x01/CLZ\x02end records. CP949 names.DLZblock markers, no CRCs).Writer
Bzip2 change
Bzip2Decompressor's block-body decoding is factored out soAlzBzip2can reuse it. The standard bzip2 path is unchanged and its tests pass.Verification (
AlZipReferenceTestsplus the existingAlZipTests; provenance inCompression.Tests/AlZip/ReferenceVectors/README.md)Integration update: depends on #537 for shared Intel HEX payload validation exposed by the required Linux suite. The dependency is integrated for CI and must land first; after it merges, the remaining diff is this PR's format change. The refreshed solution build and focused format, firmware, README and architecture checks pass.