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

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

问题描述

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

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

换句话说,我想以编程方式执行与Dependency walker"工具相同的操作.

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

如果您需要静态分析您的 dll,您必须深入研究 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天全站免登陆