Closed matrix closed 3 years ago
Hi @matrix,
After using this feature I have a suggestion that I think would make it stronger. I'd love to see an interface for this that uses a mask. This would allow for permutations in separators.
The mask arg could accept non-tokenized chars as well, allowing you to support the --sepStart and --sepEnd args; though this also lets you put in static chars anywhere in the mask.
To support your original example, I could imagine the use case being something in the shape of:
$ ./combinatorX.bin -1 words.txt -2 separators.txt ['?1?2?1?2?1$2$1,*]
Getting some ugly warnings, please fix (even if it's just a continue statement):
combinatorX.c: In function ‘session_init’:
combinatorX.c:79:5: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
79 | ftruncate (fileno (sfp), ftell (sfp));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c:85:3: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result [-Wunused-result]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c: In function ‘session_update’:
combinatorX.c:104:3: warning: ignoring return value of ‘ftruncate’, declared with attribute warn_unused_result [-Wunused-result]
104 | ftruncate (fileno (sfp), ftell (sfp));
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More warnings:
combinatorX.c: In function ‘session_init’:
combinatorX.c:77:41: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:45: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:49: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:53: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:57: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:19: warning: too many arguments for format [-Wformat-extra-args]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c:77:41: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:45: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:49: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:53: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:57: warning: unknown conversion type character ‘z’ in format [-Wformat=]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^
combinatorX.c:77:19: warning: too many arguments for format [-Wformat-extra-args]
77 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu",*off_fd1, *off_fd2, *off_fd3, *off_fd4, *off_fd5, *off_vir_in1, *off_vir_in2, *off_vir_in3, *off_vir_in4, *off_vir_in5);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c:85:34: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:38: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:42: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:46: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:16: warning: too many arguments for format [-Wformat-extra-args]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c:85:34: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:38: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:42: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:46: warning: unknown conversion type character ‘z’ in format [-Wformat=]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^
combinatorX.c:85:16: warning: too many arguments for format [-Wformat-extra-args]
85 | fscanf (sfp, "%ld %ld %ld %ld %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c: In function ‘session_update’:
combinatorX.c:102:39: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:43: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:47: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:51: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:55: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:17: warning: too many arguments for format [-Wformat-extra-args]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
combinatorX.c:102:39: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:43: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:47: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:51: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:55: warning: unknown conversion type character ‘z’ in format [-Wformat=]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^
combinatorX.c:102:17: warning: too many arguments for format [-Wformat-extra-args]
102 | fprintf (sfp, "%ld %ld %ld %ld %ld %zu %zu %zu %zu %zu", off_fd1, off_fd2, off_fd3, off_fd4, off_fd5, off_vir_in1, off_vir_in2, off_vir_in3, off_vir_in4, off_vir_in5);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I think you need to use PRIu64 macro, see hashcat sources.
Hi Jens,
i modified your combinator3, creating an improved version which I called "combinatorX". Following the help with an example.
See you soon, Gabriele