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

Discussion in 'ASP .Net' started by Anushi, Aug 12, 2004.

  1. Anushi

    Anushi Guest

    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
    Anushi, Aug 12, 2004
    #1
    1. Advertising

  2. Anushi

    Nick Malik Guest

    why not just point ILDASM at the DLL. If it's not .NET, you will find out
    quickly.

    --- Nick

    "Anushi" <> wrote in message
    news:...
    > 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
    >
    >
    Nick Malik, Aug 12, 2004
    #2
    1. Advertising

  3. 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

    "Nick Malik" wrote:

    > why not just point ILDASM at the DLL. If it's not .NET, you will find out
    > quickly.
    >
    > --- Nick
    >
    > "Anushi" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
    >
    =?Utf-8?B?UHJlbSBLdW1hcg==?=, Aug 31, 2004
    #3
  4. I think he is asking programatically ....isn't right Anushi?
    "Prem Kumar" <> wrote in message
    news:...
    > 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
    >
    > "Nick Malik" wrote:
    >
    > > why not just point ILDASM at the DLL. If it's not .NET, you will find

    out
    > > quickly.
    > >
    > > --- Nick
    > >
    > > "Anushi" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >
    > >
    Shankar Reddy, Sep 3, 2004
    #4
  5. Anushi wrote:
    > 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
    --
    ..NET training, consultancy and mentoring
    my email is encrypted with ROT13 (www.rot13.org)
    sign up for my free .NET newsletter at
    http://www.wd-mag.com/newsletters/
    Richard Grimes [MVP], Sep 17, 2004
    #5
  6. Anushi

    Ham Guest

    use "Dependency Walker" which comes with VC++ 6.0. This cool app lists all
    available Dlls for your application

    "Prem Kumar" <> wrote in message
    news:...
    > 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
    >
    > "Nick Malik" wrote:
    >
    >> why not just point ILDASM at the DLL. If it's not .NET, you will find
    >> out
    >> quickly.
    >>
    >> --- Nick
    >>
    >> "Anushi" <> wrote in message
    >> news:...
    >> > 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
    >> >
    >> >

    >>
    >>
    >>
    Ham, Oct 28, 2004
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ken Stealth
    Replies:
    3
    Views:
    4,027
    MS News \(MS ILM\)
    Aug 24, 2003
  2. Tomas
    Replies:
    0
    Views:
    2,804
    Tomas
    Jan 21, 2004
  3. DBxGlock
    Replies:
    1
    Views:
    783
    =?Utf-8?B?Y2xpY2tvbg==?=
    Apr 25, 2006
  4. Peña, Botp
    Replies:
    1
    Views:
    223
    Robert Klemme
    Jan 24, 2004
  5. H. Simpson
    Replies:
    4
    Views:
    248
    H. Simpson
    Aug 3, 2004
Loading...

Share This Page