[PR #573] [MERGED] Add read-only support for Dmg archives #1111

Open
opened 2026-01-29 22:19:03 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/adamhathcock/sharpcompress/pull/573
Author: @Artentus
Created: 2/17/2021
Status: Merged
Merged: 6/4/2021
Merged by: @adamhathcock

Base: masterHead: master


📝 Commits (6)

  • 5faa603 Merge pull request #1 from adamhathcock/master
  • d5e6c31 Merge pull request #2 from adamhathcock/master
  • 9600709 Add read-only support for DMG archives
  • 014ecd4 Merge pull request #3 from adamhathcock/master
  • d5cbe71 Revert global.json
  • 5acc195 Merge branch 'master' into master

📊 Changes

39 files changed (+3606 additions, -4 deletions)

View changed files

📝 src/SharpCompress/Archives/ArchiveFactory.cs (+15 -2)
src/SharpCompress/Archives/Dmg/DmgArchive.cs (+117 -0)
src/SharpCompress/Archives/Dmg/DmgArchiveEntry.cs (+32 -0)
📝 src/SharpCompress/Common/ArchiveException.cs (+5 -0)
📝 src/SharpCompress/Common/ArchiveType.cs (+2 -1)
src/SharpCompress/Common/Dmg/DmgBlockDataStream.cs (+323 -0)
src/SharpCompress/Common/Dmg/DmgEntry.cs (+52 -0)
src/SharpCompress/Common/Dmg/DmgFilePart.cs (+21 -0)
src/SharpCompress/Common/Dmg/DmgUtil.cs (+183 -0)
src/SharpCompress/Common/Dmg/DmgVolume.cs (+38 -0)
src/SharpCompress/Common/Dmg/HFS/HFSCatalogRecord.cs (+336 -0)
src/SharpCompress/Common/Dmg/HFS/HFSExtentDescriptor.cs (+31 -0)
src/SharpCompress/Common/Dmg/HFS/HFSExtentRecord.cs (+115 -0)
src/SharpCompress/Common/Dmg/HFS/HFSFinderInfo.cs (+145 -0)
src/SharpCompress/Common/Dmg/HFS/HFSForkData.cs (+50 -0)
src/SharpCompress/Common/Dmg/HFS/HFSForkStream.cs (+196 -0)
src/SharpCompress/Common/Dmg/HFS/HFSKeyedRecord.cs (+91 -0)
src/SharpCompress/Common/Dmg/HFS/HFSPermissions.cs (+35 -0)
src/SharpCompress/Common/Dmg/HFS/HFSStructBase.cs (+187 -0)
src/SharpCompress/Common/Dmg/HFS/HFSTreeHeaderRecord.cs (+108 -0)

...and 19 more files

📄 Description

As the title suggests, this adds support for reading and extracting Dmg archives.
Only Dmg archives that use the GPT partitioning scheme with a HFS+ or HFSX data partition are supported, but that should cover the large majority of Dmgs out there (any DMGs created on MacOS 8.1 and newer will have this format).

I didn't see any way of implementing this as read-through so only the archive API is available.
Unfortunately I'm not able to provide test data as I don't have access to a Mac to create Dmgs. I have tested extensively using my own data but I cannot share that data publicly. Hopefully someone else will be kind enough to provide those.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/adamhathcock/sharpcompress/pull/573 **Author:** [@Artentus](https://github.com/Artentus) **Created:** 2/17/2021 **Status:** ✅ Merged **Merged:** 6/4/2021 **Merged by:** [@adamhathcock](https://github.com/adamhathcock) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (6) - [`5faa603`](https://github.com/adamhathcock/sharpcompress/commit/5faa603d5964f038f09f6e4779f615712d3a6934) Merge pull request #1 from adamhathcock/master - [`d5e6c31`](https://github.com/adamhathcock/sharpcompress/commit/d5e6c31a9f7aa3c6fb1dc88f2afd7cf08365fd10) Merge pull request #2 from adamhathcock/master - [`9600709`](https://github.com/adamhathcock/sharpcompress/commit/9600709219ab1a8f6419a6cfc1e3268edc252809) Add read-only support for DMG archives - [`014ecd4`](https://github.com/adamhathcock/sharpcompress/commit/014ecd4fc1c24de5ad4b3c59769d1c496d6638f3) Merge pull request #3 from adamhathcock/master - [`d5cbe71`](https://github.com/adamhathcock/sharpcompress/commit/d5cbe71cae28c62d04587beffaee8986ec63e81d) Revert global.json - [`5acc195`](https://github.com/adamhathcock/sharpcompress/commit/5acc195cf737c39ba43f4a96ff0ac3c492ec778c) Merge branch 'master' into master ### 📊 Changes **39 files changed** (+3606 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `src/SharpCompress/Archives/ArchiveFactory.cs` (+15 -2) ➕ `src/SharpCompress/Archives/Dmg/DmgArchive.cs` (+117 -0) ➕ `src/SharpCompress/Archives/Dmg/DmgArchiveEntry.cs` (+32 -0) 📝 `src/SharpCompress/Common/ArchiveException.cs` (+5 -0) 📝 `src/SharpCompress/Common/ArchiveType.cs` (+2 -1) ➕ `src/SharpCompress/Common/Dmg/DmgBlockDataStream.cs` (+323 -0) ➕ `src/SharpCompress/Common/Dmg/DmgEntry.cs` (+52 -0) ➕ `src/SharpCompress/Common/Dmg/DmgFilePart.cs` (+21 -0) ➕ `src/SharpCompress/Common/Dmg/DmgUtil.cs` (+183 -0) ➕ `src/SharpCompress/Common/Dmg/DmgVolume.cs` (+38 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSCatalogRecord.cs` (+336 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSExtentDescriptor.cs` (+31 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSExtentRecord.cs` (+115 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSFinderInfo.cs` (+145 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSForkData.cs` (+50 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSForkStream.cs` (+196 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSKeyedRecord.cs` (+91 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSPermissions.cs` (+35 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSStructBase.cs` (+187 -0) ➕ `src/SharpCompress/Common/Dmg/HFS/HFSTreeHeaderRecord.cs` (+108 -0) _...and 19 more files_ </details> ### 📄 Description As the title suggests, this adds support for reading and extracting Dmg archives. Only Dmg archives that use the GPT partitioning scheme with a HFS+ or HFSX data partition are supported, but that should cover the large majority of Dmgs out there (any DMGs created on MacOS 8.1 and newer will have this format). I didn't see any way of implementing this as read-through so only the archive API is available. Unfortunately I'm not able to provide test data as I don't have access to a Mac to create Dmgs. I have tested extensively using my own data but I cannot share that data publicly. Hopefully someone else will be kind enough to provide those. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-29 22:19:03 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#1111