def find_vulnerabilities(
    cfg_list,
    blackbox_mapping_file,
    sources_and_sinks_file,
    interactive=False,
    nosec_lines=defaultdict(set)
):
    """Find vulnerabilities in a list of CFGs from a trigger_word_file.

    Args:
        cfg_list(list[CFG]): the list of CFGs to scan.
        blackbox_mapping_file(str)
        sources_and_sinks_file(str)
        interactive(bool): determines if we ask the user about blackbox functions not in the mapping file.
    Returns:
        A list of vulnerabilities.
    """
    vulnerabilities = list()
    definitions = parse(sources_and_sinks_file)

    with open(blackbox_mapping_file) as infile:
        blackbox_mapping = json.load(infile)
    for cfg in cfg_list:
        find_vulnerabilities_in_cfg(
            cfg,
            definitions,
            Lattice(cfg.nodes),
            blackbox_mapping,
            vulnerabilities,
            interactive,
            nosec_lines
        )

    if interactive:
        with open(blackbox_mapping_file, 'w') as outfile:
            json.dump(blackbox_mapping, outfile, indent=4)

    return vulnerabilities
def find_vulnerabilities ( cfg_list , blackbox_mapping_file , sources_and_sinks_file , interactive = False , nosec_lines = defaultdict ( set ) ) : vulnerabilities = list ( ) definitions = parse ( sources_and_sinks_file ) with open ( blackbox_mapping_file ) as infile : blackbox_mapping = json . load ( infile ) for cfg in cfg_list : find_vulnerabilities_in_cfg ( cfg , definitions , Lattice ( cfg . nodes ) , blackbox_mapping , vulnerabilities , interactive , nosec_lines ) if interactive : with open ( blackbox_mapping_file , 'w' ) as outfile : json . dump ( blackbox_mapping , outfile , indent = 4 ) return vulnerabilities
Find vulnerabilities in a list of CFGs from a trigger_word_file.

    Args:
        cfg_list(list[CFG]): the list of CFGs to scan.
        blackbox_mapping_file(str)
        sources_and_sinks_file(str)
        interactive(bool): determines if we ask the user about blackbox functions not in the mapping file.
    Returns:
        A list of vulnerabilities.