objects.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:cuckoo-ioc 作者: FafnerKeyZee 项目源码 文件源码
def get_exported_functions(self):
        """Get the exported function names of this PE file."""
        filetype = self.get_type()
        if "MS-DOS" not in filetype and "PE32" not in self.get_type():
            return

        if not HAVE_PEFILE:
            if not File.notified_pefile:
                File.notified_pefile = True
                log.warning("Unable to import pefile (`pip install pefile`)")
            return

        try:
            pe = pefile.PE(self.file_path)
            if not hasattr(pe, "DIRECTORY_ENTRY_EXPORT"):
                return

            for export in pe.DIRECTORY_ENTRY_EXPORT.symbols:
                if export.name:
                    yield export.name
        except Exception as e:
            log.warning("Error enumerating exported functions: %s", e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号