// TEST method GenerateRandomText /// <summary> /// Generates random text based on parameters /// </summary> /// <param name="length"></param> /// <param name="textElement"></param> /// <returns></returns> public static string GenerateRandomText(int length, StringFeatures textElement) { //x "!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~"; string allowedChars = string.Empty; if (textElement.HasFlag(StringFeatures.SymbolEasy)) { allowedChars += "#$%&*+=?"; } if (textElement.HasFlag(StringFeatures.SymbolDifficult)) { allowedChars += "!\"'(),-./:;<>@[\\]^_`{|}~"; } if (textElement.HasFlag(StringFeatures.Number)) { allowedChars += "0123456789"; } if (textElement.HasFlag(StringFeatures.LetterUpper)) { allowedChars += "ABCDEFGHJKLMNOPQRSTUVWXYZ"; } if (textElement.HasFlag(StringFeatures.LetterLower)) { allowedChars += "abcdefghijkmnopqrstuvwxyz"; } var chars = new char[length]; for (int i = 0; i < length; i++) { chars[i] = allowedChars[Randomizer.Next(0, allowedChars.Length)]; } return(new string(chars)); }
public void CheckSupportedStringDecrypter(StringFeatures feature) { if ((deob.StringFeatures & feature) == feature) { return; } throw new UserException(string.Format("Deobfuscator {0} does not support this string decryption type", deob.TypeLong)); }
public void checkSupportedStringDecrypter(StringFeatures feature) { if ((deob.StringFeatures & feature) == feature) return; throw new UserException(string.Format("Deobfuscator {0} does not support this string decryption type", deob.TypeLong)); }
public bool FeatureHasValue(string feature) { return(StringFeatures.ContainsKey(feature)); }
public bool HasFeature(string feature) { return(BooleanFeatures.ContainsKey(feature) || StringFeatures.ContainsKey(feature)); }
public void AddFeature(string feature, string value) { StringFeatures.Add(feature, value); StringFeatureKeys.Add(feature); }