[File] [PATCH] of Magdir/msvc for Borland C++ project *.IDE

Jörg Jenderek joerg.jen.der.ek at gmx.net
Thu Jan 20 17:26:11 UTC 2022


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

Hello,
some days ago i handled some libraries with file name extension LIB
done by Magdir/msvc. Now i look at other definition for IDE samples
mentioned in that file.

When running file command version 5.41 on such IDE examples i get an
output like:

PLAYMIDI.IDE: MSVC .ide
libdsk.ide:   MSVC .ide

With --extension option only 3 byte extension ??? is displayed and
with -i option only generic application/octet-stream is shown.

For comparison reason i run the file format identification utility
TrID ( See https://mark0.net/soft-trid-e.html). This describes IDE
examples as "Borland C++ Project definition" by
ide-borland-c.trid.xml (See appended ide-trid-v.txt.gz)

Luckily TrID tool displays correct file name extension IDE for
inspected examples. This list with -v option the related URL pointing
to some information.

The information of TrID points to company page borland.com, but the
company does not exist any more. It is now part of Micro Focus. So
i choose page about Borland on Wikipedia. So that information is now
expressed inside Magdir/msvc by comment lines like:

# URL: 		https://en.wikipedia.org/wiki/Borland
# Reference:	http://mark0.net/download/triddefs_xml.7z
#		defs/i/ide-borland-c.trid.xml

The recognition happens inside Magdir/msvc by line like:
0	string
\102\157\162\154\141\156\144\040\103\053\053\040\120\162\157
\152\145\143\164\040\106\151\154\145
\012\000\032\000\002\000\262\000\272\276\372\316
MSVC .ide

The string part is encoded as octal values. When encoding this in
more human readable ASCII form and comparing it this with trid
definition it becomes clear that the starting magic is a line with
4 ASCII space separated words like "Borland C++ Project File"
followed by Line feed character, a null terminating byte and a
Control-Z character. So this now becomes like:
0	string	Borland\040C++\040Project\040File\012\000\032
MSVC .ide
!:mime	application/x-borland-ide
!:ext	ide
Instead of generic mime type application/octet-stream i show a user
defined one "application/x-borland-ide" and shown file name extension
is 3 byte string "ide".

Now comes problem with used naming "MSVC .ide". No normal user does
understand or know what this means. So i look how others call such
files. When looking on website file-extension.net for IDE extension i
get used description texts like:
	Borland C 4.x IDE project - BCW.EXE
	Borland C++ Project definition
	Borland C++ project
	C++ Project (Borland Software Corporation)
	Integrated Development Environment Configuration File
	Project file
So IDE is apparently the abbreviation for Integrated Development
Environment. That 3 byte word is used as file name extension. That
information is now shown by --extension option. Apparently MSVC is
the abbreviation for "Microsoft Visual C++". The IDE samples are
apparently created by compiler suite from company Borland. That is
completely different from company Microsoft. Maybe that this file
format
is also used for other programming languages like "C", but in start
magic explicitly "C++" is mentioned. So i finally choose "Borland C++
project" as describing text.

After the start magic comes some bytes which seems to be in most
cases constant. Maybe this is a version . So print this value if
these bytes have an unusual value by line like:
 >27	ubequad	!0x000200B200BABEFA	\b, maybe version %#16.16llx

Furthermore in my expected examples i found DOS file names like
"D:\BC45\INCLUDE\STDIO.H" or "E:\BC5\INCLUDE\STRING.H". So show
this information also by lines like:
 >35	search/5490	:\\	\b, 1st header file with directory
 >>&-5	pstring/h 	x	"%s"

After applying the above mentioned modifications by patch
file-5.41-msvc-ide.diff then i get a more descriptive output with
more details like:

PLAYMIDI.IDE: Borland C++ project,
	      1st header file with directory
	      "D:\BC45\INCLUDE\STDIO.H"
libdsk.ide:   Borland C++ project, #
	      1st header file with directory
	      "E:\BC5\INCLUDE\STRING.H"

With best wishes
Jörg Jenderek
- --
Jörg Jenderek


























-----BEGIN PGP SIGNATURE-----
Comment: Using GnuPG with Thunderbird - https://www.enigmail.net/

iF0EARECAB0WIQS5/qNWKD4ASGOJGL+v8rHJQhrU1gUCYembMwAKCRCv8rHJQhrU
1lGBAKDXPe4hgheC8jygWdgUHqLfN0r5MACfWyZllBa6l/6d9oOu5VvdLH2ErQM=
=/sk5
-----END PGP SIGNATURE-----
-------------- next part --------------
-- 
File mailing list
File at astron.com
https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ide-trid-v.txt.gz
Type: application/x-gzip
Size: 464 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220120/08fb3bb1/attachment.bin>
-------------- next part --------------
--- file-5.41/magic/Magdir/msvc.old	2020-05-31 12:34:40.000000000 +0200
+++ file-5.41/magic/Magdir/msvc	2022-01-20 18:13:29.911576000 +0100
@@ -13,4 +13,19 @@
 # .ide
+# URL: 		https://en.wikipedia.org/wiki/Borland
+# Reference:	http://mark0.net/download/triddefs_xml.7z/defs/i/ide-borland-c.trid.xml
+# Update:	Joerg Jenderek
+# Note:		called by TrID "Borland C++ Project definition"
 #too long 0	string	\102\157\162\154\141\156\144\040\103\053\053\040\120\162\157\152\145\143\164\040\106\151\154\145\012\000\032\000\002\000\262\000\272\276\372\316	MSVC .ide
-0	string	\102\157\162\154\141\156\144\040\103\053\053\040\120\162\157	MSVC .ide
+# ./msvc (1.10) of file (version 5.41) labeled the entry as "MSVC .ide"
+0	string	Borland\040C++\040Project\040File\012\000\032			Borland C++ project
+#!:mime	application/octet-stream
+!:mime	application/x-borland-ide
+# Integrated Development Environment
+!:ext	ide
+# maybe version part like: 000200B200BABEFA
+>27	ubequad	!0x000200B200BABEFA						\b, maybe version %#16.16llx
+# look for DOS drive letter
+>35	search/5490	:\\							\b, 1st header file with directory
+# DOS names like: "D:\BC45\INCLUDE\STDIO.H" "E:\BC5\INCLUDE\STRING.H"
+>>&-5	pstring/h	x							"%s"
 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: file-5.41-msvc-ide.diff.sig
Type: application/octet-stream
Size: 866 bytes
Desc: not available
URL: <https://mailman.astron.com/pipermail/file/attachments/20220120/08fb3bb1/attachment.obj>


More information about the File mailing list