def __init__(self, file_path):
super(PEExecutable, self).__init__(file_path)
self.helper = pefile.PE(self.fp)
self.architecture = self._identify_arch()
if self.architecture is None:
raise Exception('Architecture is not recognized')
logging.debug('Initialized {} {} with file \'{}\''.format(self.architecture, type(self).__name__, file_path))
self.pack_endianness = '<'
self.sections = [section_from_pe_section(s, self.helper) for s in self.helper.sections]
if hasattr(self.helper, 'DIRECTORY_ENTRY_IMPORT'):
self.libraries = [dll.dll for dll in self.helper.DIRECTORY_ENTRY_IMPORT]
else:
self.libraries = []
评论列表
文章目录