msft-typelib
Allocation-free parser for MSFT-format type library (.tlb) files.
MSFT is the binary format used by Microsoft COM type libraries since the late 1990s. A type library describes the interfaces, coclasses, enumerations, and constants exposed by a COM component so that tools and languages can use them at compile time or runtime.
Features
- Zero-allocation -- record types borrow directly from the input
&[u8]; parsing requires no heap allocations beyond loading the file - Full format coverage -- parses all 13 active segments (TypeInfo, functions, variables, parameters, GUIDs, names, strings, type descriptors, array descriptors, imports, custom data, and more)
- Type resolution -- resolves
VT_PTR,VT_SAFEARRAY,VT_USERDEFINED, andVT_CARRAYtype descriptor chains - Import resolution -- resolves external type references through the import-info and import-files tables
- Custom data -- walks per-library, per-type, per-function, and per-variable custom attribute chains
- Constant decoding -- decodes inline and segment-stored constants for 20+
VARTYPEcodes
Quick start
let data = read.unwrap;
let lib = parse?;
println!;
println!;
println!;
for result in lib.typeinfos
Example
The included dump example prints a complete listing of a type library:
License
Licensed under the Apache License, Version 2.0. See LICENSE for details.