parser.py 文件源码

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

项目:defcon-2017-tools 作者: david942j 项目源码 文件源码
def gen_stream(self, i):
        cwd = os.getcwd()+'/'
        res, prob_id = self.gen_data(i)
        if res == None or prob_id == None:
            return
        path = os.path.join('stream', prob_id)
        path2 = os.path.join('json', 'todo')
        path2 = os.path.join(d[prob_id], path2)
        data = concat_data(res)
        md5 = hashlib.md5(data).hexdigest()
        outfname = os.path.join(path, self.basename + '_' + md5 + '.json')
        if (md5 + '.json') in fset[prob_id]:
            logging.info('Skip %s due to same' % md5)
            return
        logging.info('Save Packet Stream: %s' % outfname)
        fset[prob_id].add(md5 + '.json')
        f = file(outfname, 'w')
        json.dump(res, f)
        outfname2 = os.path.join(path2, self.basename + '_' + md5 + '.json')
        outfname = cwd+outfname
        outfname2 = cwd+outfname2
        os.symlink(outfname,outfname2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号