如何找出可执行文件将加载哪些 dll?

发布于 2024-07-12 13:31:30 字数 98 浏览 6 评论 0原文

如果我有 Windows 可执行文件,如何找出它将加载哪些 dll?

我只是讨论哪些将静态加载,而不是那些可能使用 LoadLibrary 之类的东西动态加载的。

If I have a Windows executable, how can I find out which dlls it will load?

I'm just talking about which ones that will be loaded statically, not ones it might load dynamically with something like LoadLibrary.

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

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

发布评论

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

评论(10

执手闯天涯 2024-07-19 13:31:30

dumpbin 是一个附带的工具VC++。

要查看程序将导入哪些 DLL:

  • 打开 Visual Studio
  • 菜单项“工具”|“ Visual Studio 命令提示符
  • cd 到包含可执行
  • 文件 dumpbin /dependentswhatever.exe 的

文件夹

转储文件whatever.exe 

  文件类型: 可执行图像 

    图像具有以下依赖关系: 

      AIOUSB.DLL 
      sqlite3.dll 
      wxmsw293u_core_vc_custom.dll 
      wxbase293u_vc_custom.dll 
      KERNEL32.dll 
      ole32.dll 
      OLEAUT32.dll 
      MSVCP90.dll 
      MSVCR90.dll 
  

要查看它将导入哪些函数(和 DLL),请使用

C:\> dumpbin /imports whatever.exe

dumpbin is a tool that comes with VC++.

To see what DLLs a program will import:

  • Open Visual Studio
  • Menu Item Tools | Visual Studio Command prompt
  • cd to folder containing executable
  • dumpbin /dependents whatever.exe
Dump of file whatever.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    AIOUSB.DLL
    sqlite3.dll
    wxmsw293u_core_vc_custom.dll
    wxbase293u_vc_custom.dll
    KERNEL32.dll
    ole32.dll
    OLEAUT32.dll
    MSVCP90.dll
    MSVCR90.dll

To see what functions (and DLLs) it will import, use

C:\> dumpbin /imports whatever.exe
诗笺 2024-07-19 13:31:30

有一些实用程序可以为您执行此操作。

过去我使用过(我认为)VB 附带的 MS 工具(depends.exe):
VS2010
VS2012
VS2013
VS2015
当前

还有这个:
http://dependencywalker.com/

可能还有其他。

There are utilities that will do this for you.

In the past I've used the MS tool (depends.exe) that came with (I think) VB.:
VS2010
VS2012
VS2013
VS2015
Current

and there's this as well:
http://dependencywalker.com/

and probably others as well.

追星践月 2024-07-19 13:31:30

打开命令提示符,然后键入以下命令

tasklist /m /fi "imagename eq netbeans.exe"

键入 netbeans.exe,无论您的 exe 文件名是什么。

Open the command prompt and then type below command

tasklist /m /fi "imagename eq netbeans.exe"

Type instead netbeans.exe whatever name your exe file name.

北音执念 2024-07-19 13:31:30

Dependency Walker 可以帮助您确定将加载哪个.dll。

Dependency Walker can help you determine which .dll will be loaded.

迷迭香的记忆 2024-07-19 13:31:30

只需进入命令提示符并输入tasklist /m,您将看到特定程序使用的dll文件列表。

Just go to the command prompt and type tasklist /m, you will see the list of dll files used by specific program.

甜妞爱困 2024-07-19 13:31:30

Microsoft .Net 的解决方案:

foreach (AssemblyName a in Assembly.ReflectionOnlyLoadFrom("SAMPLE.EXE").GetReferencedAssemblies()) 
{
    MessageBox.Show(a.Name); 
}

Solution for Microsoft .Net:

foreach (AssemblyName a in Assembly.ReflectionOnlyLoadFrom("SAMPLE.EXE").GetReferencedAssemblies()) 
{
    MessageBox.Show(a.Name); 
}
许一世地老天荒 2024-07-19 13:31:30

有一个名为 NDepend 的方便工具,可以为您提供所有 DLL 依赖项。

There is a handy tool called NDepend that will give you all DLL dependencies.

甜味超标? 2024-07-19 13:31:30

依赖项 - 一个开源的现代 Dependency Walker 显示 Windows 可执行文件将加载哪些 DLL,并且它在其中运行良好现代 Windows 10。

它的功能比 Dependency Walker 稍弱,但后者可能会或可能不会在Windows 10 的最新更新是在 2006 年。(较新版本的 Dependency Walker 与某些版本的 Windows 10 Windows 开发工具包捆绑在一起,但现在不再捆绑了。)

Dependencies - An open-source modern Dependency Walker shows which DLLs a Windows executable will load and it works well in modern Windows 10.

It is a little less powerful than Dependency Walker, but the latter may or may not work in Windows 10 as it was last updated in 2006. (Newer versions of Dependency Walker were bundled with some versions of Windows Development Kit for Windows 10, but not any more.)

哑剧 2024-07-19 13:31:30

流程浏览器
附带 SysInternals 套件
https://learn.microsoft.com/en-us/sysinternals/ downloads/sysinternals-suite

优点:允许探索已经在运行的进程(我还没有找到将依赖项walker附加到现有进程的方法)

Process Explorer
Comes with SysInternals Suite
https://learn.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite

Benefits: allows to explore the process that is already running (I have not found a was to attach the dependency walker to the existing process)

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