Commit 3986eaf0 authored by Jorand Jean-baptiste's avatar Jorand Jean-baptiste
Browse files

update comment

parent b2adfbb9
Loading
Loading
Loading
Loading
+41 −36
Changes for AdaptationParallel/include/statsgen.h: 41 added lines, 36 removed lines.
Original line number Diff line number Diff line
@@ -11,6 +11,10 @@
 */


#ifndef STATSGEN_H
#define STATSGEN_H


#include <string>
#include <unordered_map>
#include <iostream>
@@ -98,7 +102,7 @@ struct thread_data {


/**
 * @brief Calcul and save of all analysed statistics
 * @brief Calcul and save all analysed statistics
 */
class Statsgen {
public:
@@ -111,59 +115,56 @@ public:

	/**
	 * @brief Initialise the name of the database
	 * @param : new value for "filename"
	 * @param name: name of the file
	 */
	void setFilename(std::string);
	void setFilename(std::string name);


	/**
	 * @brief Modify the attribute "hiderare", defining if 
	 * user wants to see statistics below 1%
	 * @param : new value for "hiderare"
	 * @brief useful to hide statistics below 1%
	 * @param hr: 1 to hide, else 0
	 */
	void setHiderare(int);
	void setHiderare(int hr);

	/**
	 * @brief Modify the attribute "top", defining the number
	 * of best results the user wants to see
	 * @param : new value for "top"
	 * @brief Defining the number of best results the user wants to see,
	 * and so the result should be clearer
	 * @param t: number of interesting results
	 */
	void setTop(int);
	void setTop(int t);

	/**
	 * @brief Modify the attribute "regex", defining the regular 
	 * expression of the interesting passwords
	 * @param : new value for "regex"
	 * @brief Defining a regular expression to analyse only
	 * some interesting passwords
	 * @param reg: regular expression
	 */
	void setRegex(std::string);
	void setRegex(std::string reg);

	/**
	 * @brief Modify the attribute "withcount", useful to know
	 * if the database uses the format withcount
	 * @param : new value for "withcount"
	 * @brief Useful to know if the database uses the format withcount
	 * @param var: true if database uses the format withcount, else false
	 */
	void setWithcount(bool);
	void setWithcount(bool var);

	/**
	 * @brief Modify the attribute "limitSimplemask", a filter
	 * for the size of the simple masks
	 * @param : new value for "limitSimplemask"
	 * @brief Filter for the size of the simple masks, can be
	 * used as an optimisation option
	 * @param limit: number that limit the size of the simple masks
	 */
	void setLimitSimplemask(int);
	void setLimitSimplemask(int limit);

	/**
	 * @brief Modify the attribute "limitAdvancedmask", a filter
	 * for the size of the advanced masks
	 * @param : new value for "limitAdvancedmask"
	 * @brief Filter for the size of the advanced masks, can be
	 * used as an optimisation option
	 * @param limit: number that limit the size of the advanced masks
	 */
	void setLimitAdvancedmask(int);
	void setLimitAdvancedmask(int limit);

	/**
	 * @brief Modify the attribute "nbThread", defining the number
	 * of threads the user wants to use
	 * @param : new value for "nbThread"
	 * @brief Number of threads the user wants to use
	 * @param nb: number of usable threads
	 */
	void setNbThread(int);
	void setNbThread(int nb);


	/**
@@ -178,6 +179,7 @@ public:
	 */
	int generate_stats();
	

	/**
	 * @brief Print all calculated statistics
	 */
@@ -230,7 +232,7 @@ private:


/**
 * @brief analyse a letter in a password
 * @brief Analyse a letter in a password
 * @param letter: current letter
 * @param last_simplemask: last analyzed part of the simple masks 
 * @param simplemask_string: current simple mask
@@ -242,21 +244,21 @@ private:
void analyse_letter(const char & letter, char & last_simplemask, std::wstring & simplemask_string, std::wstring & advancedmask_string, Policy & policy, int & sizeAdvancedMask, int & sizeSimpleMask);

/**
 * @brief analyse the characterset of the current password
 * @brief Analyse the characterset of the current password
 * @param charset: characterset of the current password
 * @param policy: current number of digit, lower, upper and special for the current password
 */
void analyse_charset(std::wstring & charset, const Policy & policy);

/**
 * @brief analyse a password
 * @brief Analyse a password
 * @param password: current password
 * @param c: container of all useful data of the password
 */
void analyze_password(const std::wstring & password, Container & c);

/**
 * @brief update minima and maxima of all general data from analysed passwords 
 * @brief Update minima and maxima of all general data from analysed passwords 
 * with the analysed passwords
 * @param minMaxValue: save all minima and maxima
 * @param pol : policy of the last analyzed password
@@ -264,7 +266,10 @@ void analyze_password(const std::wstring & password, Container & c);
void updateMinMax(minMax & minMaxValue, const Policy & pol);

/**
* @brief action of all threads
* @brief Action of all threads
* @param threadarg : all useful argument for the thread
*/
void * generate_stats_thread(void * threadarg);


#endif
 No newline at end of file
+10 −7
Changes for AdaptationParallel/include/utils.h: 10 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -17,6 +17,10 @@ using namespace std;



#ifndef UTILS_STATSGEN_H
#define UTILS_STATSGEN_H


template<typename K, typename V>
using UnorderedMapIterator = typename unordered_map<K, V>::const_iterator;

@@ -27,8 +31,7 @@ using MapIterator = typename map<K, V>::const_iterator;


/**
 * @brief Useful functions to order an unoredered map
 * whatever the key's type
 * @brief Order an unoredered map whatever the key's type
 * @param src: unoredered map than needed to be ordered
 * @return ordered map
 */
@@ -45,7 +48,7 @@ multimap<double, A> flip_map(const std::unordered_map<A, double> & src) {


/**
 * @brief print a line of statistics
 * @brief Print a line of statistics
 * @param res: value of this statistic
 * @param crac: the statistic to display
 * @param count: the number of statistics already displayed
@@ -71,7 +74,7 @@ void readResult(double res, Type carac, int & count, const double & total_counte


/**
 * @brief print an unordered map
 * @brief Print an unordered map
 * @param stats: map to show
 * @param top: number of results to show
 * @param total_counter: number of finded passwords
@@ -100,9 +103,9 @@ void showMap(const unordered_map<Type, double> & stats, const int & top, const d


/**
 * @brief calculate the number of line in a file
 * @brief Calculate the number of line in a file
 * @param filename: name of the file
 * @return : number of line
 * @return number of line
 */
int nbline_file(const string & filename) {
    wifstream readfile(filename);
@@ -119,7 +122,7 @@ int nbline_file(const string & filename) {




#endif


+1 −1
Changes for GUI/GUI.pro.user: 1 added line, 1 removed line.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.0, 2018-02-07T18:52:03. -->
<!-- Written by QtCreator 4.5.0, 2018-02-07T19:42:37. -->
<qtcreator>
 <data>
  <variable>EnvironmentId</variable>
+11
Changes for GUI/main.cpp: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
/**
 * @file main.cpp
 *
 * @author Jean-Baptiste Jorand
 * @author Yannick Bass
 * Copyright (c) 2018 Jorand Jean-baptiste Bass Yannick
 * All rights reserved.
 *
 * Please see the attached LICENSE file for additional licensing information.
 */

#include "mainwindow.h"
#include <QApplication>

+11
Changes for GUI/mainwindow.cpp: 11 added lines, 0 removed lines.
Original line number Diff line number Diff line
/**
 * @file mainwindow.cpp
 *
 * @author Jean-Baptiste Jorand
 * @author Yannick Bass
 * Copyright (c) 2018 Jorand Jean-baptiste Bass Yannick
 * All rights reserved.
 *
 * Please see the attached LICENSE file for additional licensing information.
 */

#include "mainwindow.h"
#include "ui_mainwindow.h"

Loading