【问题标题】:dumpbin.exe find the existence of the dependencydumpbin.exe 找到依赖项的存在
【发布时间】:2019-03-22 18:51:56
【问题描述】:

我需要验证可执行文件的依赖项是否存在,如果可能的话,验证该依赖项的正确版本。包括依赖项的依赖项。使用 dumpbin.exe,我可以收集 exe 或 dll 的依赖项。例如

C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin>dumpbin.exe /dependents  "C:\Program Files (x86)\Notepad++\notepad++.exe"
Microsoft (R) COFF/PE Dumper Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.


Dump of file C:\Program Files (x86)\Notepad++\notepad++.exe

File Type: EXECUTABLE IMAGE

  Image has the following dependencies:

    COMCTL32.dll
    SHLWAPI.dll
    SHELL32.dll
    KERNEL32.dll
    USER32.dll
    GDI32.dll
    COMDLG32.dll
    ADVAPI32.dll
    ole32.dll

  Summary

       20000 .data
       52000 .rdata
       13000 .reloc
       86000 .rsrc
      10F000 .text

我在 C# 中通过 Process.Start() 读取 dumpbin.exe 的输出并解析返回数据,没问题。我还可以验证文件是否存在,很容易......但是,完全有可能系统上存在多个依赖项的依赖项。您将如何验证是否存在正确的依赖项或所述依赖项的版本?这变得很重要,因为验证依赖项的依赖项也存在。如果有办法超越就好了

"C:\Windows\System32\ole32.dll" 

对此有什么想法吗?提前致谢! (PS-如果我在dll位置方面完全错误,比如它只能存在于.exe的执行路径或system32中,请告诉我,谢谢)

【问题讨论】:

标签: c# dependencies dumpbin


【解决方案1】:

您正在测试的节点上多个库的load order 会影响哪个库。

运行时方法是:

使用 sysinternals procmon 加载依赖项。

通过从 windbg 启动程序来使用 windbg 以查看加载程序消息。

【讨论】:

    猜你喜欢
    • 2021-02-28
    • 2010-10-03
    • 1970-01-01
    • 2021-01-21
    • 2017-04-07
    • 1970-01-01
    • 2015-02-17
    • 2017-03-29
    • 2013-05-16
    相关资源
    最近更新 更多