Ejemplo n.º 1
0
        /// <summary>
        /// Automatically recognizes a Wordlist Type between the ones available by matching the Regex patterns and returning the first successful match.
        /// </summary>
        /// <param name="data">The data for which you want to recognize the Wordlist Type</param>
        /// <returns>The correct Wordlist Type or (if every Regex match failed) the first one</returns>
        public string RecognizeWordlistType(string data)
        {
            foreach (var type in WordlistTypes)
            {
                if (Regex.Match(data, type.Regex).Success)
                {
                    return(type.Name);
                }
            }

            return(WordlistTypes.First().Name);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Gets a Wordlist Type given its name.
 /// </summary>
 /// <param name="name">The name of the Wordlist Type</param>
 /// <returns>The WordlistType object if found, a default one if not</returns>
 public WordlistType GetWordlistType(string name)
 {
     try { return(WordlistTypes.FirstOrDefault(w => w.Name == name)); }
     catch { return(new WordlistType()); }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the names of all Wordlist Types.
 /// </summary>
 /// <returns>The list of all the names of custom Wordlist Types</returns>
 public List <string> GetWordlistTypeNames()
 {
     return(WordlistTypes.Select(w => w.Name).ToList());
 }