Advertisement
Guest User

Untitled

a guest
Apr 24th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.85 KB | None | 0 0
  1. using System;
  2. using System.Diagnostics;
  3. using System.Text;
  4. using System.Threading;
  5.  
  6. namespace code_gen
  7. {
  8. class Program
  9. {
  10. static DateTime date = DateTime.Now;
  11.  
  12. static void logo()
  13. {
  14. string test = string.Format(@" __ __ {0} | \ | \{0} _______ | $$ __ ______ ______ _| $$_{0} / \| $$ / \ / \ / \ | $$ \{0}| $$$$$$$| $$_/ $$| $$$$$$\| $$$$$$\ \$$$$$${0} \$$ \ | $$ $$ | $$ $$| $$ $$ | $$ __{0} _\$$$$$$\| $$$$$$\ | $$$$$$$$| $$$$$$$$ | $$| \{0}| $$| $$ \$$\ \$$ \ \$$ \ \$$ $${0} \$$$$$$$ \$$ \$$ \$$$$$$$ \$$$$$$$ \$$$${0}{0}", Environment.NewLine);
  15. for (int i = 0; i < test.Length; i++)
  16. {
  17. Console.Write(test[i]);
  18. }
  19. }
  20.  
  21. static void patch()
  22. {
  23. Console.Write("Patching...");
  24. Thread.Sleep(900);
  25.  
  26. ProcessStartInfo patched = new ProcessStartInfo();
  27. patched.Arguments = "-patched";
  28. patched.CreateNoWindow = true;
  29. patched.FileName = System.Reflection.Assembly.GetExecutingAssembly().Location;
  30. Process.Start(patched);
  31. Environment.Exit(0);
  32. }
  33.  
  34. static void credentials()
  35. {
  36. Console.Write("username: ");
  37. string username = Console.ReadLine();
  38. Console.Clear();
  39.  
  40. logo();
  41.  
  42. string password = "";
  43. Console.Write("password: ");
  44. ConsoleKeyInfo key;
  45.  
  46. try
  47. {
  48. do
  49. {
  50. key = Console.ReadKey(true);
  51. password += key.KeyChar;
  52. if ((key.Key == ConsoleKey.Enter) || (key.Key == ConsoleKey.Backspace))
  53. {
  54. password = password.Remove(password.Length - 1);
  55. Console.Write("\b \b");
  56. }
  57. }
  58. while (key.Key != ConsoleKey.Enter);
  59. }
  60. catch (Exception ex)
  61. {
  62. Console.Write(ex.Message);
  63. }
  64. 
  65. Console.Clear();
  66. login(username, password);
  67. }
  68.  
  69. static void login(string v1, string v2)
  70. {
  71. if ((v1 == "admin") && (v2 == "admin"))
  72. {
  73. menu(v1);
  74. }
  75. else
  76. {
  77. Console.Write("failure");
  78. Environment.Exit(0);
  79. }
  80. }
  81.  
  82. static void menu(string g1)
  83. {
  84. Console.Title = "SKEET ADMIN PANEL | " + g1 + " | " + date;
  85.  
  86. logo();
  87.  
  88. Console.WriteLine("welcome " + g1);
  89. Console.ForegroundColor = ConsoleColor.Green;
  90. Console.WriteLine("commands: cmds, clear, generate");
  91. Console.ResetColor();
  92.  
  93. listen();
  94. }
  95.  
  96. static void listen()
  97. {
  98. string command = Console.ReadLine();
  99. do_command(command);
  100. }
  101.  
  102. static void do_command(string cmd)
  103. {
  104. if (cmd == "cmds")
  105. {
  106. Console.ForegroundColor = ConsoleColor.Green;
  107. Console.WriteLine("commands: cmds, clear, generate");
  108. Console.ResetColor();
  109. listen();
  110. }
  111. else if (cmd == "clear")
  112. {
  113. Console.Clear();
  114. logo();
  115. Console.ForegroundColor = ConsoleColor.Green;
  116. Console.WriteLine("commands: cmds, clear, generate");
  117. Console.ResetColor();
  118. listen();
  119. }
  120. else if (cmd == "generate")
  121. {
  122. Console.WriteLine(gencode(48));
  123. listen();
  124. }
  125. }
  126.  
  127. public static string gencode(int length)
  128. {
  129. Random random = new Random();
  130. string characters = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
  131. StringBuilder result = new StringBuilder(length);
  132. for (int i = 0; i < length; i++)
  133. {
  134. result.Append(characters[random.Next(characters.Length)]);
  135. }
  136. return result.ToString();
  137. }
  138.  
  139. static void Main(string[] args)
  140. {
  141. Console.Title = "SKEET ADMIN PANEL | |" + date;
  142.  
  143. logo();
  144.  
  145. if (args.Length <= 0)
  146. patch();
  147.  
  148. if (args.Length > 0)
  149. {
  150. if (args[0].ToString() == "-patched")
  151. {
  152. credentials();
  153. Console.ReadKey();
  154. }
  155. }
  156. }
  157. }
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement