Loading Statsgen/GUI.pro→GUI.pro +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ QT += core gui QT += widgets QT += charts TARGET = cpack-gui TARGET = cppack-gui TEMPLATE = app INCLUDEPATH += include Loading Statsgen/makefile→Makefile +3 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ LDFLAGS = -lpthread SRC = src INC = include OBJ = obj BIN = cpack BIN = cppack BINGUI = $(BIN)-gui .PHONY = clean Loading @@ -21,8 +21,8 @@ $(OBJ)/statsgen.o: $(SRC)/core/statsgen.cpp $(INC)/statsgen.h $(INC)/utils.h $(CXX) $(CXXFLAGS) $< -c -o $@ clean: -rm -rf $(OBJ) -rm -rf $(OBJ)/* $(BINGUI): qmake -o qmakefile make -f qmakefile $(MAKE) -f qmakefile readme.md→Readme.md +0 −0 File moved. View file Report/.gitkeepdeleted 100644 → 0 +0 −0 Empty file deleted. Utils/convert.cppdeleted 100644 → 0 +0 −69 Original line number Diff line number Diff line #include <iostream> #include <fstream> #include <regex> using namespace std; int main(int argc,char* argv[]) { if(argc < 3) { wcerr << "\nMissing arguments\n" << endl; return -1; } locale::global(locale("")); string filename=argv[1]; string outputfile=argv[2]; wifstream readfile(filename); wofstream writefile(outputfile.c_str()); wstring line; /*wstring cleanKey = wstring(L"^\\s+"); wstring repl = wstring(L""); wstring parseKey = wstring(L"\\s*(\\d+) (.+)");*/ double sum=0; while(readfile.good()) { getline(readfile, line); if (line.size() == 0) { continue; } /*wstring cleanLine = regex_replace(line, std::wregex(cleanKey), repl); wsmatch parsedPassword; regex_match(line,parsedPassword,std::wregex(parseKey)); if(parsedPassword.size()>2) { int nbPasswords=stoi(parsedPassword[1]); for(int j=0;j<nbPasswords;j++) { writefile << parsedPassword[2] << endl; } }*/ bool number=false; int i=0; for(i=0;i<line.length();i++) { if(iswdigit(line.at(i))) { number=true; } else if (!iswdigit(line.at(i)) && number) { break; } } wstring password=line.substr(i+1,line.length()); int nbPasswords=stoi(line.substr(0,i)); sum+=nbPasswords; for(int j=0;j<nbPasswords;j++) { writefile << password << endl; } } wcout << L"Numbers of passwords :"<<sum<<endl; } Loading
Statsgen/GUI.pro→GUI.pro +1 −1 Original line number Diff line number Diff line Loading @@ -2,7 +2,7 @@ QT += core gui QT += widgets QT += charts TARGET = cpack-gui TARGET = cppack-gui TEMPLATE = app INCLUDEPATH += include Loading
Statsgen/makefile→Makefile +3 −3 Original line number Diff line number Diff line Loading @@ -4,7 +4,7 @@ LDFLAGS = -lpthread SRC = src INC = include OBJ = obj BIN = cpack BIN = cppack BINGUI = $(BIN)-gui .PHONY = clean Loading @@ -21,8 +21,8 @@ $(OBJ)/statsgen.o: $(SRC)/core/statsgen.cpp $(INC)/statsgen.h $(INC)/utils.h $(CXX) $(CXXFLAGS) $< -c -o $@ clean: -rm -rf $(OBJ) -rm -rf $(OBJ)/* $(BINGUI): qmake -o qmakefile make -f qmakefile $(MAKE) -f qmakefile
Utils/convert.cppdeleted 100644 → 0 +0 −69 Original line number Diff line number Diff line #include <iostream> #include <fstream> #include <regex> using namespace std; int main(int argc,char* argv[]) { if(argc < 3) { wcerr << "\nMissing arguments\n" << endl; return -1; } locale::global(locale("")); string filename=argv[1]; string outputfile=argv[2]; wifstream readfile(filename); wofstream writefile(outputfile.c_str()); wstring line; /*wstring cleanKey = wstring(L"^\\s+"); wstring repl = wstring(L""); wstring parseKey = wstring(L"\\s*(\\d+) (.+)");*/ double sum=0; while(readfile.good()) { getline(readfile, line); if (line.size() == 0) { continue; } /*wstring cleanLine = regex_replace(line, std::wregex(cleanKey), repl); wsmatch parsedPassword; regex_match(line,parsedPassword,std::wregex(parseKey)); if(parsedPassword.size()>2) { int nbPasswords=stoi(parsedPassword[1]); for(int j=0;j<nbPasswords;j++) { writefile << parsedPassword[2] << endl; } }*/ bool number=false; int i=0; for(i=0;i<line.length();i++) { if(iswdigit(line.at(i))) { number=true; } else if (!iswdigit(line.at(i)) && number) { break; } } wstring password=line.substr(i+1,line.length()); int nbPasswords=stoi(line.substr(0,i)); sum+=nbPasswords; for(int j=0;j<nbPasswords;j++) { writefile << password << endl; } } wcout << L"Numbers of passwords :"<<sum<<endl; }