介紹
windows下開發(fā)exe后,本機運行正常,一旦準備部署到其他機器上,就會出現(xiàn)一堆問題。其中主要問題就是不知道自己缺了哪些庫。一般的做法是使用depend.exe工具查看PE文件的依賴庫,并進行打包。
但有時因為本機多個目錄都存在相同名字的庫,也不知道應(yīng)該用哪個版本…等等一些問題。
因此基于個人的經(jīng)驗,完善了一個簡易的查看庫依賴的工具。
原理
- 通過分析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目錄;但有些開發(fā)庫安裝時也會默認安裝到system32路徑,導(dǎo)致誤判為‘ignor’
'runtime':運行時庫。主要是使用virtual studio 開發(fā)的應(yīng)用程序,不同的vs版本對應(yīng)不同的vs runtime庫。最好的方法是官網(wǎng)下載安裝。
'depend':依賴庫。這部分dll是PE文件的靜態(tài)依賴庫,如果PE文件使用loadlibray方式顯示加載的dll,工具無法檢測。
效果
- 橙色:表示庫需要copy到PE目錄
- 灰色:表示已經(jīng)在PE目錄
雙擊某個dll,可繼續(xù)查看dll的依賴,右鍵‘返回’上級庫。
文章來源:http://www.zghlxwxcb.cn/news/detail-690981.html
下載
https://download.csdn.net/download/corrupt/87437292文章來源地址http://www.zghlxwxcb.cn/news/detail-690981.html
到了這里,關(guān)于exe/dll 文件依賴查詢工具的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!