Skip to content

Adding support for compression type 9 - #145

Open
aymenim wants to merge 2 commits into
sgan81:masterfrom
aymenim:master
Open

Adding support for compression type 9#145
aymenim wants to merge 2 commits into
sgan81:masterfrom
aymenim:master

Conversation

@aymenim

@aymenim aymenim commented Mar 27, 2021

Copy link
Copy Markdown

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

Damenly commented Dec 12, 2021

Copy link
Copy Markdown

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

kleuter commented Dec 11, 2022

Copy link
Copy Markdown

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

@kleuter

kleuter commented Dec 11, 2022

Copy link
Copy Markdown

Please re-open

@aymenim aymenim reopened this Dec 11, 2022
@kleuter

kleuter commented Jan 4, 2023

Copy link
Copy Markdown

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.

3 participants