Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace StupidCodeForGeneratingARandomString {
- class Program {
- readonly static String[] badword = new string[] { "hunter2","correcthorsebatterystaple","Tr0ub4d0r&3"};
- static void Main(string[] args) {
- AppDomain.CurrentDomain.UnhandledException += unhandledExpection; GenerateNextPassWordCharActer(Environment.Is64BitProcess ? args : args);
- }
- static void GenerateNextPassWordCharActer(string[] info) { if (int.Parse(info[0]) >= getStr_len(info[1])) {
- System.Threading.Thread.Sleep(20);
- Char charplused = (char)(new Random()).Next(48, 90);
- if (info[1] + charplused == "hunter2" | info[1] + charplused == "correcthorsebatterystaple" | badword.Contains(info[1] + charplused)) {
- throw new Exception(info[0] + ' ' + "n");
- }
- throw new Exception(info[0] + " " + info[1] + charplused);
- }
- else { System.Console.WriteLine((String)info[1]); System.Threading.Thread.Sleep((int)-1d); };
- }
- private static void unhandledExpection(object sender, UnhandledExceptionEventArgs e) {
- System.Diagnostics.Process.Start(System.Reflection.Assembly.GetEntryAssembly().Location, ((Exception)e.ExceptionObject).Message);}
- private static double getStr_len(String chars) {
- float counter = 0;
- while (counter < chars.Length) {
- counter = counter + 1;
- }
- return counter;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment