Repository navigation
Conversation
Collaborator
Author
|
@codex review |
… the first (#365) A later member of a 7zAES-over-Copy folder (folder offset s > 0) now maps as OutputMapping::CbcSkip { skip }: its pieces are the folder ciphertext from the block before the one holding s (0 when s < 32) to the end of the block holding its last byte, and output byte o is stream byte o + skip (folder byte s + o). packed_spans, MemberReader, member_restart / open_at (StoredCbc / Block16 with stream_start = s) and probe handle it; the feed decoder refuses it with FeedUnsupported::CbcSkip. The first member stays CbcBlocks, unchanged. Member offsets use checked arithmetic, and a folder whose packed stream ends before a member's last block is Malformed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gYJFfVCupfunL2idYi
…r-block phase, probe and small-offset tests - A later member whose blocks run past the folder's packed stream stays OutputMapping::None (readers refuse it) instead of failing the whole map; only the first member running past is Malformed, as before. - open_at takes the block phase from the CbcSkip prefix; member_restart, open_at and MemberReader validation reject a folder offset the prefix does not put on a folder block (new OpenAtError::Malformed). - Tests: damaged pack sizes map with f.bin unmapped and a-e reading exact, extraction of a whole-block cut keeps a-e; a hand-edited prefix; probe on a later member named .mkv (media.7z); members at folder offsets 5, 16, 32, 39, 48, 81 (small.7z) read every range exact. - Docs: CbcSkip block-0 note, extract-member-from refusals, member-map damage row, persisted DirectPartial keys of such members. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gYJFfVCupfunL2idYi
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gYJFfVCupfunL2idYi
xbmc4lyfe
force-pushed
the
sevenzip-cbc-every-member
branch
from
November 30, 2026 19:55
8ef252a to
a9e8d3e
Compare
Collaborator
Author
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.
Closes #365 (RustyGet#816, prybar#228).
In a 7zAES-over-Copy folder, members after the first now map to their folder's CBC blocks, and can be read by range and restarted. Before, only the member at folder offset 0 had a direct mapping.
How it works
OutputMapping::CbcSkip { skip }, is used for a member at folder offsets > 0. The enum is#[non_exhaustive].s < 32, and end at the end of the block holding the member's last byte.ois stream byteo + skip, which is folder bytes + o.CbcBlocks, so every existing check on that variant behaves as before.packed_spans,MemberReader,member_restart/open_at(StoredCbc/Block16,stream_start = s) andprobeall handle the skipped prefix.FeedUnsupported::CbcSkip. Before, they were refused asUnmappedCipher.Malformed.Visible changes for later members
packed_sizenow counts their blocks plus the IV block, so neighbouring members' pieces overlap by 16 to 32 bytes.Tests
tests/sevenzip_cbc_members.rs, run on a single archive and a 3-volume split. The fixtures were made with 7-Zip 26.06 and the README gives the commands. The tests cover:MemberReaderwhose reads equalpacked_spans;member_restartreports;tests/member_map_7z.rsis updated for the new mapping.Clean-room: written from the 7z format docs and AES-CBC, plus the behaviour of the 7-Zip binary. No source was read.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LG44gYJFfVCupfunL2idYi