apfs-fuse icon indicating copy to clipboard operation
apfs-fuse copied to clipboard

Adding support for compression type 9

Open aymenim opened this issue 3 years ago • 5 comments

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

aymenim avatar Mar 27 '21 11:03 aymenim

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

Damenly avatar Dec 12 '21 01:12 Damenly

Can be closed

kleuter avatar Dec 11 '22 07:12 kleuter

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

kleuter avatar Dec 11 '22 08:12 kleuter

Please re-open

kleuter avatar Dec 11 '22 08:12 kleuter

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

kleuter avatar Jan 04 '23 13:01 kleuter