CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Posts
    53

    How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    Hello,

    I need to write a stub(module), when given some PE (DLL/EXE) as input , it should give the information that this PE is Win32 DLL/EXE or COM DLL/EXE? I need it programatically to determine this.

    Is there any windows APIs?

    Regards
    Usman

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    Well, if you find a DllRegisterServer entry point, then it's a COM DLL.
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    And about COM exe you only can guess by finding imports something like OLE32.DLL::CoRegisterClassObject, OLE32.DLL::CoRevokeClassObject.
    Best regards,
    Igor

  4. #4
    Join Date
    Jan 2010
    Posts
    53

    Re: How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    This is only for COM DLL not for EXE.
    Exe don't have any entry point at all.

    More over this is an out of the way. More generic method we need to apply for this test. These methods can be user defined in these Exe's or DLL's, I mean we can define these methods in Win32 Exe's and DLL's as well. So GetProcAddress won't be the answer.

  5. #5
    Join Date
    Jan 2010
    Posts
    53

    Re: How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    Quote Originally Posted by Igor Vartanov View Post
    And about COM exe you only can guess by finding imports something like OLE32.DLL::CoRegisterClassObject, OLE32.DLL::CoRevokeClassObject.
    It means then we need to read out import table of that PE , So that we can look up its imports.

  6. #6
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: How to check whether a PE(DLL,EXE) is a COM component or Win32 DLL/EXE?

    Quote Originally Posted by glitteringsound View Post
    This is only for COM DLL not for EXE.
    Exe don't have any entry point at all.

    More over this is an out of the way. More generic method we need to apply for this test. These methods can be user defined in these Exe's or DLL's, I mean we can define these methods in Win32 Exe's and DLL's as well. So GetProcAddress won't be the answer.
    Check for these exports and also check the registry if it's been registered with COM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured