# Path: lib/common/completer.py
# class none(object):
# class MainMenuCompleter(object):
# class PayloadCompleter(object):
# class MSFCompleter(object):
# class IPCompleter(object):
# class MSFPortCompleter(object):
# class PathCompleter(object):
# class GreatSCTMainMenuCompleter(object):
#     def complete(self, args):
#     def __init__(self, cmds, payloads):
#     def complete_use(self, args):
#     def complete_info(self, args):
#     def complete(self, text, state):
#     def __init__(self, cmds, payload):
#     def _listdir(self, root):
#     def _complete_path(self, path=None):
#     def complete_path(self, args):
#     def complete_set(self, args):
#     def complete(self, text, state):
#     def __init__(self, payloadTree):
#     def complete(self, text, state):
#     def __init__(self):
#     def complete(self, text, state):
#     def __init__(self):
#     def complete(self, text, state):
#     def __init__(self):
#     def _listdir(self, root):
#     def _complete_path(self, path=None):
#     def complete_path(self, args):
#     def complete(self, text, state):
#     def __init__(self, cmds, tools):
#     def complete_use(self, args):
#     def complete_info(self, args):
#     def complete(self, text, state):
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
# 
# Path: lib/common/helpers.py
# def clean_payloads():
# def color(string, status=True, warning=False, bold=True, yellow=False):
# def check_int(incoming_int):
# def randomString(length=-1):
# def randomKey(b=32):
# def randomNumbers(b=7):
# def validate_hostname(hostname):
# def validate_ip(ip_address):
# def validate_port(port_number):
# 
# Path: Tools/Bypass/bypass_common/bypass_helpers.py
# def deflate(string_val):
# def compileToTemp(language, payloadSource):
# def expiring_payload_variables():
# def format_long(title, message, frontTab=True, spacing=16):
# def inflate(b64string):
# def LHOST():
# def obfuscateNum(N, mod):
# def print_dict_message(commands, show_title=True):
# def randomString(length=-1):
# def title_screen():
# 
# Path: Tools/Bypass/bypass_common/outfile.py
# def compiler(payload_object, invoked=False, cli_object=None):
# def find_file_name(payload_name, selected_payload_object):
# def handler_code_generator(selected_payobject, handler_name, invoked=False, cli_obj=None):
# def hash_executable(exe_path, file_name):
# def print_payload_information(pay_object):
# 
# Path: Tools/Bypass/bypass_common/shellcode_help.py
# class Shellcode:
#     def __init__(self, cli_obj):
#     def Reset(self):
#     def LoadModules(self):
#     def payload_selection_menu(self, showTitle=True):
#     def menu(self):
#     def generate(self, required_options=None):
# def cli_msf_shellcode_gen(command_line_args):


import glob
import imp
import os
import readline
import subprocess
import sys
        import settings
from os.path import join
from lib.common import completer
from lib.common import helpers
from Tools.Bypass.bypass_common import bypass_helpers
from Tools.Bypass.bypass_common import outfile
from Tools.Bypass.bypass_common import shellcode_help
        # This function handles returning the selected payload module object
        # to the calling function
        counter_value = 1
        for payload_path, payload_module in sorted(self.active_payloads.items()):
            if user_selection.isdigit() and (0 < int(user_selection) <= len(self.active_payloads)):
                if int(user_selection) == counter_value:
                    return payload_module
            else:
                if user_selection.lower().strip() == payload_path:
                    return payload_module

            # Iterate counter for number based selection
            counter_value += 1
        return False

    def tool_main_menu(self):
        # This is the main function where everything is called from
        # Iterate over payloads and find the user selected payload module
        bypass_main_command = ''
        show_bypass_menu = True
        while bypass_main_command == '':

            # set out tab completion for the appropriate modules on each run
            # as other modules sometimes reset this
            comp = completer.MainMenuCompleter(self.bypass_main_menu_commands, self.active_payloads)
            readline.set_completer_delims(' \t\n;')
            readline.parse_and_bind("tab: complete")
            readline.set_completer(comp.complete)

            if show_bypass_menu:

