# 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
    return getUnicode(retVal, encoding=encoding)


def getUnicode(value, encoding=None, noneToNull=False):
    """
    Return the unicode representation of the supplied value:

    >>> getUnicode(u'test')
    u'test'
    >>> getUnicode('test')
    u'test'
    >>> getUnicode(1)
    u'1'
    """

    if noneToNull and value is None:
        return NULL

    if isListLike(value):
        value = list(getUnicode(_, encoding, noneToNull) for _ in value)
        return value

    if isinstance(value, unicode):
        return value
    elif isinstance(value, basestring):
        while True:
            try:
                return unicode(value, encoding or UNICODE_ENCODING)
            except UnicodeDecodeError, ex:
                try:

# 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

    return getUnicode(retVal, encoding=encoding)


def getUnicode(value, encoding=None, noneToNull=False):
    """
    Return the unicode representation of the supplied value:

    >>> getUnicode(u'test')
    u'test'
    >>> getUnicode('test')
    u'test'
    >>> getUnicode(1)
    u'1'
    """

    if noneToNull and value is None:
        return NULL

    if isListLike(value):
        value = list(getUnicode(_, encoding, noneToNull) for _ in value)
        return value

    if isinstance(value, unicode):
        return value
    elif isinstance(value, basestring):
        while True:
            try:
                return unicode(value, encoding or UNICODE_ENCODING)
            except UnicodeDecodeError, ex:
                try:

                    return unicode(value, UNICODE_ENCODING)