[File] [PATCH] of Magdir/msdos for CAB based Microsoft Desktop Gadget

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Feb 20 21:19:55 UTC 2020


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


Hello,
some days ago i handled some Device Metadata Packages, which are
Microsoft Cabinet archive. So i look for other CAB archives which are
not described precisely. So i look for CAB based Microsoft Desktop
sidebar gadgets with file name extension gadget. When running file
command version 5.38 on such examples i get an output like:

281_accuweatherforecastradar_gadgetsrevived.com.gadget:
	Microsoft Cabinet archive data,	many,
	255086 bytes, 104 files, at 0x44 +A "icon.png"
	+A "en-US\findLocation.html", flags 0x4, number 1,
	extra bytes 20 in head, 10 datablocks, 0x1 compression
All_CPU_Meter_V4.7.3.gadget:
	Microsoft Cabinet archive data, many,
	202358 bytes, 49 files, at 0x44 +A "alarm1.mp3"
	+A "alarm2.mp3", flags 0x4, number 1,
	extra bytes 20 in head, 15 datablocks, 0x1 compression

So these examples are only described by generic expression as
Microsoft Cabinet archive, but sub type classification is missing.
Furthermore with --extension option wrong file name extension "cab"
is displayed.

On Wikipedia i found a page about such Windows Desktop gadgets. So i
add that page inside Magdir/msdos as reference by comment line like:
 # URL: https://en.wikipedia.org/wiki/Windows_Desktop_Gadgets
More information about file format is available on Microsoft servers.
So i add page about Windows sidebar gadget by reference line like:
 # docs.microsoft.com/en-us/previous-versions/windows/desktop/sidebar

According to that reference characteristic for Windows Sidebar gadget
is a manifest inside gadget package. The gadget manifest file must be
named "gadget.xml".

Unfortunately that file must not be the first archive name. So a
brute force search inside CAB directory part must be done to identify
examples. To catch "biggest" example All_CPU_Meter_V4.7.3.gadget
found on website win10gadgets.com this is done after PowerPoint
Viewer Packed and Go identifying part by additional magic line like:
 >0x2c	search/968/c	gadget.xml	\b, Windows Desktop Gadget

According to website extension.nirsoft.net afterwards show user
defined mime type and correct file name extension by lines:
 !:mime	application/x-windows-gadget
 !:ext	gadget

After applying the above mentioned modifications by patch
file-5.38-msdos-gadget.diff then i get a more precise
output like:

281_accuweatherforecastradar_gadgetsrevived.com.gadget:
	Microsoft Cabinet archive data,
	Windows Desktop Gadget,
	255086 bytes, 104 files, at 0x44 +A "icon.png"
	+A "en-US\findLocation.html", flags 0x4, number 1,
	extra bytes 20 in head, 10 datablocks, 0x1 compression
All_CPU_Meter_V4.7.3.gadget:
	Microsoft Cabinet archive data,
	Windows Desktop Gadget,
	202358 bytes, 49 files, at 0x44 +A "alarm1.mp3"
	+A "alarm2.mp3", flags 0x4, number 1,
	extra bytes 20 in head, 15 datablocks, 0x1 compression

I hope my diff file can be applied in future version of
file utility. There exist a variant where such Windows gadgets are
packed as ZIP archives. I will try to handles this in a future session.

With best wishes
Jörg Jenderek
- --
Jörg Jenderek




-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCXk73zAAKCRCv8rHJQhrU
1lAnAKC3ggsZjLsCS9EbyLqBnLRVSPr8OgCgzTce7O1XtTz0OVMFr7joDzl9xTs=
=kMK6
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.38/magic/Magdir/msdos.old	2019-10-18 16:16:18 +0000
+++ file-5.38/magic/Magdir/msdos	2020-02-20 21:11:32 +0000
@@ -1215,6 +1215,14 @@
 !:mime	application/vnd.ms-powerpoint
 #!:mime	application/mspowerpoint
 !:ext	ppz
+# URL:		https://en.wikipedia.org/wiki/Windows_Desktop_Gadgets
+# Reference:	https://docs.microsoft.com/en-us/previous-versions/windows/desktop/sidebar/
+# http://win10gadgets.com/download/273/ All_CPU_Meter1.zip/All_CPU_Meter_V4.7.3.gadget
+>0x2c	search/968/c	gadget.xml		\b, Windows Desktop Gadget
+#!:mime	application/vnd.ms-cab-compressed
+# http://extension.nirsoft.net/gadget
+!:mime	application/x-windows-gadget
+!:ext	gadget
 # http://www.incredimail.com/
 # IncrediMail CAB contains an initialisation file "content.ini" like in im2.ims
 >0x2c	search/3369/c	content.ini\0	\b, IncrediMail
@@ -1235,7 +1243,7 @@
 # http://file-extension.net/seeker/file_extension_ime
 >>>0x2c	default		x		emoticons or sound
 !:ext	ime/imw
-# no Diagnostic and IncrediMail
+# no Diagnostic, Packed and Go, Windows Desktop Gadget, IncrediMail
 >0x2c	default		x
 # look for 1st member name
 >>(16.l+16)	ubyte	x
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.38-msdos-gadget.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200220/6de956f9/attachment.obj>


More information about the File mailing list