# Path: multiscanner/config.py
# CONFIG = determine_configuration_path(None)
# 
# Path: multiscanner/common/utils.py
# def list2cmdline(list):
#     """
#     This is used to overwrite the default subprocess list2cmdline function.
# 
#     The default subprocess list2cmdline function on windows messes with quotes arguments. This will not
#     """
#     return ' '.join(list)
# 
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):
#     """Connects and runs a command. Returns the contents of stdin."""
#     client = sshconnect(hostname, port=port, username=username,
#                         password=password, key_filename=key_filename)
#     stdin, stdout, stderr = client.exec_command(cmd)
#     return stdout.read()
# 
# SSH = True


import os
import subprocess
import re
from multiscanner.config import CONFIG
from multiscanner.common.utils import list2cmdline, sshexec, SSH
        return False
    if os.path.isfile(conf["path"]) or SSH:
        return True
    else:
        return False


def scan(filelist, conf=DEFAULTCONF):
    if os.path.isfile(conf["path"]):
        local = True
    else:
        local = False
    cmdline = conf["cmdline"]
    path = conf["path"]
    # Fixes list2cmd so we can actually quote things...
    subprocess.list2cmdline = list2cmdline
    # Generate scan option
    for item in filelist:
        cmdline.append('"' + item + '"')

    # Create full command line
    cmdline.insert(0, path)
    if local:
        try:
            output = subprocess.check_output(cmdline)
        except subprocess.CalledProcessError as e:
            output = e.output
    else:
        try:
            host, port, user = conf["host"]

# Path: multiscanner/config.py
# CONFIG = determine_configuration_path(None)
# 
# Path: multiscanner/common/utils.py
# def list2cmdline(list):
#     """
#     This is used to overwrite the default subprocess list2cmdline function.
# 
#     The default subprocess list2cmdline function on windows messes with quotes arguments. This will not
#     """
#     return ' '.join(list)
# 
# def sshexec(hostname, cmd, port=22, username=None, password=None,
#             key_filename=None):
#     """Connects and runs a command. Returns the contents of stdin."""
#     client = sshconnect(hostname, port=port, username=username,
#                         password=password, key_filename=key_filename)
#     stdin, stdout, stderr = client.exec_command(cmd)
#     return stdout.read()
# 
# SSH = True


# Path: multiscanner/modules/Antivirus/McAfeeScan.py
import os
import subprocess
import re
from multiscanner.config import CONFIG
from multiscanner.common.utils import list2cmdline, sshexec, SSH

        return False
    if os.path.isfile(conf["path"]) or SSH:
        return True
    else:
        return False


def scan(filelist, conf=DEFAULTCONF):
    if os.path.isfile(conf["path"]):
        local = True
    else:
        local = False
    cmdline = conf["cmdline"]
    path = conf["path"]
    # Fixes list2cmd so we can actually quote things...
    subprocess.list2cmdline = list2cmdline
    # Generate scan option
    for item in filelist:
        cmdline.append('"' + item + '"')

    # Create full command line
    cmdline.insert(0, path)
    if local:
        try:
            output = subprocess.check_output(cmdline)
        except subprocess.CalledProcessError as e:
            output = e.output
    else:
        try:
            host, port, user = conf["host"]

            output = sshexec(host, list2cmdline(cmdline), port=port, username=user, key_filename=conf["key"])