[英]Identify whether a dll is built in debug or release with python
有什么方法可以確定在Visual Studio 2005(C ++)中內置的dll是在調試中還是在python中發布的?
我知道VS能夠加載dll並向您顯示一些元數據存儲此信息的清單。 任何python模塊都可以做到嗎?
另一個選擇是識別該dll與其他dll的依賴關系,並查找僅調試的dll,例如:msvcr80 D .dll(如果可能)。
Pefile可以幫助您解析PE可執行文件。 您可以在項目頁面上找到一些用法示例 。
關於問題的第二部分,您可以執行以下操作來檢索dll依賴項列表(摘自示例):
import pefile
path_to_dll = r"path_to_your_dll"
pe = pefile.PE(path_to_dll, fast_load=True)
# If the PE file was loaded using the fast_load=True argument, we will need to parse the data directories:
pe.parse_data_directories()
for entry in pe.DIRECTORY_ENTRY_IMPORT:
print entry.dll
就我而言,我得到以下輸出:KERNEL32.dll,MSVCP80D.dll, MSVCR80D.dll和ADVAPI32.dll。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.