'For position independent shellcode from the user'

def user_supplied_shellcode(self, CavesPicked={}):

    if (self.SUPPLIED_SHELLCODE is None):
        print '[!]    User    must    provide    shellcode    for    this    module    (-U)'
        return False
    else:
        supplied_shellcode = open(self.SUPPLIED_SHELLCODE, 'r+b').read()
    self.shellcode1 = 'R'
    self.shellcode1 += '1\xc0'
    self.shellcode1 += '\xb0\x02'
    self.shellcode1 += '\xcd\x80'
    self.shellcode1 += 'Z'
    self.shellcode1 += '\x85\xc0t\x07'
    self.shellcode1 += '\xbd'
    self.shellcode1 += struct.pack('<I', self.e_entry)
    self.shellcode1 += '\xff\xe5'
    self.shellcode1 += supplied_shellcode
    self.shellcode = self.shellcode1
    return self.shellcode1
