public static void Main(bool impersonate = true, bool threads = false, bool downgrade = true, bool restore = true, string challenge = "1122334455667788", bool verbose = false) { var monologue = new InternalMonologue(impersonate, threads, downgrade, restore, challenge, verbose); var monologueConsole = monologue.Go(); Console.WriteLine(monologueConsole.Output()); }
public static void Main(string[] args) { Dictionary <string, string> argDict = ParseArgs(args); //Set defaults bool impersonate = true, threads = false, downgrade = true, restore = true, verbose = false; string challenge = "1122334455667788"; if (args.Length > 0 && argDict.Count == 0) { PrintHelp(); return; } else if (args.Length == 0) { if (verbose) { Console.Error.WriteLine("Running with default settings. Type -Help for more information.\n"); } } if (argDict.ContainsKey("impersonate")) { if (bool.TryParse(argDict["impersonate"], out impersonate) == false) { PrintError("Impersonate must be a boolean value (True/False)"); return; } } if (argDict.ContainsKey("threads")) { if (bool.TryParse(argDict["threads"], out threads) == false) { PrintError("Threads must be a boolean value (True/False)"); return; } } if (argDict.ContainsKey("downgrade")) { if (bool.TryParse(argDict["downgrade"], out downgrade) == false) { PrintError("Downgrade must be a boolean value (True/False)"); return; } } if (argDict.ContainsKey("restore")) { if (bool.TryParse(argDict["restore"], out restore) == false) { PrintError("Restore must be a boolean value (True/False)"); return; } } if (argDict.ContainsKey("verbose")) { if (bool.TryParse(argDict["verbose"], out verbose) == false) { PrintError("Verbose must be a boolean value (True/False)"); return; } } if (argDict.ContainsKey("challenge")) { challenge = argDict["challenge"].ToUpper(); if (Regex.IsMatch(challenge, @"^[0-9A-F]{16}$") == false) { PrintError("Challenge must be a 8-byte long value in asciihex representation. (e.g. 1122334455667788)"); return; } } if (verbose) { Console.WriteLine("Checking threads for user tokens enabled: {0}", threads); } var monologue = new InternalMonologue(impersonate, threads, downgrade, restore, challenge, verbose); var output = monologue.Go(); Console.WriteLine(output); }