View Issue Details

IDProjectCategoryView StatusLast Update
0000556fileGeneralpublic2024-11-09 22:43
Reporterskissane Assigned Tochristos  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Product Version5.45 
Fixed in Version5.46 
Summary0000556: Recognise Microsoft Type Library (TLB) files
DescriptionMicrosoft's COM (Component Object Model) defines a file format "TLB" (Type Library) for storing metadata on COM interfaces (names of their methods, the parameter and return types, definitions of data structures they use, etc).

It exists in two formats – a legacy format ("SLTG") and a current format ("MSFT").

I attach a patch which adds recognition of both formats.

Also an example of a TLB file – this is from the open source VirtualBox project (by Oracle), it is in the current (MSFT) format, it comes from https://download.virtualbox.org/virtualbox/7.0.20/VirtualBoxSDK-7.0.20-163906.zip at the path sdk/bindings/mscom/lib/VirtualBox.tlb (GNU GPL)

I tested it on an SLTG format file but I'm not able to share that file with you unfortunately. I will see if I can find one that I can.
TagsNo tags attached.

Activities

skissane

2024-08-29 07:48

reporter  

tlb.patch (1,636 bytes)   
diff --git a/magic/Magdir/windows b/magic/Magdir/windows
index 801a7936..094052d2 100644
--- a/magic/Magdir/windows
+++ b/magic/Magdir/windows
@@ -1895,3 +1895,23 @@
 # URL: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/policy/registry-policy-file-format
 0	string	PReg
 >4	lelong	x	Group Policy Registry Policy, Version=%d
+
+# Microsoft Type Library Format (.TLB file)
+# Stores metadata on calling COM APIs (method parameters/etc)
+# Exists in two formats: the original (SLTG aka Type 1) and a newer format (MSFT aka Type 2)
+# SLTG: https://www.nationalarchives.gov.uk/PRONOM/fmt/1601
+# MSFT: https://www.nationalarchives.gov.uk/PRONOM/fmt/1602
+# (Pronom claims these formats are due to Borland, but that appears to be incorrect, Microsoft invented them.)
+# The MSFT format is documented here: https://gist.github.com/djhohnstein/e4a346ee1506895000ca0fa93e5a0024
+# Which is a copy of original: http://theircorp.byethost11.com/files/TypeLib.txt (but which displays incorrectly due to encoding issues)
+# The MSFT format is generated by the Windows CreateTypeLib2 API: https://learn.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-createtypelib2
+# The SLTG format is generated by the Windows CreateTypeLib API: https://learn.microsoft.com/en-us/windows/win32/api/oleauto/nf-oleauto-createtypelib
+#
+# Note type libraries can also be embedded as resources inside executables/DLL. No attempt is made here to detect that scenario.
+
+# Legacy SLTG format
+0	string	SLTG
+>-36	string	TYPELIB	Type Library (legacy SLTG format)
+
+# MSFT format
+0	string	MSFT\x02\x00\x01\x00	Type Library (MSFT format)
tlb.patch (1,636 bytes)   
VirtualBox.tlb (444,632 bytes)

christos

2024-11-09 22:43

manager   ~0004080

Added, thanks!

Issue History

Date Modified Username Field Change
2024-08-29 07:48 skissane New Issue
2024-08-29 07:48 skissane File Added: tlb.patch
2024-08-29 07:48 skissane File Added: VirtualBox.tlb
2024-11-09 22:43 christos Assigned To => christos
2024-11-09 22:43 christos Status new => assigned
2024-11-09 22:43 christos Status assigned => resolved
2024-11-09 22:43 christos Resolution open => fixed
2024-11-09 22:43 christos Fixed in Version => 5.46
2024-11-09 22:43 christos Note Added: 0004080