def cyclic_metasploit(length=None, sets=None):
 sets = (sets or [string.ascii_uppercase, string.ascii_lowercase, string.digits])
 out = []
 for (ndx, c) in enumerate(metasploit_pattern(sets)):
  if ((length != None) and (ndx >= length)):
   break
  else:
   out.append(c)
 out = ''.join(out)
 if (len(out) < length):
  log.error(("Can't create a pattern of length %i with sets of lengths %s. Maximum pattern length is %i." % (length, map(len, sets), len(out))))
 return ''.join(out)

def cyclic_metasploit ( length = None , sets = None ) : sets = ( sets or [ string . ascii_uppercase , string . ascii_lowercase , string . digits ] ) out = [ ] for ( ndx , c ) in enumerate ( metasploit_pattern ( sets ) ) : if ( ( length != None ) and ( ndx >= length ) ) : break else : out . append ( c ) out = '' . join ( out ) if ( len ( out ) < length ) : log . error ( ( "Can't create a pattern of length %i with sets of lengths %s. Maximum pattern length is %i." % ( length , map ( len , sets ) , len ( out ) ) ) ) return '' . join ( out )
cyclic_metasploit -> str a simple wrapper over :func:metasploit_pattern .