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

Adding support for compression type 9 #145

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aymenim
Copy link

@aymenim aymenim commented Mar 27, 2021

Hi Simon

Thank you for your great work!

While working on a project with disk images from an IPSW file for iOS, I encountered entries with compression type 9, after quick research I found these are non-compressed files. The source I found is a comment in a source code for copyfile from apple, I have quoted the snippet below from https://opensource.apple.com/source/copyfile/copyfile-173.40.2/copyfile.c.auto.html

switch (OSSwapLittleToHostInt32(hdr->compression_type)) {
    ...

    case 9:  /* uncompressed data in xattr (similar to but not identical to CMP_Type1) */
    case 10: /* 64k chunked uncompressed data in resource fork */

    ...

I made a minor addition to add the support for compression type 9 and it worked perfectly. I hope someone else might find it useful as well.

Thanks

@Damenly
Copy link

Damenly commented Dec 12, 2021

Thanks a lot! BTW, the cdata[0] is always 0xcc.
I didn't find file compressed by algorithm 10 in a fresh installed MacOS but some files compressed by algorithm 9 e.g. /Library/Apple/System/Library/CoreServices/SafariSupport.bundle/Contents/PreferencePanes/Passwords.prefPane/Contents/Resources/de.lproj/InfoPlist.strings

@kleuter

This comment was marked as outdated.

@aymenim aymenim closed this Dec 11, 2022
@kleuter
Copy link

kleuter commented Dec 11, 2022

Sorry it can't be closed my mistake, it should be MERGED (checked multiple times to be working properly)

@kleuter
Copy link

kleuter commented Dec 11, 2022

Please re-open

@aymenim aymenim reopened this Dec 11, 2022
@kleuter
Copy link

kleuter commented Jan 4, 2023

Can be closed after almost 2 years... The author do not react to any of pull requests unfortunately.

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.

None yet

3 participants