Files
miLazyCracker/crypto1_bs.diff
Philippe Teuwen 9f400e970f Remove warning
2018-10-03 09:03:50 +02:00

23 lines
741 B
Diff

diff --git a/libnfc_crypto1_crack.c b/libnfc_crypto1_crack.c
index 2015dcb..0fa7436 100755
--- a/libnfc_crypto1_crack.c
+++ b/libnfc_crypto1_crack.c
@@ -730,6 +730,17 @@ int main (int argc, const char * argv[]) {
return 1;
} else {
printf("Found key: %012"PRIx64"\n", found_key);
+ if (argc==7) {
+ FILE *fpKey = NULL;
+ fpKey = fopen(argv[6], "a");
+ if (fpKey) {
+ fprintf(fpKey, "%012"PRIx64"\r\n", found_key);
+ fclose(fpKey);
+ } else {
+ fprintf(stderr, "Cannot open: %s, exiting\n", argv[6]);
+ return 1;
+ }
+ }
}
printf("Tested %"llu" states\n", total_states_tested);