How to find a DLL given a CLSID?

北城余情 提交于 2019-11-27 17:10:33

问题


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?


回答1:


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.




回答2:


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




回答3:


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\"


来源:https://stackoverflow.com/questions/897743/how-to-find-a-dll-given-a-clsid

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!