# Path: lib/common/completer.py
# class none(object):
# class MainMenuCompleter(object):
# class PayloadCompleter(object):
# class MSFCompleter(object):
# class IPCompleter(object):
# class MSFPortCompleter(object):
# class PathCompleter(object):
# class GreatSCTMainMenuCompleter(object):
#     def complete(self, args):
#     def __init__(self, cmds, payloads):
#     def complete_use(self, args):
#     def complete_info(self, args):
#     def complete(self, text, state):
#     def __init__(self, cmds, payload):
#     def _listdir(self, root):
#     def _complete_path(self, path=None):
#     def complete_path(self, args):
#     def complete_set(self, args):
#     def complete(self, text, state):
#     def __init__(self, payloadTree):
#     def complete(self, text, state):
#     def __init__(self):
#     def complete(self, text, state):
#     def __init__(self):
#     def complete(self, text, state):
#     def __init__(self):
#     def _listdir(self, root):
#     def _complete_path(self, path=None):
#     def complete_path(self, args):
#     def complete(self, text, state):
#     def __init__(self, cmds, tools):
#     def complete_use(self, args):
#     def complete_info(self, args):
#     def complete(self, text, state):
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
#         RE_SPACE = re.compile('.*\s+$', re.M)
# 
# Path: lib/common/helpers.py
# def clean_payloads():
# def color(string, status=True, warning=False, bold=True, yellow=False):
# def check_int(incoming_int):
# def randomString(length=-1):
# def randomKey(b=32):
# def randomNumbers(b=7):
# def validate_hostname(hostname):
# def validate_ip(ip_address):
# def validate_port(port_number):
# 
# Path: Tools/Bypass/bypass_common/bypass_helpers.py
# def deflate(string_val):
# def compileToTemp(language, payloadSource):
# def expiring_payload_variables():
# def format_long(title, message, frontTab=True, spacing=16):
# def inflate(b64string):
# def LHOST():
# def obfuscateNum(N, mod):
# def print_dict_message(commands, show_title=True):
# def randomString(length=-1):
# def title_screen():
# 
# Path: Tools/Bypass/bypass_common/outfile.py
# def compiler(payload_object, invoked=False, cli_object=None):
# def find_file_name(payload_name, selected_payload_object):
# def handler_code_generator(selected_payobject, handler_name, invoked=False, cli_obj=None):
# def hash_executable(exe_path, file_name):
# def print_payload_information(pay_object):
# 
# Path: Tools/Bypass/bypass_common/shellcode_help.py
# class Shellcode:
#     def __init__(self, cli_obj):
#     def Reset(self):
#     def LoadModules(self):
#     def payload_selection_menu(self, showTitle=True):
#     def menu(self):
#     def generate(self, required_options=None):
# def cli_msf_shellcode_gen(command_line_args):


# Path: Tools/Bypass/Tool.py
import glob
import imp
import os
import readline
import subprocess
import sys
        import settings
from os.path import join
from lib.common import completer
from lib.common import helpers
from Tools.Bypass.bypass_common import bypass_helpers
from Tools.Bypass.bypass_common import outfile
from Tools.Bypass.bypass_common import shellcode_help

        # This function handles returning the selected payload module object
        # to the calling function
        counter_value = 1
        for payload_path, payload_module in sorted(self.active_payloads.items()):
            if user_selection.isdigit() and (0 < int(user_selection) <= len(self.active_payloads)):
                if int(user_selection) == counter_value:
                    return payload_module
            else:
                if user_selection.lower().strip() == payload_path:
                    return payload_module

            # Iterate counter for number based selection
            counter_value += 1
        return False

    def tool_main_menu(self):
        # This is the main function where everything is called from
        # Iterate over payloads and find the user selected payload module
        bypass_main_command = ''
        show_bypass_menu = True
        while bypass_main_command == '':

            # set out tab completion for the appropriate modules on each run
            # as other modules sometimes reset this
            comp = completer.MainMenuCompleter(self.bypass_main_menu_commands, self.active_payloads)
            readline.set_completer_delims(' \t\n;')
            readline.parse_and_bind("tab: complete")
            readline.set_completer(comp.complete)

            if show_bypass_menu:

                bypass_helpers.title_screen()