# Path: afl_utils/AflPrettyPrint.py
# class clr:
#     # taken from AFL's debug.h
#     BLK = "\x1b[0;30m"
#     RED = "\x1b[0;31m"
#     GRN = "\x1b[0;32m"
#     BRN = "\x1b[0;33m"
#     BLU = "\x1b[0;34m"
#     MGN = "\x1b[0;35m"
#     CYA = "\x1b[0;36m"
#     NOR = "\x1b[0;37m"
#     GRA = "\x1b[1;30m"
#     LRD = "\x1b[1;31m"
#     LGN = "\x1b[1;32m"
#     YEL = "\x1b[1;33m"
#     LBL = "\x1b[1;34m"
#     PIN = "\x1b[1;35m"
#     LCY = "\x1b[1;36m"
#     BRI = "\x1b[1;37m"
#     RST = "\x1b[0m"
# 
# def print_ok(msg_str):
#     print("{0}[*] {1}{2}".format(clr.LGN, clr.RST, msg_str))
# 
# def print_warn(msg_str):
#     print("{0}[!] {1}{2}".format(clr.YEL, clr.RST, msg_str))
# 
# def print_err(msg_str):
#     print("{0}[!] {1}{2}".format(clr.LRD, clr.RST, msg_str))
# 
# Path: db_connectors/con_sqlite.py
# class sqliteConnector:
#     def __init__(self, database_path, verbose=True):
#     def init_database(self, table, table_spec):
#     def dataset_exists(self, table, dataset, compare_fields):
#     def insert_dataset(self, table, dataset):
#     def commit_close(self):


import argparse
    import simplejson as json
    import json
import os
import sys
import socket
import twitter
import afl_utils
from urllib.error import URLError
from afl_utils.AflPrettyPrint import clr, print_ok, print_warn, print_err
from db_connectors import con_sqlite
            'unique_crashes': '',
            'unique_hangs': '',
            'last_path': '',
            'last_crash': '',
            'last_hang': '',
            'execs_since_crash': '',
            'exec_timeout': '',
            'afl_banner': '',
            'afl_version': '',
            'command_line': ''
        }

        for l in lines:
            if summary:
                stats = summary_stats
                for k in stats.keys():
                    if k != "fuzzer_pid":
                        if k in l:
                            stats[k] = l[19:].strip(": \r\n")
                    else:
                        if k in l:
                            stats[k] = fuzzer_alive(int(l[19:].strip(": \r\n")))
            else:
                stats = complete_stats
                for k in stats.keys():
                    if k in l:
                        stats[k] = l[19:].strip(": %\r\n")

        return stats
    except FileNotFoundError as e:

# Path: afl_utils/AflPrettyPrint.py
# class clr:
#     # taken from AFL's debug.h
#     BLK = "\x1b[0;30m"
#     RED = "\x1b[0;31m"
#     GRN = "\x1b[0;32m"
#     BRN = "\x1b[0;33m"
#     BLU = "\x1b[0;34m"
#     MGN = "\x1b[0;35m"
#     CYA = "\x1b[0;36m"
#     NOR = "\x1b[0;37m"
#     GRA = "\x1b[1;30m"
#     LRD = "\x1b[1;31m"
#     LGN = "\x1b[1;32m"
#     YEL = "\x1b[1;33m"
#     LBL = "\x1b[1;34m"
#     PIN = "\x1b[1;35m"
#     LCY = "\x1b[1;36m"
#     BRI = "\x1b[1;37m"
#     RST = "\x1b[0m"
# 
# def print_ok(msg_str):
#     print("{0}[*] {1}{2}".format(clr.LGN, clr.RST, msg_str))
# 
# def print_warn(msg_str):
#     print("{0}[!] {1}{2}".format(clr.YEL, clr.RST, msg_str))
# 
# def print_err(msg_str):
#     print("{0}[!] {1}{2}".format(clr.LRD, clr.RST, msg_str))
# 
# Path: db_connectors/con_sqlite.py
# class sqliteConnector:
#     def __init__(self, database_path, verbose=True):
#     def init_database(self, table, table_spec):
#     def dataset_exists(self, table, dataset, compare_fields):
#     def insert_dataset(self, table, dataset):
#     def commit_close(self):


# Path: afl_utils/afl_stats.py
import argparse
    import simplejson as json
    import json
import os
import sys
import socket
import twitter
import afl_utils
from urllib.error import URLError
from afl_utils.AflPrettyPrint import clr, print_ok, print_warn, print_err
from db_connectors import con_sqlite

            'unique_crashes': '',
            'unique_hangs': '',
            'last_path': '',
            'last_crash': '',
            'last_hang': '',
            'execs_since_crash': '',
            'exec_timeout': '',
            'afl_banner': '',
            'afl_version': '',
            'command_line': ''
        }

        for l in lines:
            if summary:
                stats = summary_stats
                for k in stats.keys():
                    if k != "fuzzer_pid":
                        if k in l:
                            stats[k] = l[19:].strip(": \r\n")
                    else:
                        if k in l:
                            stats[k] = fuzzer_alive(int(l[19:].strip(": \r\n")))
            else:
                stats = complete_stats
                for k in stats.keys():
                    if k in l:
                        stats[k] = l[19:].strip(": %\r\n")

        return stats
    except FileNotFoundError as e:

        print_warn("Stat file " + clr.GRA + "%s" % e.filename + clr.RST + " not found!")