sgan81 / apfs-fuse

FUSE driver for APFS (Apple File System)
GNU General Public License v2.0
1.74k stars 164 forks source link

Adding support for compression type 9 #145

Open aymenim opened 3 years ago

aymenim commented 3 years ago

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 commented 2 years ago

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 commented 1 year ago

Can be closed

kleuter commented 1 year ago

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

kleuter commented 1 year ago

Please re-open

kleuter commented 1 year ago

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