public void LoadGenerator(StringGenerator Generator) { textBoxName.Text = Generator.Name; comboBoxEncoding.SelectedIndex = GeneratorEncoding.ReturnEncodingIndex(Generator.Encoding); textBoxCharacterSet.Text = Generator.CharacterSet; numericUpDownStringLength.Value = Convert.ToDecimal(Generator.StringLength); checkBoxAllowRepetitions.Checked = Generator.AllowRepetitions; }
public StringGenerator GetGenerator() { StringGenerator stringGenerator = new StringGenerator(); stringGenerator.Name = textBoxName.Text; stringGenerator.Encoding = GeneratorEncoding.GetEncoding(comboBoxEncoding.SelectedIndex); stringGenerator.StringLength = Convert.ToInt32(numericUpDownStringLength.Value); stringGenerator.CharacterSet = textBoxCharacterSet.Text; stringGenerator.AllowRepetitions = checkBoxAllowRepetitions.Checked; return stringGenerator; }
private List<string> BuildStrings(StringGenerator Generator, string URL, string Text) { List<string> Fuzzed = new List<string>(); List<char> Used = new List<char>(); for (int i = 0; i <= Generator.CharacterSet.Length-1; i++) { Char NewChar = Generator.CharacterSet[i]; if (!Generator.AllowRepetitions) if (Text.Contains(NewChar.ToString())) continue; string NewText = Text +NewChar.ToString(); if (Text.Length + 1 < Generator.StringLength) Fuzzed.AddRange(BuildStrings(Generator, URL, NewText)); if (NewText.Length == Generator.StringLength) Fuzzed.Add(URL.Replace("{" + Generator.Name + "}", NewText)); } return Fuzzed; }