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

时间:2009-01-24 00:07:14

标签: dll executable

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

我只是在谈论哪些是静态加载的,而不是像LoadLibrary那样动态加载的。

10 个答案:

答案 0 :(得分:48)

dumpbin是VC ++附带的工具。

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

  • 打开Visual Studio
  • 菜单项工具| Visual Studio命令提示符
  • cd到包含可执行文件的文件夹
  • 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

要查看要导入的函数(和DLL),请使用

C:\> dumpbin /imports whatever.exe

答案 1 :(得分:31)

有些实用程序会为您执行此操作。

在过去,我使用过(我认为)VB:。附带的MS工具(depends.exe) https://msdn.microsoft.com/en-us/library/8kche8ah.aspx

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

也可能是其他人。

答案 2 :(得分:13)

打开命令提示符,然后在命令

下面键入

任务列表/ m / fi" imagename eq netbeans.exe"

输入netbeans.exe,输入exe文件名的名称。

答案 3 :(得分:10)

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

答案 4 :(得分:10)

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

答案 5 :(得分:3)

Microsoft .Net解决方案:

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

答案 6 :(得分:1)

答案 7 :(得分:1)

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

答案 8 :(得分:0)

进程浏览器 随附SysInternals套件 https://docs.microsoft.com/en-us/sysinternals/downloads/sysinternals-suite

优点:允许浏览已经在运行的进程(我还没有发现将依赖关系行附加到现有进程上)

答案 9 :(得分:0)

Dependencies - An open-source modern Dependency Walker 显示 Windows 可执行文件将加载哪些 DLL,并且它在现代 Windows 10 中运行良好。

它的功能不如 Dependency Walker,但后者在 Windows 10 中可能会也可能不会,因为它上次更新是在 2006 年。(较新版本的 Dependency Walker 与某些版本的 Windows Development Kit 捆绑在一起)适用于 Windows 10,但不再适用。)

相关问题