【问题标题】:How does a Dependency Walker work? [closed]Dependency Walker 如何工作? [关闭]
【发布时间】:2012-05-08 19:40:13
【问题描述】:

我希望能够编写自己版本的依赖遍历器工具(我认为这是学习事物的好方法)。 但是,给定一个 PE 文件(dll/exe),我没有必要的知识能够知道 - 它有什么依赖关系。

如果能提供给我这些知识的地方(教程/文章/文学等),我将不胜感激。

谢谢!

【问题讨论】:

    标签: dependency-walker


    【解决方案1】:

    原则上是直截了当的(我脑海中的伪代码):

    Create empty dependency list (list 1)
    Create empty list of references yet to be looked at (list 2)
    Add main module to list 2
    repeat
      Select first module in list 2
      Open the PE file
      Parse header to find import section
      Enumerate import modules
      for each module imported
        if not already in list 1, Add it
        if not already in list 2, Add it
      Remove from list 2
    until list 2 is empty.
    Result in list 1.
    

    要弄清楚如何实际解析 PE 的相关部分,您可以从 msdn.microsoft.com 获取 Portable Executable 规范。

    【讨论】:

      猜你喜欢
      • 2016-07-14
      • 2014-02-23
      • 2018-10-06
      • 2023-03-23
      • 2011-03-11
      • 2011-10-22
      • 2011-01-28
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多