tables.py 文件源码

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

项目:demos 作者: dfirence 项目源码 文件源码
def parse_vt_filescans( apiresults ):
    VTRES   = []
    COLUMNS = [ 'Index', 'Source', 'ScanDate', 'Hash', 'Verdict' ]
    counter = 0

    for scan in apiresults:
        for item in scan:
            counter += 1
            if item['response_code'] == 0:
                VTRES.append([ counter, 'VirusTotal', '---', item['resource'].upper(), '---' ])

            elif item['response_code'] == 1:
                VTRES.append([ counter, 'VirusTotal', item['scan_date'], item['resource'].upper(), '{}/{}'.format( item['positives'], item['total'] ) ])

    TABLE = tabulate( VTRES, headers=COLUMNS )
    return TABLE
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号