read wordlist
This commit is contained in:
parent
176bd1f5c8
commit
5ba45b640f
1
.gitignore
vendored
1
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
passgen
|
passgen
|
||||||
|
.cache/
|
||||||
|
2
Makefile
2
Makefile
@ -5,7 +5,7 @@ run: passgen
|
|||||||
./passgen
|
./passgen
|
||||||
|
|
||||||
passgen: main.cpp
|
passgen: main.cpp
|
||||||
$(CC) -o passgen main.cpp
|
$(CC) -o passgen main.cpp -std=c++20
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
15
compile_commands.json
Normal file
15
compile_commands.json
Normal 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"
|
||||||
|
}
|
||||||
|
]
|
15552
eff_large_wordlist.txt
15552
eff_large_wordlist.txt
File diff suppressed because it is too large
Load Diff
40
main.cpp
40
main.cpp
@ -1,6 +1,40 @@
|
|||||||
|
#include <format>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
#include <fstream>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
int main() {
|
std::vector<std::string> readWordlist(std::string filePath)
|
||||||
std::cout << "Hello, World!";
|
{
|
||||||
return 0;
|
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";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user