mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-07-05 20:41:39 -07:00
remove rain mode
This commit is contained in:
parent
ac2fd35b4f
commit
f423875d90
4 changed files with 7 additions and 34 deletions
29
bfg.c
29
bfg.c
|
@ -1,6 +1,5 @@
|
|||
|
||||
/* code original by Jan Dlabal <dlabaljan@gmail.com>, partially rewritten by vh,
|
||||
rainy tweaks by owein <yvain29@gmail.com>*/
|
||||
/* code original by Jan Dlabal <dlabaljan@gmail.com>, partially rewritten by vh. */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <math.h>
|
||||
|
@ -174,8 +173,6 @@ int32_t bf_init(char *arg) {
|
|||
|
||||
bf_options.crs_len = crs_len;
|
||||
bf_options.current = bf_options.from;
|
||||
bf_options.rain = 0;
|
||||
bf_options.gcounter = 0;
|
||||
|
||||
memset((char *) bf_options.state, 0, sizeof(bf_options.state));
|
||||
|
||||
|
@ -202,7 +199,7 @@ uint64_t bf_get_pcount() {
|
|||
return foo;
|
||||
}
|
||||
|
||||
char *bf_next(_Bool rainy) {
|
||||
char *bf_next() {
|
||||
int32_t i, pos = bf_options.current - 1;
|
||||
|
||||
if (bf_options.current > bf_options.to)
|
||||
|
@ -213,18 +210,7 @@ char *bf_next(_Bool rainy) {
|
|||
return NULL;
|
||||
}
|
||||
|
||||
if(rainy)
|
||||
{
|
||||
bf_options.rain = bf_options.gcounter;
|
||||
bf_options.ptr[0] = bf_options.crs[bf_options.state[0]];
|
||||
for(i=1; i<bf_options.current; ++i) {
|
||||
bf_options.ptr[i] = bf_options.crs[(bf_options.state[i] + bf_options.rain) % bf_options.crs_len];
|
||||
bf_options.rain -= bf_options.rain / bf_options.crs_len;
|
||||
}
|
||||
bf_options.gcounter++;
|
||||
}
|
||||
else
|
||||
for(i=0; i<bf_options.current; ++i)
|
||||
for(i=0; i<bf_options.current; ++i)
|
||||
bf_options.ptr[i] = bf_options.crs[bf_options.state[i]];
|
||||
//we don't subtract the same depending on wether the length is odd or even
|
||||
bf_options.ptr[bf_options.current] = 0;
|
||||
|
@ -237,14 +223,6 @@ char *bf_next(_Bool rainy) {
|
|||
}
|
||||
|
||||
//we revert the ordering of the bruteforce to fix the first static character
|
||||
if(rainy) {
|
||||
pos = 0;
|
||||
while (pos < bf_options.current && (++bf_options.state[pos]) >= bf_options.crs_len) {
|
||||
bf_options.state[pos] = 0;
|
||||
pos++;
|
||||
}
|
||||
}
|
||||
else
|
||||
while (pos >= 0 && (++bf_options.state[pos]) >= bf_options.crs_len) {
|
||||
bf_options.state[pos] = 0;
|
||||
pos--;
|
||||
|
@ -252,7 +230,6 @@ char *bf_next(_Bool rainy) {
|
|||
|
||||
if (pos < 0 || pos >= bf_options.current) {
|
||||
bf_options.current++;
|
||||
bf_options.rain = 0;
|
||||
memset((char *)bf_options.state, 0, sizeof(bf_options.state));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue