pjf_process_monitor.py 文件源码

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

项目:PyJFuzz 作者: mseclab 项目源码 文件源码
def save_testcase(self, testcase):
        """
        Save all testcases collected during monitoring
        """
        try:
            if self.config.debug:
                print("[\033[92mINFO\033[0m] Saving testcase...")
            dir_name = "testcase_{0}".format(os.path.basename(shlex.split(self.config.process_to_monitor)[0]))
            try:
                os.mkdir(dir_name)
            except OSError:
                pass
            for test in testcase:
                with open("{0}/testcase_{1}.json".format(dir_name, self.testcase_count), "wb") as t:
                    t.write(test)
                    t.close()
                self.testcase_count += 1
        except Exception as e:
            raise PJFBaseException(e.message if hasattr(e, "message") else str(e))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号