如何以编程方式获取DLL依赖关系 [英] How to programmatically get DLL dependencies

查看:142
本文介绍了如何以编程方式获取DLL依赖关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取给定DLL或EXE文件的所有DLL依赖项的列表?

How can I get the list of all DLL dependencies of a given DLL or EXE file?

换句话说,我想做同样的依赖性助行器工具,但是以编程方式。

In other words, I'd like to do the same as the "Dependency walker" tool, but programmatically.

这是什么Windows(理想的.NET)API?

What is the Windows (ideally .NET) API for that?

推荐答案

您可以使用 EnumProcessModules 功能。像kaanbardak这样的管理API不会给你一个本机模块列表。

You can use EnumProcessModules function. Managed API like kaanbardak suggested won't give you a list of native modules.

例如,见此页 MSDN上

如果您需要静态分析您的您必须深入了解 PE格式,并了解导入表。有关详细信息,请参阅优秀教程

If you need to statically analyze your dll you have to dig into PE format and learn about import tables. See this excellent tutorial for details.

这篇关于如何以编程方式获取DLL依赖关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