diff --git a/src/cracker.c b/src/cracker.c index 65153b7..a4b8eb0 100644 --- a/src/cracker.c +++ b/src/cracker.c @@ -89,7 +89,7 @@ void crack() char *bssid = NULL; char *pin = NULL; int fail_count = 0, loop_count = 0, sleep_count = 0, assoc_fail_count = 0; - float pin_count = 0; + int pin_count = 0; time_t start_time = 0; enum wps_result result = 0; @@ -279,7 +279,8 @@ void crack() case KEY_REJECTED: fail_count = 0; pin_count++; - advance_pin_count(); + if (!get_pin_string_mode()) + advance_pin_count(); break; /* Got it!! */ case KEY_ACCEPTED: @@ -337,9 +338,9 @@ void crack() /* If we've hit our max number of pin attempts, quit */ if((get_max_pin_attempts() > 0) && - (pin_count == get_max_pin_attempts())) + (pin_count >= get_max_pin_attempts())) { - cprintf(VERBOSE, "[+] Quitting after %d crack attempts\n", get_max_pin_attempts()); + cprintf(VERBOSE, "[+] Quitting after %d crack attempts\n", pin_count); break; } } @@ -370,7 +371,7 @@ void advance_pin_count() } /* Displays the status and rate of cracking */ -void display_status(float pin_count, time_t start_time) +void display_status(int pin_count, time_t start_time) { float percentage = 0; int attempts = 0, average = 0; diff --git a/src/cracker.h b/src/cracker.h index 1d0c99d..1db4903 100644 --- a/src/cracker.h +++ b/src/cracker.h @@ -48,6 +48,6 @@ void crack(); void advance_pin_count(); -void display_status(float pin_count, time_t start_time); +void display_status(int pin_count, time_t start_time); #endif