read wordlist

This commit is contained in:
Mans Ziesel 2024-04-28 12:32:48 +02:00
parent 176bd1f5c8
commit 5ba45b640f
5 changed files with 7830 additions and 7780 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
passgen
.cache/

View File

@ -5,7 +5,7 @@ run: passgen
./passgen
passgen: main.cpp
$(CC) -o passgen main.cpp
$(CC) -o passgen main.cpp -std=c++20
.PHONY: clean

15
compile_commands.json Normal file
View File

@ -0,0 +1,15 @@
[
{
"arguments": [
"/usr/bin/g++",
"-c",
"-std=c++20",
"-o",
"passgen",
"main.cpp"
],
"directory": "/home/mans/dev/passgen",
"file": "/home/mans/dev/passgen/main.cpp",
"output": "/home/mans/dev/passgen/passgen"
}
]

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,40 @@
#include <format>
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
int main() {
std::cout << "Hello, World!";
return 0;
std::vector<std::string> readWordlist(std::string filePath)
{
std::vector<std::string> map;
std::ifstream file(filePath);
if (file.is_open()) {
std::string line;
while (std::getline(file, line)) {
map.push_back(line);
}
} else {
std::cout << std::format("ERROR: failed op open '{}'\n", filePath);
}
return map;
}
int main(int argc, char *argv[]) {
std::string path;
if (argc == 2) {
path = argv[1];
} else {
path = "eff_large_wordlist.txt";
}
std::vector<std::string> wordlist = readWordlist(path);
if (wordlist.size() == 0) {
return 1;
}
std::cout << wordlist[0] << "\n";
}