[File] [PATCH] of Magdir/archive for misidentified Apple DiskCopy 4.2 image

Jörg Jenderek joerg.jen.der.ek at gmx.net
Mon Apr 6 22:23:06 UTC 2020


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,
some months ago i send patch for Magdir/archive for Apple DiskCopy
4.2 image. In the mean time sometimes other files are misidentified
and i get an output like
windows7en.mbr:       Apple DiskCopy 4.2 image
		      uÀZм, 3024206762 bytes,
		      0x55cd135d tag size, 0xf7 encoding, 0xc1 format

Unfortunately Apple DiskCopy files have no real good 4 byte magic
pattern. But according to mentioned DiskCopy 4.2 format
specification on wiki.68kmla.org at offset 0x52 a 2 byte magic
value 0x0100 is found. That is used as first test by line:
 0x52	ubeshort	0x0100

Two byte magic is not so strong. So i looked for more test lines.
According to website lowest disk size is 400K. So test for such or
bigger disk sizes by line
 >0x40	ubelong		>409599	Apple DiskCopy 4.2 image

Unfortunately these 2 tests are also true for master boot record of
English Windows 7 (See example windows7en.mbr), but for that
misidentified example an extreme high disc size of 3024206762 is
shown. According to documentation for such floppy disc images
highest size is 1440k. So now i also test for disk size equal or
below 1440k by third additional line. This now becomes like
 >0x40	ubelong		>409599
 >>0x40	ubelong		<1474561	Apple DiskCopy 4.2 image

Additional i also display a user defined mime magic by line like
 !:mime	application/x-dc42-floppy-image

After applying the above mentioned modifications by patch
file-5.38-archive-dc42.diff then misidentification vanish
and such old Apple disc images are still identified and described lik
e:

Disco 12.image:       Apple DiskCopy 4.2 image
      		      Disco 12, 1474560 bytes,
		      MFM CAV dshd (1440k), 0x22 format
Microsoft Mail.image: Apple DiskCopy 4.2 image
	  	      Microsoft Mail, 819200 bytes,
		      0x4b00 tag size,
		      GCR CLV dsdd (800k), 0x22 format

I hope my diff file can be applied in future version of
file utility.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek
-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXourtAAKCRCv8rHJQhrU
1me1AKCWmJZmwhypgpS8jhlf3XbMSLuitACeK6iPUaoj5Pj7v/CxUX3YadfOQu4=
=KVxj
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.38/magic/Magdir/tplink.old	2019-04-19 01:42:27 +0000
+++ file-5.38/magic/Magdir/tplink	2020-03-27 16:29:50 +0000
@@ -14,5 +14,7 @@
 # skip Norton Commander Cleanup Utility NCCLEAN.INI by looking for valid vendor
 >>>4		ubelong		>0x1F000000
->>>>0		use		firmware-tplink
+# skip user.dbt by looking for positive hardware id
+>>>>0x40	ubeshort	>0
+>>>>>0		use		firmware-tplink
 
 0		name		firmware-tplink
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.38-tplink-dbt.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200407/ad661925/attachment.obj>


More information about the File mailing list