[File] [PATCH] Magdir/softquad DESC or font file binary misidentifies 5View capture

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Oct 27 19:44:57 UTC 2022


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


Hello,

some weeks ago ago i send patch for 5View capture files.

For control reason i looked again at my samples. When running file
command version 5.43 with -k option on such 5VW examples then i
get an output like:

kroete.dat:    SoftQuad DESC or font file binary
linux.5vw:     5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x3c,
	       Time-stamp Tue Oct 25 22:43:09 2022
	       SoftQuad DESC or font file binary
My5view-5.5vw: 5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x9e,
	       Time-stamp Sat Apr  9 19:47:41 2022
	       SoftQuad DESC or font file binary
mywin8-6.5vw:  5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x156,
	       Time-stamp Wed Apr 27 21:26:53 2022
	       SoftQuad DESC or font file binary

Unfortunately all examples are also described wrong by lines inside
Magdir/softquad. These looks like:
 0	short	0125252		SoftQuad DESC or font file binary
 >2	short	>0		- version %d

Unfortunately i found no file format description or examples or
software. At least on SoftQuad Software page on Wikipedia i found
little bit of information. That is now expressed by line like:
# URL:		https://en.wikipedia.org/wiki/SoftQuad_Software

The short value octal 0125252 is AAAA hexadecimal. So this expression
is also true for 5View captures which start by test line inside
Magdir/sniffer like:
 0	string		\xaa\xaa\xaa\xaa

Without any knowledge about SoftQuad but with human brain i expect
that second test line with version is executed for "real" SoftQuad
examples. So maybe we get here something like low positive number
like 0, 1 or 2. But for 5View capture this value would be interpreted
as "very negative" value -21846 ( that is hexadecimal AAAA). So to
skip 5View capture do displaying part after second test for version.
So this now becomes like:
 0  short 0125252
 >2 short >0	SoftQuad DESC or font file binary - version %d

After applying the above mentioned modifications by patch
file-5.43-softquad-5vw.diff and using Magdir/sniffer
then my 5View captures are still described but misidentification as
SoftQuad vanish. This now looks like:
kroete.dat:    data
linux.5vw:     5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x3c,
	       Time-stamp Tue Oct 25 22:43:09 2022
My5view-5.5vw: 5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x9e,
	       Time-stamp Sat Apr  9 19:47:41 2022
mywin8-6.5vw:  5View capture file, record size 0x18,
	       file type 0x18001000; record size 0x24,
	       record type 0x80000000, RecSize 0x156,
	       Time-stamp Wed Apr 27 21:26:53 2022

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+v8rHJQhrU1gUCY1rfuAAKCRCv8rHJQhrU
1mzkAJ9bbLRob8T9dvciP6JeDoaXEDVpyQCfRScGeGAlf+LTyG4YB9qiGZtZGPU=
=LKGb
-----END PGP SIGNATURE-----
-------------- next part --------------
--- file-5.43/magic/Magdir/softquad.old	2021-02-23 01:49:24.000000000 +0100
+++ file-5.43/magic/Magdir/softquad	2022-10-27 21:33:14.848882800 +0200
@@ -4,2 +4,3 @@
 # softquad:  file(1) magic for SoftQuad Publishing Software
+# URL:		https://en.wikipedia.org/wiki/SoftQuad_Software
 #
@@ -19,4 +20,6 @@
 # Binary sqtroff font/desc files...
-0	short		0125252		SoftQuad DESC or font file binary
->2	short		>0		- version %d
+# GRR: the line below is also true for 5View capture file handled by ./sniffer
+0	short		0125252
+# skip 5View capture file with "invalid" version AAAAh
+>2	short		>0		SoftQuad DESC or font file binary - version %d
 # Bitmaps...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.43-softquad-5vw.diff.sig
Type: application/octet-stream
Size: 541 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20221027/fe17f850/attachment.obj>


More information about the File mailing list