Markopy
Utilizing Markov Models for brute forcing attacks
Markov::GUI::Train Class Reference

QT Training page class. More...

#include <Train.h>

Inheritance diagram for Markov::GUI::Train:
Collaboration diagram for Markov::GUI::Train:

Public Slots

void home ()
 
void train ()
 

Public Member Functions

 Train (QWidget *parent=Q_NULLPTR)
 

Private Attributes

Ui::Train ui
 

Detailed Description

QT Training page class.

Definition at line 15 of file Train.h.

Constructor & Destructor Documentation

◆ Train()

Markov::GUI::Train::Train ( QWidget *  parent = Q_NULLPTR)

Definition at line 22 of file Train.cpp.

23  : QMainWindow(parent)
24 {
25  ui.setupUi(this);
26 
27 
28 
29  QObject::connect(ui.pushButton, &QPushButton::clicked, this, [this] {train(); });
30  QObject::connect(ui.pushButton_2, &QPushButton::clicked, this, [this] {home(); });
31  //QObject::connect(ui.pushButton_3, &QPushButton::clicked, this, [this] {goGenerate(); });
32 
33  //ui.pushButton_3->setVisible(false);
34 
35 
36 }
Ui::Train ui
Definition: Train.h:21

References ui.

Member Function Documentation

◆ home

void Markov::GUI::Train::home ( )
slot

Definition at line 73 of file Train.cpp.

73  {
74  CLI* w = new CLI;
75  w->show();
76  this->close();
77 }
QT CLI Class.
Definition: CLI.h:14

◆ train

void Markov::GUI::Train::train ( )
slot

Definition at line 38 of file Train.cpp.

38  {
39 
40 
41 
42  QString file_name = QFileDialog::getOpenFileName(this, "Open a File", QDir::homePath());
43  QFile file(file_name);
44 
45  if (!file.open(QFile::ReadOnly | QFile::Text)) {
46  QMessageBox::warning(this, "Error", "File Not Open!");
47  }
48  QTextStream in(&file);
49  QString text = in.readAll();
50  ui.plainTextEdit->setPlainText(text);
51 
52 
53  char* cstr;
54  std::string fname = file_name.toStdString();
55  cstr = new char[fname.size() + 1];
56  strcpy(cstr, fname.c_str());
57 
58 
59 
60  char a=',';
62  mp.Import("models/2gram.mdl");
63  mp.Train(cstr, a, 10); //please parameterize this hardcoded 10 threads
64  mp.Export("models/finished.mdl");
65 
66  ui.label_2->setText("Training DONE!");
67  //ui.pushButton_3->setVisible(true);
68 
69 
70  file.close();
71 }
Markov::Model with char represented nodes.
Definition: mp.py:1

References Markov::API::MarkovPasswords::Train(), and ui.

Referenced by Python.Markopy.BaseCLI::process().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ui

Ui::Train Markov::GUI::Train::ui
private

Definition at line 21 of file Train.h.

Referenced by train(), and Train().


The documentation for this class was generated from the following files: