本文整理汇总了Python中pefile.__version__方法的典型用法代码示例。如果您正苦于以下问题:Python pefile.__version__方法的具体用法?Python pefile.__version__怎么用?Python pefile.__version__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pefile
的用法示例。
在下文中一共展示了pefile.__version__方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: scan
# 需要导入模块: import pefile [as 别名]
# 或者: from pefile import __version__ [as 别名]
def scan(filelist, conf=DEFAULTCONF):
results = []
libmagicresults, libmagicmeta = REQUIRES[0]
for fname, libmagicresult in libmagicresults:
if fname not in filelist:
print("DEBUG: File not in filelist")
if not libmagicresult.startswith('PE32'):
continue
result = {}
pe = pefile.PE(fname)
result['pehash'] = _get_pehash(pe)
check, sha = _get_rich_header(pe)
if check:
result['rich_header_checksum'] = check
if sha:
result['rich_header_sha256'] = sha
if callable(getattr(pe, 'get_imphash', None)):
try:
result['import_hash'] = pe.get_imphash()
except Exception as e:
# TODO: log exception
pass
if hasattr(pe, 'DIRECTORY_ENTRY_RESOURCE'):
result['resource_data'] = _dump_resource_data("ROOT",
pe.DIRECTORY_ENTRY_RESOURCE,
pe,
False)
result['sections'] = _get_sections(pe)
if hasattr(pe, 'DIRECTORY_ENTRY_IMPORT'):
result['imports'] = _get_imports(pe)
else:
result['imports'] = None
if hasattr(pe, 'DIRECTORY_ENTRY_EXPORT'):
result['exports'] = _get_exports(pe)
else:
result['exports'] = None
result['pe_timestamp'] = _get_timestamp(pe)
if hasattr(pe, 'DIRECTORY_ENTRY_DEBUG'):
result['debug_info'] = _get_debug_info(pe)
if hasattr(pe, 'VS_VERSIONINFO'):
result['version_info'] = _get_version_info(pe)
if hasattr(pe, 'DIRECTORY_ENTRY_TLS'):
ret = _get_tls_info(pe)
if ret:
result['tls_callback_info'] = ret
result = convert_encoding(result)
results.append((fname, result))
metadata = {}
metadata["Name"] = NAME
metadata["Type"] = TYPE
metadata["Version"] = pefile.__version__
metadata["Include"] = False
return (results, metadata)
# This section is an adaption from the CRITS pefile service
# https://github.com/MITRECND/crits_services/blob/master/peinfo_service/__init__.py