[File] [PATCH] Magdir/windows MS Windows help Full Text Search index *.FTS versus *.FTG
Jörg Jenderek (GMX)
joerg.jen.der.ek at gmx.net
Tue Jan 9 17:09:44 UTC 2024
Hello,
some days ago i handled files in context of old Window help system.
So in this session i will handle files with suffix FTS and FTG.
The files are typically found in same directory as corresponding HLP
file. The samples are created by Microsoft Help tool winhlp32.exe.
When i run file command version 5.45 on such samples i get a output like:
GCC.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\GCC.HLP"
Guide.FTS: MS Windows help Full Text Search index for
"C:\PROGRAMME\IPHOTO PLUS 4\PROGRAMS\Guide.hlp"
WNBACKUP.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\WNBACKUP.HLP"
creatr32.FTS: MS Windows help Full Text Search index for
"C:\CDCREATR\creatr32.hlp"
htmhlp98.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\htmhlp98.hlp"
hypertrm.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\hypertrm.hlp"
msconfig.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\msconfig.hlp"
putty.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\putty.hlp"
winhlp32.FTG: data
With option --extension for Full Text Search index samples correct 3
byte sequence FTS is shown and with -i option application/x-winhelp-fts
is shown. The FTG samples (like winhlp32.FTG.GID) are not recognized and
therefore described with generic application/octet-stream mime type as
"data" and 3byte suffix ???.
For comparison reason i also run the file format identification utility
DROID (See https://sourceforge.net/projects/droid/). Here the samples
are not recognized.
For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This identifies also
all FTS examples as "Windows Help Full-Text Search index" with
application/x-winhelp-fts mime type by fts-winhelp.trid.xml. The FTG
sample winhlp32.FTG is described as "Windows Help Full-Text search
Group" with application/x-winhelp-ftg mime type by ftg-winhelp.trid.xml
(See appended trid-ftg-v.txt.gz).
This tool list the used file name extension and with -v option the
related URL pointing to used file format information. Luckily i found
on the net information parts about Windows HELP. Of course no official
from Microsoft. And this applies also to related search files with
suffix FTS and FTG. So i choose page on Wikipedia. So i use this as
reference. That informations are expressed by comment lines inside
Magdir/windows like:
# URL: https://en.wikipedia.org/wiki/WinHelp
# Reference: http://mark0.net/download/triddefs_xml.7z
# defs/f/fts.trid.xml
# defs/f/ftg-winhelp.trid.xml
The FTS samples are described by lines inside Magdir/windows which looks
like:
0 string tfMR MS Windows help Full Text Search index
!:mime application/x-winhelp-fts
!:ext fts
>16 string >\0 for "%s"
By the last line the full path of corresponding MS Windows help file is
shown like:
"C:\CDCREATR\creatr32.hlp"
"C:\PROGRAMME\IPHOTO PLUS 4\PROGRAMS\Guide.hlp"
On Wikipedia beside FTS suffix also FTG is listed as Full Text Search of
WinHelp. So i looked on my systems for such files. Unfortunately i found
only few samples. Many (like CTRLREF.FTG SETUPWIZ.FTG) are empty. So
file size is 0, but many (like CTRLREF.FTG SETUPWIZ.FTG) contain just an
empty line (Carriage Return Line-Feed). So file size is 2. So in the end
i got only one real sample (like winhlp32.FTG).
So when translating the TrID patterns into magic lines and comparing
with FTS patterns this now becomes like:
0 string gfMR MS Windows help Full Text search Group
!:mime application/x-winhelp-ftg
!:ext ftg
>16 string >\0 for "%s"
In the starting 4 byte pattern letter g no instead of t is used compared
with FTS. When searching on the net for difference then the phrase group
is mentioned. At offset 16 here also full file name is stored but here
instead of HLP FTS is referenced ( like "C:\Windows\Help\winhlp32.FTS")
Instead of generic application/octet-stream i also show a similar user
defined mime type.
After applying the above mentioned modifications by patch
file-5.45-windows-ftg.diff then also FTG inspected examples
are now described. This now looks like:
GCC.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\GCC.HLP"
Guide.FTS: MS Windows help Full Text Search index for
"C:\PROGRAMME\IPHOTO PLUS 4\PROGRAMS\Guide.hlp"
WNBACKUP.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\WNBACKUP.HLP"
creatr32.FTS: MS Windows help Full Text Search index for
"C:\CDCREATR\creatr32.hlp"
htmhlp98.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\htmhlp98.hlp"
hypertrm.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\hypertrm.hlp"
msconfig.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\msconfig.hlp"
putty.FTS: MS Windows help Full Text Search index for
"C:\TMP.TMP\hlp\putty.hlp"
winhlp32.FTG: MS Windows help Full Text search Group for
"C:\Windows\Help\winhlp32.FTS"
I hope my diff file can be applied in future version of file
utility.
Unfortunately some of the corresponding HLP files are not recognized
correctly. I will try to handle this in a future session.
With best wishes,
Jörg Jenderek
--
Jörg Jenderek
-------------- next part --------------
A non-text attachment was scrubbed...
Name: trid-ftg-v.txt.gz
Type: application/x-gzip
Size: 482 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20240109/8b3a4484/attachment.bin>
-------------- next part --------------
--- file-5.45/magic/Magdir/windows.old 2023-07-27 20:04:45.000000000 +0200
+++ file-5.45/magic/Magdir/windows 2024-01-09 17:57:03.144924600 +0100
@@ -605,3 +605,5 @@
!:ext cnt
-#
+# URL: https://en.wikipedia.org/wiki/WinHelp
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/f/fts.trid.xml
+# Note: called "Windows Help Full-Text Search index" by TrID
# Windows creates a full text search from hlp file, if the user clicks the "Find" tab and enables keyword indexing
@@ -610,2 +612,11 @@
!:ext fts
+# path of corresponding MS Windows help like: "C:\CDCREATR\creatr32.hlp" "C:\PROGRAMME\IPHOTO PLUS 4\PROGRAMS\Guide.hlp"
+>16 string >\0 for "%s"
+# From: Joerg Jenderek
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/f/ftg-winhelp.trid.xml
+# Note: called "Windows Help Full-Text search Group" by TrID
+0 string gfMR MS Windows help Full Text search Group
+!:mime application/x-winhelp-ftg
+!:ext ftg
+# path of corresponding FTS like: "C:\Windows\Help\winhlp32.FTS"
>16 string >\0 for "%s"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.45-windows-ftg.diff.sig
Type: application/octet-stream
Size: 723 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20240109/8b3a4484/attachment.obj>
More information about the File
mailing list