diff --git a/libnfc_crypto1_crack.c b/libnfc_crypto1_crack.c index cdc6008..7225182 100644 --- a/libnfc_crypto1_crack.c +++ b/libnfc_crypto1_crack.c @@ -660,14 +660,6 @@ int main (int argc, const char * argv[]) { space = craptev1_get_space(nonces, 95, uid); } if(space){ - // append some zeroes to the end of the space to make sure threads don't go off into the wild - size_t j = 0; - for(j = 0; space[j]; j+=5){ - } - size_t fill = j + (5*thread_count); - for(; j < fill; j++) { - space[j] = 0; - } total_states = craptev1_sizeof_space(space); } else { total_states = 0; @@ -676,6 +668,14 @@ int main (int argc, const char * argv[]) { fprintf(stderr, "No solution found :(\n"); return 1; } + // append some zeroes to the end of the space to make sure threads don't go off into the wild + size_t j = 0; + for(j = 0; space[j]; j+=5){ + } + size_t fill = j + (5*thread_count); + for(; j < fill; j++) { + space[j] = 0; + } thread_count = get_nprocs_conf(); pthread_t threads[thread_count];