如何根据给定的 CLSID 查找 DLL?

发布于 2024-07-20 22:32:38 字数 82 浏览 7 评论 0原文

我遇到过托管 DLL 调用某些非托管 DLL 的情况。 我知道非托管 DLL 的 CLSID,有什么方法可以找出包含该 CLSID 的二进制文件吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

九歌凝 2024-07-27 22:32:38

通常,您可以转到:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\"GUID"

并找到一个名为“InProcServer32”的键,例如,就会有包含 DLL 的默认值。 这是一种简单的方法。

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.

您的好友蓝忘机已上羡 2024-07-27 22:32:38

您能不能只使用 regedit 在注册表中搜索它并查找二进制路径。

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

九局 2024-07-27 22:32:38

根据 BobbyShaftoe 回复,我们可以构建一个简单的 vbs 脚本来为我们读取该注册表:

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

将以下内容粘贴到“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

您还可以通过以下方式找到 ProgId:

ProgID_RegPath = "HKEY_CLASSES_ROOT\CLSID\<GUID>\ProgID\"

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\"
紫竹語嫣☆ 2024-07-27 22:32:38

我发现这个问题是因为我正在对一些错误安装的应用程序进行故障排除,我的目标是根据给定的 CLSID(我从应用程序源获得)查找并注册 ActiveX dll。 因此我的方法有点老套。

我已在我认为 dll 所在的目录中发出搜索,在文件内容中查找 CLSID。 这成功了,因为它以纯文本形式存储在资源中。 我相信情况并非总是如此,但我的问题已经解决了。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文