Пример #1
0
def vba2graph_func(file_path, id, sha256, on_demand=False):
    if HAVE_VBA2GRAPH and processing_conf.vba2graph.enabled and (not processing_conf.vba2graph.on_demand or on_demand):
        try:
            vba2graph_path = os.path.join(CUCKOO_ROOT, "storage", "analyses", id, "vba2graph")
            vba2graph_svg_path = os.path.join(vba2graph_path, f"{sha256}.svg")
            if os.path.exists(vba2graph_svg_path):
                return
            if not os.path.exists(vba2graph_path):
                os.makedirs(vba2graph_path)
            vba_code = vba2graph_from_vba_object(file_path)
            if vba_code:
                vba2graph_gen(vba_code, vba2graph_path)
        except Exception as e:
            log.info(e)
Пример #2
0
def vba2graph_func(file_path: str, id: str, on_demand: bool = False):
    if HAVE_VBA2GRAPH and processing_conf.vba2graph.enabled and (
            processing_conf.vba2graph.on_demand is False or on_demand is True):
        try:
            vba2graph_svg_path = os.path.join(CUCKOO_ROOT, "storage",
                                              "analyses", id, "vba2graph",
                                              "svg", "vba2graph.svg")
            if os.path.exists(vba2graph_svg_path):
                return

            vba2graph_path = os.path.join(CUCKOO_ROOT, "storage", "analyses",
                                          id, "vba2graph")
            if not os.path.exists(vba2graph_path):
                os.makedirs(vba2graph_path)
            vba_code = vba2graph_from_vba_object(file_path)
            if vba_code:
                vba2graph_gen(vba_code, vba2graph_path)
        except Exception as e:
            log.info(e)