[File] Support for Apple Sparse Image (ASIF) format

Guy Harris gharris at sonic.net
Sun Sep 20 03:26:43 EDT 2026


Apple introduced a new sparse disk image format in macOS 26.  See, for example, https://github.com/huven/asif-format and https://schamper.dev/dissecting-apples-sparse-image-format-asif/.

Here's a patch to add support for that format; it recognizes the magic number and prints the version number.

-------------- next part --------------
diff --git a/magic/Magdir/apple b/magic/Magdir/apple
index 24522a8b..e8d46332 100644
--- a/magic/Magdir/apple
+++ b/magic/Magdir/apple
@@ -799,6 +799,11 @@
 >12	belong		>0		\b, block size: %d
 >24	bequad		>0		\b, capacity: %lld bytes
 
+# Apple Sparse Image Format
+# Located at the start of the file
+0	string		shdw		Apple Sparse Image Format
+>4	belong		>0		\b, version %d
+
 # DMG image
 -512	string	koly
 >-504	belong	512	Apple DMG


More information about the File mailing list