# Path: lib/core/log.py
# LOGGER_HANDLER = None
# 
# Path: lib/core/settings.py
# BANNER = """\033[01;33m                _      
#  ___  ___ _ __\033[01;31m(¯ω¯)\033[01;33m __ _  \033[01;37m{\033[01;33m%s\033[01;37m}\033[01;33m
# / __|/ _ \ '_ \| |/ _` |
# \__ \  __/ |_) | | (_| |
# |___/\___| .__/|_|\__,_|  \033[07;33;41mPoC|Exploit\033[0m\033[01;33m
#          |_|            
#                        \033[0m\n""" % VERSION
# 
# UNICODE_ENCODING = "utf-8"
# 
# NULL = "NULL"
# 
# INVALID_UNICODE_CHAR_FORMAT = r"\x%02x"
# 
# OPTIONAL_MOUDLE_METHODS = ['exp']
# 
# Path: lib/core/convert.py
# def stdoutencode(data):
#     retVal = None
# 
#     try:
#         data = data or ""
# 
#         # Reference: http://bugs.python.org/issue1602
#         if IS_WIN:
#             output = data.encode(sys.stdout.encoding, "replace")
# 
#             if '?' in output and '?' not in data:
#                 warnMsg = "cannot properly display Unicode characters "
#                 warnMsg += "inside Windows OS command prompt "
#                 warnMsg += "(http://bugs.python.org/issue1602). All "
#                 warnMsg += "unhandled occurances will result in "
#                 warnMsg += "replacement with '?' character. Please, find "
#                 warnMsg += "proper character representation inside "
#                 warnMsg += "corresponding output files. "
#                 singleTimeWarnMessage(warnMsg)
# 
#             retVal = output
#         else:
#             retVal = data.encode(sys.stdout.encoding)
#     except Exception:
#         retVal = data.encode(UNICODE_ENCODING) if isinstance(data, unicode) else data
# 
#     return retVal
# 
# Path: lib/core/enums.py
# class EXIT_STATUS:
#     SYSETM_EXIT = 0
#     ERROR_EXIT = 1
#     USER_QUIT = 2
# 
# class TARGET_MODE_STATUS:
#     FILE = 9
#     SINGLE = 8
#     IPMASK = 7
#     RANGE = 6
#     API = 5


import os
import re
import sys
import imp
import time
import logging
from lib.core.data import *
from lib.core.exception import *
from lib.utils.expfunctions import *
from lib.core.log import LOGGER_HANDLER
from lib.core.settings import BANNER, UNICODE_ENCODING, NULL, INVALID_UNICODE_CHAR_FORMAT, OPTIONAL_MOUDLE_METHODS
from lib.core.convert import stdoutencode
from lib.core.enums import EXIT_STATUS, TARGET_MODE_STATUS
from thirdparty.termcolor.termcolor import colored
from thirdparty.odict.odict import OrderedDict
from thirdparty.prettytable.prettytable import PrettyTable
    _ = BANNER
    if not getattr(LOGGER_HANDLER, "is_tty", False):
        _ = re.sub("\033.+?m", "", _)
    dataToStdout(_)


def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    logging._acquireLock()
    if isinstance(data, unicode):
        message = stdoutencode(data)
    else:
        message = data

    sys.stdout.write(setColor(message, bold))

    try:
        sys.stdout.flush()
    except IOError:
        pass

    logging._releaseLock()
    return


def setColor(message, bold=False):
    retVal = message


# Path: lib/core/log.py
# LOGGER_HANDLER = None
# 
# Path: lib/core/settings.py
# BANNER = """\033[01;33m                _      
#  ___  ___ _ __\033[01;31m(¯ω¯)\033[01;33m __ _  \033[01;37m{\033[01;33m%s\033[01;37m}\033[01;33m
# / __|/ _ \ '_ \| |/ _` |
# \__ \  __/ |_) | | (_| |
# |___/\___| .__/|_|\__,_|  \033[07;33;41mPoC|Exploit\033[0m\033[01;33m
#          |_|            
#                        \033[0m\n""" % VERSION
# 
# UNICODE_ENCODING = "utf-8"
# 
# NULL = "NULL"
# 
# INVALID_UNICODE_CHAR_FORMAT = r"\x%02x"
# 
# OPTIONAL_MOUDLE_METHODS = ['exp']
# 
# Path: lib/core/convert.py
# def stdoutencode(data):
#     retVal = None
# 
#     try:
#         data = data or ""
# 
#         # Reference: http://bugs.python.org/issue1602
#         if IS_WIN:
#             output = data.encode(sys.stdout.encoding, "replace")
# 
#             if '?' in output and '?' not in data:
#                 warnMsg = "cannot properly display Unicode characters "
#                 warnMsg += "inside Windows OS command prompt "
#                 warnMsg += "(http://bugs.python.org/issue1602). All "
#                 warnMsg += "unhandled occurances will result in "
#                 warnMsg += "replacement with '?' character. Please, find "
#                 warnMsg += "proper character representation inside "
#                 warnMsg += "corresponding output files. "
#                 singleTimeWarnMessage(warnMsg)
# 
#             retVal = output
#         else:
#             retVal = data.encode(sys.stdout.encoding)
#     except Exception:
#         retVal = data.encode(UNICODE_ENCODING) if isinstance(data, unicode) else data
# 
#     return retVal
# 
# Path: lib/core/enums.py
# class EXIT_STATUS:
#     SYSETM_EXIT = 0
#     ERROR_EXIT = 1
#     USER_QUIT = 2
# 
# class TARGET_MODE_STATUS:
#     FILE = 9
#     SINGLE = 8
#     IPMASK = 7
#     RANGE = 6
#     API = 5


# Path: lib/core/common.py
import os
import re
import sys
import imp
import time
import logging
from lib.core.data import *
from lib.core.exception import *
from lib.utils.expfunctions import *
from lib.core.log import LOGGER_HANDLER
from lib.core.settings import BANNER, UNICODE_ENCODING, NULL, INVALID_UNICODE_CHAR_FORMAT, OPTIONAL_MOUDLE_METHODS
from lib.core.convert import stdoutencode
from lib.core.enums import EXIT_STATUS, TARGET_MODE_STATUS
from thirdparty.termcolor.termcolor import colored
from thirdparty.odict.odict import OrderedDict
from thirdparty.prettytable.prettytable import PrettyTable

    _ = BANNER
    if not getattr(LOGGER_HANDLER, "is_tty", False):
        _ = re.sub("\033.+?m", "", _)
    dataToStdout(_)


def dataToStdout(data, bold=False):
    """
    Writes text to the stdout (console) stream
    """
    logging._acquireLock()
    if isinstance(data, unicode):
        message = stdoutencode(data)
    else:
        message = data

    sys.stdout.write(setColor(message, bold))

    try:
        sys.stdout.flush()
    except IOError:
        pass

    logging._releaseLock()
    return


def setColor(message, bold=False):
    retVal = message


    if message and getattr(LOGGER_HANDLER, "is_tty", False):  # colorizing handler