How to determine if a DLL is a COM DLL or .NET DLL

  • Thread starter Thread starter Anushi
  • Start date Start date
A

Anushi

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
 
why not just point ILDASM at the DLL. If it's not .NET, you will find out
quickly.

--- Nick
 
Hi

I too got around with this same problem, but i've the solution only if it is
a VB5 or VB6 COM Dll. In the above two, the Dll Binary file will have a text
called MSVBVM (Microsoft Visual Basic Virtual Machine). So what you could do
is, in the Search->Files, goto the containing text and type "MSVBVM", so it
would list all the VB -COM Dlls

Prem
 
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
 
use "Dependency Walker" which comes with VC++ 6.0. This cool app lists all
available Dlls for your application
 
Back
Top