Skip to content

Add support for compressed streaming archives#844

Open
dinhngtu wants to merge 1 commit into
M2Team:mainfrom
dinhngtu:compressedtar
Open

Add support for compressed streaming archives#844
dinhngtu wants to merge 1 commit into
M2Team:mainfrom
dinhngtu:compressedtar

Conversation

@dinhngtu
Copy link
Copy Markdown
Member

@dinhngtu dinhngtu commented Feb 22, 2026

Add 5 new handlers CompressedTar, AutoDeb, AutoDebUncompressed, AutoRpm, AutoRpmUncompressed for decompression of the associated file formats.

All 5 are based on the CompressedStreamArchive handler base and should respect K7 mitigation policies.

CompressedStreamArchive works by caching all inner archive metadata on open, decompressing the inner archive on-the-fly and merging some inner/outer props via GetArchiveProperty. Handlers configure CompressedStreamArchive by passing a CompressedStreamArchiveInfo struct containing outer and inner CArcInfo. Handlers can pick which member in the outer archive to extract (e.g. DEB selects the 2nd member to get the data.tar instead of control.tar)

CompressedStreamArchiveInfo is discovered from within g_Arcs via calling the new function LookupArchiveInfo on CLSIDs provided in CoreExports.hpp. Due to this current dependency on NanaZip.Core internals, the handlers and handler base are all hosted in NanaZip.Core.

Add two new handler flags kCompositeArc and kLongExtension to deal with the new handlers. Particularly, kCompositeArc is needed to bypass these handlers in Open Inside * mode. kLongExtension doesn't seem to really matter but was included for completeness.

Known issues: open progress and open cancelling are not implemented, since CompressedStreamArchive does not monitor the opener progress (to simplify the code; see "Fix CompressedTar management of inner handler" for the removal of the progress monitor)

Tests: https://github.com/M2Team/K7Tests/tree/compressedtar (to be merged after this PR)



@MouriNaruto
Copy link
Copy Markdown
Member

MouriNaruto commented Feb 23, 2026

I think I should introduce some changes before I merge this PR, because I want to reduce some dependencies on 7-Zip mainline definitions. For example, we should try to use NanaZip.Specification/NanaZip.Specification.SevenZip.h, we should improve if this lacks some definitions.

Kenji Mouri

@dinhngtu dinhngtu force-pushed the compressedtar branch 2 times, most recently from 1ede22c to e6e4ba1 Compare April 25, 2026 13:29
Add 5 new handlers CompressedTar, AutoDeb, AutoDebUncompressed, AutoRpm,
AutoRpmUncompressed for decompression of the associated file formats.

All 5 are based on the CompressedStreamArchive handler base and should
respect K7 mitigation policies.

CompressedStreamArchive works by caching all inner archive metadata on
open, decompressing the inner archive on-the-fly and merging some inner/
outer props via GetArchiveProperty. Handlers configure
CompressedStreamArchive by passing a CompressedStreamArchiveInfo struct
containing outer and inner CArcInfo. Handlers can pick which member in
the outer archive to extract (e.g. AutoDeb selects the 2nd member to get
the data.tar instead of control.tar).

CompressedStreamArchiveInfo is discovered from within g_Arcs via calling
the new function LookupArchiveInfo on CLSIDs provided in
CoreExports.hpp. Due to this current dependency on NanaZip.Core
internals, the handlers and handler base are all hosted in NanaZip.Core.

Add two new handler flags kCompositeArc and kLongExtension to deal with
the new handlers. Particularly, kCompositeArc is needed to bypass these
handlers in Open Inside * mode. kLongExtension doesn't seem to really
matter but was included for completeness.

Signed-off-by: Tu Dinh <contact@tudinh.xyz>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants