Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read dmg files without unmount. #56

Open
iradization opened this issue Jun 20, 2018 · 5 comments
Open

Read dmg files without unmount. #56

iradization opened this issue Jun 20, 2018 · 5 comments

Comments

@iradization
Copy link

Hi,

I'm working on a file scanner that also support macOS archive files (that runs under linux) and was wondering if there's any way to use darling-dmg to extract dmg file contexts (by merely parsing/decompressing the dmg file) without the need to mount its contents on filesystem.

thanks

@LubosD
Copy link
Member

LubosD commented Jun 20, 2018

Sure, check main-fuse.cpp to see how to use the internal API.

@iradization
Copy link
Author

Thanks a lot, I'll try it. BTW, does darling-dmg create dmg format by itself ? I actually tried to mount empty hfs+ filesystem once on top of dmg file, and it seems like apple doesn't publish api on that, but force the user to use external binaries like newfs_hfs, mount_hfs and hdiutil that format the hfs+ structure in the dmg file... I wonder if it's optional to format it without these executables...

@LubosD
Copy link
Member

LubosD commented Jun 20, 2018

No, darling-dmg can't create DMG files.

The HFS+ filesystem is pretty well documented and I think you can find the sources for newfs_hfs on http://opensource.apple.com. That's not the case of DMG though.

@iradization
Copy link
Author

iradization commented Jun 24, 2018

I've further investigated the project, and saw that in file "main-test-hfs+.cpp", the source file is expected to be from pure disk image format (without dmg header). and the test read the file "/Squiggle.app/Contents/Info.plist" directly from the dmg without mount, by merely parsing the partition hfs structure. The sample deals with AppleDisk format though, but it should work if I replace it to GPT format, right ?

@LubosD
Copy link
Member

LubosD commented Jun 25, 2018

That's why I suggested that you read main-fuse.cpp, because there it also deals with DMG etc.

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

No branches or pull requests

2 participants