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?
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.
HKEY_CLASSES_ROOT\CLSID
is what should be used. –
Unbend Can you not just search for it in the registry using regedit and look for the binary path.
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\"
I've found this question because I was troubleshooting some incorrectly installed application and my objective was to find and register ActiveX dll given the CLSID (which I've got from app sources). Hence my a little bit hacky approach.
I've issued a search in the directory where I believed the dll is located looking for CLSID in file contents. That did the trick, because it was stored in plain text in resources. I believe it's not always the case, but my problem was solved.
© 2022 - 2024 — McMap. All rights reserved.