[File] [PATCH] of Magdir/windows HyperTerminal profile not detected because wrong offset

Jörg Jenderek joerg.jen.der.ek at gmx.net
Fri Apr 14 21:41:02 UTC 2023


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

Hello,

some days ago i send patch of Magdir/windows for MS Windows shortcut
links. Before that entry were lines for MS Windows HyperTerminal
profiles (*.ht).

So i look on my systems for such files. When running file command
version 5.44 on such examples i get an output like:

MyHyperTerminal-6.ht: data
MyHyperTerminal2.ht:  data
MyHyperterminal1.ht:  data
MyHyperterminal3.ht:  data
MyHyperterminal5.ht:  data

Then of course with -i option only generic application/octet-stream
is shown and with --extension 3 byte sequence ??? is displayed.

For comparison reason i run other utilities. The file identifier tool
TrID  (see http://mark0.net/soft-trid-e.html) describes such
examples as "HyperTerminal data file" by definition ht.trid.xml (see
appended trid-v-ht.txt.gz).

DROID (Digital Record and Object Identification) is a software tool
developed by The National Archives of UK to perform automated batch
identification of file formats. See
	https://digital-preservation.github.io/droid/
This does not recognize such samples.

Luckily with information given by the TrID tool i also found a
page about HyperTerminal on Wikipedia and on manufacture page. That
informations are expressed by comment lines inside Magdir/windows
like:
# URL:		https://en.wikipedia.org/wiki/HyperACCESS
#		https://www.hilgraeve.com/hyperterminal/
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/h/ht.trid.xml
There you can also download a trial with Version 7.1. I also grab
samples created with older version dated about 1999.

In Magdir/windows it starts with lines like:
 0   string	HyperTerminal\040
 >15 string	1.0\ --\ HyperTerminal\ data\ file
		MS Windows HyperTerminal profile

When looking in my examples and TrID definition i saw that used
offset 15 is wrong, because the beginning offset start with value
0. So the correct offset is 14. So these lines now becomes like:
 0	string		HyperTerminal\040
 >14	string		1.0\ --\ HyperTerminal\ data\ file
			MS Windows HyperTerminal profile
 !:mime	application/x-ms-ht
 !:ext	ht
Instead of generic mime type application/octet-stream i show an user
defined one. Also the correct name suffix HT is now shown.

After applying the above mentioned modifications by patch
file-5.44-windows-ht.diff then the HyperTerminal samples are now
recognized. So i get now an output like:

MyHyperTerminal-6.ht: MS Windows HyperTerminal profile
MyHyperTerminal2.ht:  MS Windows HyperTerminal profile
MyHyperterminal1.ht:  MS Windows HyperTerminal profile
MyHyperterminal3.ht:  MS Windows HyperTerminal profile
MyHyperterminal5.ht:  MS Windows HyperTerminal profile

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+v8rHJQhrU1gUCZDnIbQAKCRCv8rHJQhrU
1lXvAKCYcVskGOGf1Rq0RFABU1hX2JrLqwCgpxRhvzf+0Zbi+X+q61xb1wWUM5Y=
=+rTt
-----END PGP SIGNATURE-----
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-v-ht.txt.gz
Type: application/x-gzip
Size: 344 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230414/aa4d4a09/attachment.bin>
-------------- next part --------------
--- file-5.44/magic/Magdir/windows.old	2022-12-02 17:18:19.000000000 +0100
+++ file-5.44/magic/Magdir/windows	2023-04-14 23:32:07.680955900 +0200
@@ -479,10 +479,17 @@
 >16	string		>\0			for "%s"
 
 # Summary: Hyper terminal
-# Extension: .ht
 # Created by: unknown
+# Update:	Joerg Jenderek
+# URL:		https://en.wikipedia.org/wiki/HyperACCESS
+#		https://www.hilgraeve.com/hyperterminal/
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/h/ht.trid.xml
+# Note:		called "HyperTerminal data file" by TrID and "HyperTerminal File" on English Windows
 0	string		HyperTerminal\040
->15	string		1.0\ --\ HyperTerminal\ data\ file	MS Windows HyperTerminal profile
+>14	string		1.0\ --\ HyperTerminal\ data\ file	MS Windows HyperTerminal profile
+#!:mime	application/octet-stream
+!:mime	application/x-ms-ht
+!:ext	ht
 
 # https://ithreats.files.wordpress.com/2009/05/\040
 # lnk_the_windows_shortcut_file_format.pdf
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.44-windows-ht.diff.sig
Type: application/octet-stream
Size: 691 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20230414/aa4d4a09/attachment.obj>


More information about the File mailing list