Anushi said:
Hi All,
Is there a way to determine if a Dll is a Com Dll or a .Net Dll ?
Any pointers are greatly appreciated.
Thanks,
Anushi
Look for the CLR header, this is documented in the ECMA spec.
DOS header starts at 0x0, the DWORD at 0x3c contains a pointer to the PE
signature (usually 0x80) which is 4 bytes, the next 20 bytes is the COFF
header and then there is the PE header (at 0x98). The PE header is 224 bytes
and contains the data directory (at 96 bytes into the PE header = 0xf8). The
15th entry (at 0x168) is the CLR header descriptor (sometimes called the COM
descriptor, but this does not have anything to do with COM). If this is
empty (ie 0 in the 8 bytes from 0x168 to 0x16f) then the file is not a .NET
assembly. If you want to check if it is a COM DLL then you should look to
see if it exports GetClassObject.
Note that these offsets will be different for 64-bit DLLs.
Richard