Exemplo n.º 1
0
VDictPane::VDictPane() {
	// Create dictionary list
	dictListView = new QListView();
	
	addButton = new QPushButton(tr("&Add"));
	removeButton = new QPushButton(tr("&Remove"));
	updateButton = new QPushButton(tr("&Update"));
	QGridLayout * layout = new QGridLayout();
	layout->addWidget(dictListView, 0, 0, 1, 3, Qt::AlignTop);
	layout->addWidget(addButton, 1, 0, Qt::AlignBottom);
	layout->addWidget(removeButton, 1, 1, Qt::AlignBottom);
	layout->addWidget(updateButton, 1, 2, Qt::AlignBottom);
	
	// Initial widget states and connections
	connect(addButton, SIGNAL(clicked()), this, SLOT(addWordList()));
	connect(removeButton, SIGNAL(clicked()), this, SLOT(removeWordList()));
	connect(updateButton, SIGNAL(clicked()), this, SLOT(updateWordLists()));
	addButton->setEnabled(true);
	removeButton->setEnabled(true);
	updateButton->setEnabled(true);
	
	setLayout(layout);
	
	dictManager = 0;
}
Exemplo n.º 2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    lastcnf = new config();
    crackingProcess = new QProcess(this);
    initializeHashType(ui->comboBox);
    initializeOutputType(ui->comboBox_2);
    loadWordList();
    ui->txtSalt->setDisabled(true);
	ui->txtLog->installEventFilter(this);
	//connect(ui->txtLog,SIGNAL(keyPressEvent()),this,SLOT(handleKeyPress()));
    connect(ui->btnclipboard,SIGNAL(clicked()),this,SLOT(handleClipboardHash()));
    connect(ui->btnBrowseInput,SIGNAL(clicked()),this,SLOT(handleOpenInput()));
    connect(ui->btnBrowseOutput,SIGNAL(clicked()),this,SLOT(handleOpenOutput()));
    connect(crackingProcess,SIGNAL(started()),this,SLOT(processStarted()));
    connect(crackingProcess,SIGNAL(finished(int, QProcess::ExitStatus)),this,SLOT(processDone(int,QProcess::ExitStatus)));
    connect(crackingProcess,SIGNAL(readyReadStandardOutput()),this,SLOT(showLog()));
    connect(ui->btnAction,SIGNAL(clicked()),this,SLOT(startCracking()));
    connect(ui->btnCreate,SIGNAL(clicked()),this,SLOT(createHashFile()));
    connect(ui->btnAdd,SIGNAL(clicked()),this,SLOT(addWordList()));
    connect(ui->btnRemove,SIGNAL(clicked()),this,SLOT(deleteWordList()));
    connect(ui->btnBrowseSalt,SIGNAL(clicked()),this,SLOT(handleOpenSalt()));
    connect(ui->btnBrowseProg,SIGNAL(clicked()),this,SLOT(handleOpenProg()));
    connect(ui->btnUp,SIGNAL(clicked()),this,SLOT(moveWordUp()));
    connect(ui->btnDown,SIGNAL(clicked()),this,SLOT(moveWordDown()));
    ui->txtInputFile->setText(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/input.txt");
    ui->txtOutputFile->setText(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation) + "/output.txt");
#ifdef Q_OS_WIN32
    ui->txtProg->setText("hashcat-cli32.exe");
#endif
#ifdef Q_OS_DARWIN
    ui->txtProg->setText("/usr/local/bin/hashcat");
#endif
    if(lastcnf->lasthashpath != "")
        ui->txtInputFile->setText(lastcnf->lasthashpath);
    if(lastcnf->hashcatpath != "")
        ui->txtProg->setText(lastcnf->hashcatpath);
    if(lastcnf->separator != "")
        ui->sep->setText(lastcnf->separator);
    ui->tab_3->setFocus();
    createActionText("idle");
    if(lastcnf->lastdir != "")
        lastdir = lastcnf->lastdir;
    else
        lastdir = QDir::currentPath();
}