Python下pefile的使用

2023-11-10

其实在pefile主页的Wiki上已经详细介绍了,https://code.google.com/p/pefile/wiki/UsageExamples这里给出了使用例子。同时参照着看雪http://bbs.pediy.com/showthread.php?t=89838的例子,学习了下。

下面贴上自己学习过程的代码例子,Mark备用:

# -*- coding: cp936 -*-
#import os, string, shutil,re
import pefile
import pydasm
import sys


PEfile_Path = r"G:\calc.exe"
#PEfile_Path = r"G:\msvcp110.dll"
pe = pefile.PE(PEfile_Path)
print PEfile_Path,'\n\n'

'''
pe_file = open('PE.txt', 'w')
console = sys.stdout
sys.stdout = pe_file
#PE全面解析
print pe
sys.stdout = console
pe_file.close()
'''

#入口点
#print hex(pe.OPTIONAL_HEADER.AddressOfEntryPoint)

'''
#节表
for section in pe.sections:
    print section
#print hex(pe.sections[i].Characteristics)
'''

'''
#导入表
for importeddll in pe.DIRECTORY_ENTRY_IMPORT:
    print importeddll.dll, ':'
    #print
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Python下pefile的使用 的相关文章

随机推荐