Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.teamlixo.eggcrack;
- import com.teamlixo.eggcrack.crack.CrackJob;
- import java.awt.Adjustable;
- import java.awt.Color;
- import java.awt.Dialog.ModalityType;
- import java.awt.Frame;
- import java.awt.event.ActionEvent;
- import java.awt.event.ActionListener;
- import java.awt.event.AdjustmentEvent;
- import java.awt.event.AdjustmentListener;
- import java.io.BufferedReader;
- import java.io.File;
- import java.io.FileNotFoundException;
- import java.io.FileReader;
- import java.io.IOException;
- import java.io.PrintStream;
- import java.util.ArrayList;
- import java.util.Arrays;
- import javax.swing.JButton;
- import javax.swing.JCheckBox;
- import javax.swing.JComboBox;
- import javax.swing.JDialog;
- import javax.swing.JFileChooser;
- import javax.swing.JFormattedTextField;
- import javax.swing.JLabel;
- import javax.swing.JOptionPane;
- import javax.swing.JPanel;
- import javax.swing.JProgressBar;
- import javax.swing.JRadioButton;
- import javax.swing.JScrollBar;
- import javax.swing.JScrollPane;
- import javax.swing.JSpinner;
- import javax.swing.JTabbedPane;
- import javax.swing.JTable;
- import javax.swing.SpinnerNumberModel;
- import javax.swing.UIManager;
- import javax.swing.UIManager.LookAndFeelInfo;
- import javax.swing.table.DefaultTableModel;
- public class Main
- extends JDialog
- {
- private JPanel contentPane;
- private JSpinner maxthreads;
- private JSpinner interval;
- private JTable table1;
- private JButton start;
- private JScrollPane scroll;
- private JScrollPane scroll2;
- private JLabel thdcount;
- private JLabel crackedcnt;
- private JLabel failedcnt;
- private JLabel tps;
- private JProgressBar progress;
- private JTabbedPane tabs;
- private JButton ul;
- private JFormattedTextField usernamesFile;
- private JButton pl;
- private JButton hl;
- private JButton sl;
- private JFormattedTextField socksProxies;
- private JFormattedTextField httpProxies;
- private JFormattedTextField passwordsFile;
- private JButton ol;
- private JFormattedTextField outputFile;
- private JButton exit;
- private JComboBox api;
- private JCheckBox skipNonPremiumAccountsCheckBox;
- private JCheckBox autoSort;
- private JLabel attemptcnt;
- private JLabel eta;
- private JRadioButton cracking;
- private JRadioButton checking;
- private JLabel ulbl;
- private JLabel plbl;
- private JCheckBox sc;
- private JFormattedTextField submiturl;
- private JCheckBox oc;
- private JCheckBox threadClock;
- private JSpinner proxyTimeout;
- private JCheckBox checkProxies;
- private JLabel checkLbl;
- private JPanel pnl;
- private CrackJob currentJob;
- public Main()
- {
- super((Frame)null, Dialog.ModalityType.TOOLKIT_MODAL);
- $$$setupUI$$$();setContentPane(this.contentPane);
- setModal(true);
- setResizable(false);
- setTitle("EggCrack by Manevolent");
- setName("EggCrack by Manevolent");
- this.maxthreads.setModel(new SpinnerNumberModel(32, 1, 10240000, 2));
- this.interval.setModel(new SpinnerNumberModel(5, 0, 60000, 5));
- this.proxyTimeout.setModel(new SpinnerNumberModel(5000, 1, 300000, 1000));
- this.proxyTimeout.setVisible(false);
- this.checkLbl.setVisible(false);
- String[] columnNames = { "Username", "Password", "Requests", "Status" };
- this.table1.setRowHeight(35);
- this.table1.setModel(new DefaultTableModel(columnNames, 0));
- this.start.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- if (Main.this.start.getText().equals("Stop"))
- {
- if (Main.this.currentJob != null) {
- Main.this.currentJob.setRunning(false);
- }
- Main.this.start.setText("Start");
- return;
- }
- if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive()))
- {
- JOptionPane.showMessageDialog(null, "You already have a cracking job running. Please wait for it to finish.");
- return;
- }
- String[] usernames = Main.this.readAllLines(Main.this.usernamesFile.getText());
- PasswordSourceFile passwords = null;
- try
- {
- if (Main.this.api.getSelectedIndex() > 2) {
- passwords = new PasswordSourceFileStreamed(new File(Main.this.passwordsFile.getText()));
- } else {
- passwords = new PasswordSourceFileBuffered(new File(Main.this.passwordsFile.getText()));
- }
- }
- catch (FileNotFoundException e1) {}catch (IOException e1) {}
- String[] phttp = Main.this.readAllLines(Main.this.httpProxies.getText());
- String[] psocks = Main.this.readAllLines(Main.this.socksProxies.getText());
- if (usernames == null)
- {
- JOptionPane.showMessageDialog(null, "There was a problem opening the usernames file.");
- return;
- }
- if ((Main.this.cracking.isSelected()) && (passwords == null))
- {
- JOptionPane.showMessageDialog(null, "There was a problem opening the password file.");
- return;
- }
- if ((phttp == null) && (psocks == null) &&
- (passwords == null))
- {
- JOptionPane.showMessageDialog(null, "No proxies are loaded! Please choose a proxy list.");
- return;
- }
- if (phttp == null) {
- phttp = new String[0];
- }
- if (psocks == null) {
- psocks = new String[0];
- }
- String ourl = Main.this.oc.isSelected() ? Main.this.outputFile.getText() : null;
- String curl = Main.this.sc.isSelected() ? Main.this.submiturl.getText() : null;
- Main.this.currentJob = CrackJob.fromSettings(Main.this.table1, Main.this.failedcnt, Main.this.crackedcnt, Main.this.thdcount, Main.this.attemptcnt, Main.this.start, Main.this.tps, Main.this.eta, Main.this.progress, usernames, passwords, phttp, psocks, ((Integer)Main.this.maxthreads.getValue()).intValue(), ((Integer)Main.this.interval.getValue()).intValue(), ourl, Main.this.api.getSelectedIndex(), Main.this.skipNonPremiumAccountsCheckBox.isSelected(), Main.this.autoSort.isSelected(), Main.this.cracking.isSelected(), curl, Main.this.threadClock.isSelected(), ((Integer)Main.this.proxyTimeout.getValue()).intValue(), Main.this.checkProxies.isSelected());
- DefaultTableModel model = (DefaultTableModel)Main.this.table1.getModel();
- while (model.getRowCount() > 0) {
- model.removeRow(0);
- }
- if (Main.this.currentJob != null)
- {
- Main.this.start.setText("Stop");
- Main.this.currentJob.updateFormNumbers();
- Main.this.currentJob.setETA();
- Main.this.currentJob.beginJob();
- Main.this.tabs.setSelectedIndex(1);
- }
- else
- {
- Main.this.start.setText("Start");
- }
- }
- });
- this.scroll.getVerticalScrollBar().addAdjustmentListener(new AdjustmentListener()
- {
- public void adjustmentValueChanged(AdjustmentEvent e)
- {
- if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive())) {
- e.getAdjustable().setValue(e.getAdjustable().getMaximum());
- }
- }
- });
- final JFileChooser chooser = new JFileChooser();
- this.ul.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- int returnVal = chooser.showOpenDialog(Main.this);
- if (returnVal == 0)
- {
- File file = chooser.getSelectedFile();
- Main.this.usernamesFile.setText(file.getAbsolutePath());
- }
- }
- });
- this.pl.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- int returnVal = chooser.showOpenDialog(Main.this);
- if (returnVal == 0)
- {
- File file = chooser.getSelectedFile();
- Main.this.passwordsFile.setText(file.getAbsolutePath());
- }
- }
- });
- this.hl.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- int returnVal = chooser.showOpenDialog(Main.this);
- if (returnVal == 0)
- {
- File file = chooser.getSelectedFile();
- Main.this.httpProxies.setText(file.getAbsolutePath());
- }
- }
- });
- this.sl.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- int returnVal = chooser.showOpenDialog(Main.this);
- if (returnVal == 0)
- {
- File file = chooser.getSelectedFile();
- Main.this.socksProxies.setText(file.getAbsolutePath());
- }
- }
- });
- this.ol.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- int returnVal = chooser.showOpenDialog(Main.this);
- if (returnVal == 0)
- {
- File file = chooser.getSelectedFile();
- Main.this.outputFile.setText(file.getAbsolutePath());
- }
- }
- });
- this.exit.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- if ((Main.this.currentJob != null) && (Main.this.currentJob.isAlive())) {
- Main.this.currentJob.endJob();
- }
- System.exit(0);
- }
- });
- this.checking.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- Main.this.passwordsFile.setEnabled(false);
- Main.this.pl.setEnabled(false);
- Main.this.pl.setVisible(false);
- Main.this.passwordsFile.setVisible(false);
- Main.this.plbl.setVisible(false);
- Main.this.ulbl.setText("User:Pass:");
- }
- });
- this.cracking.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- Main.this.passwordsFile.setEnabled(true);
- Main.this.pl.setEnabled(true);
- Main.this.pl.setVisible(true);
- Main.this.passwordsFile.setVisible(true);
- Main.this.plbl.setVisible(true);
- Main.this.ulbl.setText("Usernames:");
- }
- });
- this.checkProxies.addActionListener(new ActionListener()
- {
- public void actionPerformed(ActionEvent e)
- {
- Main.this.proxyTimeout.setVisible(Main.this.checkProxies.isSelected());
- Main.this.checkLbl.setVisible(Main.this.checkProxies.isSelected());
- System.out.println(Main.this.pnl.size());
- }
- });
- }
- private String[] readAllLines(String text)
- {
- File f = new File(text);
- try
- {
- FileReader fr = new FileReader(f);
- BufferedReader br = new BufferedReader(fr);
- ArrayList<String> arr = new ArrayList();
- while (br.ready()) {
- arr.add(br.readLine());
- }
- Object[] objectArray = arr.toArray();
- String[] stringArray = (String[])Arrays.copyOf(objectArray, objectArray.length, String[].class);
- objectArray = null;
- return stringArray;
- }
- catch (FileNotFoundException e)
- {
- return null;
- }
- catch (IOException e)
- {
- e.printStackTrace();
- }
- return null;
- }
- public static void main(String[] args)
- {
- try
- {
- UIManager.put("nimbusBase", new Color(10, 10, 10));
- UIManager.put("nimbusBlueGrey", new Color(200, 200, 210));
- UIManager.put("control", new Color(150, 150, 150));
- for (UIManager.LookAndFeelInfo info : UIManager.getInstalledLookAndFeels()) {
- if ("Nimbus".equals(info.getName()))
- {
- UIManager.setLookAndFeel(info.getClassName());
- break;
- }
- }
- }
- catch (Exception e)
- {
- try
- {
- UIManager.setLookAndFeel(UIManager.getCrossPlatformLookAndFeelClassName());
- }
- catch (Exception ex) {}
- }
- Main dialog = new Main();
- dialog.pack();
- dialog.setLocationRelativeTo(null);
- dialog.setVisible(true);
- System.exit(0);
- }
- private void createUIComponents() {}
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement