[File] [PATCH] of Magdir/msdos for DOS device driver *.dos

Jörg Jenderek joerg.jen.der.ek at gmx.net
Sun Jul 26 01:07:59 UTC 2020


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

Hello,
some days ago i handled some OS/2 discs. Just for interest i run
file command version 5.39 on some samples like PROTMAN.DOS on disc.
For some executables i get a strange output. So i run file command
on such strange samples and other older inspected DOS driver
samples. Then i get an output like:

CDRCACHE.SYS: DOS executable
	      (UPX compressedcharacter device driver,
	      close media-,control strings-support)
CLOCK.SYS:    DOS executable
	      (clockcharacter device driverCLOCK$,
	      control strings-support)
NANSI.SYS:    DOS executable
	      (faststandardinput/outputcharacter device driverCON)
PROTMAN.DOS:  DOS executable
	      (character device driverPROTMAN$,
	      control strings-support)
SPOOL.DEV:    DOS executable
	      (character device driverPRN,
	      control strings-support)
srdemss.sys:  DOS executable
	      (block device driverSRDEMS,
	      32-bit sector-,close media-support)
STACLOAD.BIN: DOS executable
	      (block device driver?STAC-CD,
	      32-bit sector-,IOCTL-,
	      close media-,control strings-support)

Some words like "compressedcharacter" are concatenated instead be
separated by space character. For comparison reason i run file
command version 5.30. There the words are separated by space character.

Furthermore with --extension option only sys/dev/bin is displayed. So
extension dos for example like PROTMAN.DOS is missing.

So i change Magdir/msdos. In file command version 5.30 there was 1
space character after the "UPX compressed" phrase in line like
 >40	search/7	UPX!			\bUPX compressed
In version 5.39 that character is missing. So i add it again.

The same error type occur at 6 similar lines. So i apply there the
same correction method.
Furthermore the file name extensions are now shown by updated line
 !:ext	sys/dev/bin/dos

After applying the above mentioned modifications by patch
file-5.39-msdos-dos-driver.diff then i get a nicely output with
separating spaces like:

CDRCACHE.SYS: DOS executable
	      (UPX compressed character device driver,
	      close media-,control strings-support)
CLOCK.SYS:    DOS executable
	      (clock character device driver CLOCK$,
	      control strings-support)
NANSI.SYS:    DOS executable
	      (fast standard input/output
	      character device driver CON)
PROTMAN.DOS:  DOS executable
	      (character device driver PROTMAN$,
	      control strings-support)
SPOOL.DEV:    DOS executable
	      (character device driver PRN,
	      control strings-support)
srdemss.sys:  DOS executable
	      (block device driver SRDEMS,
	      32-bit sector-,close media-support)
STACLOAD.BIN: DOS executable
	      (block device driver ?STAC-CD,
	      32-bit sector-,IOCTL-,
	      close media-,control strings-support)

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+v8rHJQhrU1gUCXxzXWwAKCRCv8rHJQhrU
1rWsAJ4ugvtHeRoUBbTfuUFM4YgTXLZ+6QCffghMYO6DAeUUt5aPsDxHBK66gBs=
=hvsV
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.39/magic/Magdir/msdos.old	2020-05-31 10:34:40 +0000
+++ file-5.39/magic/Magdir/msdos	2020-07-25 23:17:46 +0000
@@ -395,4 +395,6 @@
 # also found FreeDOS print driver SPOOL.DEV and disc compression driver STACLOAD.BIN
-!:ext	sys/dev/bin
->40	search/7			UPX!			\bUPX compressed
+# PROTMAN.DOS ELNKPL.DOS
+!:ext	sys/dev/bin/dos
+# 1 space char after "UPX compressed" to get phrase like "UPX compressed character device"
+>40	search/7			UPX!			\bUPX compressed 
 # DOS device driver attributes
@@ -401,10 +403,14 @@
 >4	uleshort&0x8000			0x8000			\b
->>4	uleshort&0x0008			0x0008			\bclock
+# 1 space char after "clock" to get phrase like "clock character device driver CLOCK$"
+>>4	uleshort&0x0008			0x0008			\bclock 
 # fast video output by int 29h
->>4	uleshort&0x0010			0x0010			\bfast
+# 1 space char after "fast" to get phrase like "fast standard input/output character device driver"
+>>4	uleshort&0x0010			0x0010			\bfast 
 # standard input/output device
->>4	uleshort&0x0003			>0			\bstandard
+# 1 space char after "standard" to get phrase like "standard input/output character device driver"
+>>4	uleshort&0x0003			>0			\bstandard 
 >>>4	uleshort&0x0001			0x0001			\binput
 >>>4	uleshort&0x0003			0x0003			\b/
->>>4	uleshort&0x0002			0x0002			\boutput
+# 1 space char after "output" to get phrase like "input/output character device driver"
+>>>4	uleshort&0x0002			0x0002			\boutput 
 >>4	uleshort&0x8000			0x8000			\bcharacter device driver
@@ -415,3 +421,4 @@
 # leading/trailing nulls, zeros or non ASCII characters in 8-byte name field at offset 10 are skipped
->>>12		ubyte			>0x2E			\b
+# 1 space char before device driver name to get phrase like "device driver PROTMAN$"
+>>>12		ubyte			>0x2E			\b 
 >>>>10		ubyte			>0x20
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.39-msdos-dos-driver.diff.sig
Type: application/octet-stream
Size: 95 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20200726/50503f21/attachment.obj>


More information about the File mailing list