How to find a DLL given a CLSID?

后端 未结 3 959
感情败类
感情败类 2020-12-16 10:42

I have a situation in which a managed DLL calls some unmanaged DLL. I know the CLSID of the unmanaged DLL, is there any way to find out what binary file houses that CLSID?<

相关标签:
3条回答
  • 2020-12-16 10:59

    Based on BobbyShaftoe reply we can build a simple vbs script that reads that registry for us:

    Dll_RegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\InProcServer32\"
    

    Paste the following to "test.vbs"

    Sub Main
    
        ' used to find location of "System.Collections.ArrayList" progid dll
        Const csGUID = "{6896B49D-7AFB-34DC-934E-5ADD38EEEE39}"
    
        MsgBox srGetDllPathByGUID(csGUID)
    
    End Sub
    
    Function srGetDllPathByGUID( sGUID )
        Const csRegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\InProcServer32\"
    
        Dim oShell: Set oShell = CreateObject("WScript.Shell")
        Dim sReg: sReg = Replace( csRegPath, "<GUID>", sGUID ) ' build str
    
        srGetDllPathByGUID = oShell.RegRead(sReg)
    
        Set oShell = Nothing ' clean up
    End Function
    
    Call Main
    

    You can also find ProgId by:

    ProgID_RegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\ProgID\"
    
    0 讨论(0)
  • 2020-12-16 11:15

    Can you not just search for it in the registry using regedit and look for the binary path.

    0 讨论(0)
  • 2020-12-16 11:19

    Normaly, you can just go to:

    HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\"GUID"

    And find a key called "InProcServer32" for instance and there will be the default value that has the DLL. This is one simple way to do it.

    0 讨论(0)
提交回复
热议问题