[File] [PATCH] of msdos, windows for Windows imaging: update+mime+extensions *.wim *.swm *.esd

Christos Zoulas christos at zoulas.com
Wed Mar 13 02:57:48 UTC 2019


On Mar 13,  2:06am, joerg.jen.der.ek at gmx.net (=?UTF-8?Q?J=c3=b6rg_Jenderek?=) wrote:
-- Subject: [File] [PATCH] of msdos, windows for Windows imaging: update+mime

| Hello,
| 
| some days ago i run file command version 5.36 on Windows imaging (WIM)
| images found on install medium for modern Windows systems. All
| examples are recognized by Magdir/msdos but no extension or mime type
| is shown.
| 
| The described file format has nothing to do with DOS. So i removed
| lines from Magdir/msdos by patch file-5.36-msdos-wim.diff and add
| lines to
| Magdir/windows.
| 
| Furthermore i add Wikipedia page about "Windows Imaging Format" by URL
|  # URL: https://en.wikipedia.org/wiki/Windows_Imaging_Format
| As reference i also add URL on Microsoft server with document "Windows
| Imaging File Format.rtf".
| 
| Besides the official Microsoft format there exist a wimlib pipable
| variant mentioned in man page "wimoptimize". So there exist 2
| different magic pattern which are handled as WIM-archives. This is now
| done by subroutine like
|  0	string		MSWIM\000\000\000
|  >0	use		wim-archive
|  0	string		WLPWM\000\000\000
|  >0	use		wim-archive
|  0      name    	wim-archive
|  >0	string		x			Windows imaging
| Now afterwards show now mime type by additional line
|  !:mime	application/x-ms-wim
| For Windows imaging there exist 3 different file name extensions
| (*.wim *.swm *.esd). These can be distinguished by looking at more
| internals.
| 
| According to docs there exist a a bit in field dwFlags for splitted
| WIM archives with filename extension swm. This is now done by
|  >16	ulelong		&0x00000008		(SWM
|  !:ext	swm
| Furthermore embedded information about current part number and total
| parts for SWM is now shown for examples like boot-swm2.swm by lines
|  >>40	uleshort	x			\b %u
|  >>42	uleshort	x			\b of %u) image
| The non splitted WIM are now handles by branch starting with line
|  >16	ulelong		^0x00000008
| According to "wimmount" man page for solid WIMs with decimal version
| 3584 ".esd" file extension is rather used than ".wim". This i now
| expressed by lines
|  >>12	ulelong		3584			(ESD) image
|  !:ext	esd
|  >>12	ulelong		!3584			(WIM) image
|  !:ext	wim
| This file format version dwVersion of the WIM file is later shown in a
| more readable form by lines
|  >14	uleshort	x			v%u
|  >13	ubyte		x			\b.%u
| So decimal version 3584 is shown as 0.14.
| A WIM archive can contain more images and windows can boot from one
| images. If more than one then this is now shown by additional lines
|  >44	ulelong		>1			\b, %u images
|  >0x78	ulelong		>0			\b, bootable no. %u
| 
| The flag header contains also more  interesting bits especially
| concerning the used compression. This is now expressed by lines
|  >16	ulelong		&0x00100000		\b, XPRESS2
|  >16	ulelong		&0x00080000		\b, LZMS
|  >16	ulelong		&0x00040000		\b, LZX
|  >16	ulelong		&0x00020000		\b, XPRESS
|  >16	ulelong		&0x00000002		compressed
| 
| I also tried to look for the XML data by rhXmlData structure by lines
| like
|  >0x50	ulelong		x			\b, at 0x%8.8x
|  >(0x50.l)	ubequad	x			\b, xml=%16.16llx
| The last line should show something like \xff\xfe<\0W\0I\0M\0, but it
| does not work. Maybe somebody is smart enough to find what is wrong here
| .
| 
| After applying the above mentioned modifications by patch
| file-5.36-windows-wim.diff then all inspected examples are now
| described like:
| 
| boot-10.wim:          Windows imaging (WIM) image v1.13,
| 	2 images, bootable no. 2,
| 	LZX compressed, reparse point fixup
| boot-opt.wim:         Windows imaging (WIM) image v1.13,
| 	bootable no. 1,
| 	LZX compressed, reparse point fixup
| boot-pipe.wim:        Windows imaging (WIM) image,
| 	wimlib pipable format v1.13,
| 	bootable no. 1,
| 	LZX compressed, reparse point fixup
| boot-swm.swm:         Windows imaging (SWM 1 of 2) image v1.13,
| 	LZX compressed, reparse point fixup
| boot-swm2.swm:        Windows imaging (SWM 2 of 2) image v1.13,
| 	LZX compressed, reparse point fixup
| boot.wim:             Windows imaging (WIM) image v1.13,
| 	bootable no. 1,
| 	LZX compressed, reparse point fixup
| install.esd:          Windows imaging (ESD) image v0.14,
| 	6 images,
| 	LZMS compressed, reparse point fixup
| x-drive-boot.wim:     Windows imaging (WIM) image v1.13,
| 	bootable no. 1,
| 	LZX compressed
| x-drive-fast.wim:     Windows imaging (WIM) image v1.13,
| 	XPRESS compressed, reparse point fixup
| x-drive.wim:          Windows imaging (WIM) image v1.13,
| 	reparse point fixup
| 
| I hope my two diff file can be applied in future version of file utility
| .
| 
| With best wishes
| Jörg Jenderek
| - -- 
| Jörg Jenderek

Great! Thanks.

christoa


More information about the File mailing list