介绍
windows下开发exe后,本机运行正常,一旦准备部署到其他机器上,就会出现一堆问题。其中主要问题就是不知道自己缺了哪些库。一般的做法是使用depend.exe工具查看PE文件的依赖库,并进行打包。
但有时因为本机多个目录都存在相同名字的库,也不知道应该用哪个版本…等等一些问题。
因此基于个人的经验,完善了一个简易的查看库依赖的工具。
原理
- 通过分析PE文件所有的依赖库(同depend工具)
- 按照windows默认的dll加载顺序查找dll路径
The directory from which the application loaded.
The system directory. Use the GetSystemDirectory function to get the path of this directory. The name of this directory is System32.
The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
- 比对dll库类型,分为
'ignor' : 可忽略的,默认都是system32目录;但有些开发库安装时也会默认安装到system32路径,导致误判为‘ignor’
'runtime':运行时库。主要是使用virtual studio 开发的应用程序,不同的vs版本对应不同的vs runtime库。最好的方法是官网下载安装。
'depend':依赖库。这部分dll是PE文件的静态依赖库,如果PE文件使用loadlibray方式显示加载的dll,工具无法检测。
效果
- 橙色:表示库需要copy到PE目录
- 灰色:表示已经在PE目录
双击某个dll,可继续查看dll的依赖,右键‘返回’上级库。

下载
https://download.csdn.net/download/corrupt/87437292
文章介绍了一种简易的工具,用于分析PE文件的依赖库,特别是在部署到其他机器时可能出现的问题。该工具遵循Windows的DLL加载顺序检查依赖,并区分了ignor、runtime和depend三种类型的库,帮助开发者识别应打包的库,特别是处理系统目录中的库和VisualStudio运行时库的问题。用户可以通过双击dll查看其依赖,并下载工具进行使用。

4805

被折叠的 条评论
为什么被折叠?



