Skip to content

Commit 0f0e97f

Browse files
committed
Update zipcracker.cpp
1 parent 7c48909 commit 0f0e97f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/zipcracker.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -318,19 +318,21 @@ int main(int argc, char* argv[]) {
318318
std::string wordlistPath;
319319
int threadCount = std::thread::hardware_concurrency();
320320
bool recursive = false;
321+
std::string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; // Standard-Zeichen-Set
321322

322323
static struct option long_options[] = {
323324
{"file", required_argument, 0, 'f'},
324325
{"length", required_argument, 0, 'l'},
325326
{"wordlist", required_argument, 0, 'w'},
326327
{"threads", required_argument, 0, 't'},
327328
{"recursive", no_argument, 0, 'r'},
329+
{"charset", required_argument, 0, 'c'}, // Neue Option für das Zeichen-Set
328330
{0, 0, 0, 0}
329331
};
330332

331333
int option_index = 0;
332334
int opt;
333-
while ((opt = getopt_long(argc, argv, "f:l:w:t:r", long_options, &option_index)) != -1) {
335+
while ((opt = getopt_long(argc, argv, "f:l:w:t:rc:", long_options, &option_index)) != -1) {
334336
switch (opt) {
335337
case 'f':
336338
file = optarg;
@@ -352,9 +354,12 @@ int main(int argc, char* argv[]) {
352354
case 'r':
353355
recursive = true;
354356
break;
357+
case 'c':
358+
charset = optarg; // Setze das Zeichen-Set auf den angegebenen Wert
359+
break;
355360
default:
356361
std::cerr << "Verwendung: " << argv[0]
357-
<< " -f <file> [-l <password-length>] [-w <wordlist>] [-t <thread-count>] [-r]\n";
362+
<< " -f <file> [-l <password-length>] [-w <wordlist>] [-t <thread-count>] [-r] [-c <charset>]\n";
358363
return 1;
359364
}
360365
}
@@ -374,8 +379,6 @@ int main(int argc, char* argv[]) {
374379
std::string encryptionType = detectZipEncryption(zipData);
375380
std::cout << "Erkannte Verschlüsselungsmethode: " << encryptionType << std::endl;
376381

377-
const std::string charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
378-
379382
// Queue für Passwörter
380383
std::queue<std::string> passwordQueue;
381384
std::string result;

0 commit comments

Comments
 (0)