Make -O parameter optional
This commit is contained in:
parent
634f7e3646
commit
27c8490fd2
26
src/mfoc.c
26
src/mfoc.c
@ -131,7 +131,7 @@ int main(int argc, char *const argv[])
|
|||||||
FILE * fp;
|
FILE * fp;
|
||||||
char line[20];
|
char line[20];
|
||||||
char * read;
|
char * read;
|
||||||
|
|
||||||
bool do_clear=false;
|
bool do_clear=false;
|
||||||
//Regexp declarations
|
//Regexp declarations
|
||||||
static const char *regex = "([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f])";
|
static const char *regex = "([0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f][0-9A-Fa-f])";
|
||||||
@ -187,7 +187,7 @@ int main(int argc, char *const argv[])
|
|||||||
j += i;
|
j += i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
// Add this key to the default keys
|
// Add this key to the default keys
|
||||||
p = realloc(defKeys, defKeys_len + 6);
|
p = realloc(defKeys, defKeys_len + 6);
|
||||||
@ -227,10 +227,10 @@ int main(int argc, char *const argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pfDump) {
|
// if (!pfDump) {
|
||||||
ERR("parameter -O is mandatory");
|
// ERR("parameter -O is mandatory");
|
||||||
exit(EXIT_FAILURE);
|
// exit(EXIT_FAILURE);
|
||||||
}
|
// }
|
||||||
|
|
||||||
// Initialize reader/tag structures
|
// Initialize reader/tag structures
|
||||||
mf_init(&r);
|
mf_init(&r);
|
||||||
@ -748,13 +748,15 @@ int main(int argc, char *const argv[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Finally save all keys + data to file
|
// Finally save all keys + data to file
|
||||||
uint16_t dump_size = (t.num_blocks + 1) * 16;
|
if (pfDump) {
|
||||||
if (fwrite(&mtDump, 1, dump_size, pfDump) != dump_size) {
|
uint16_t dump_size = (t.num_blocks + 1) * 16;
|
||||||
fprintf(stdout, "Error, cannot write dump\n");
|
if (fwrite(&mtDump, 1, dump_size, pfDump) != dump_size) {
|
||||||
|
fprintf(stdout, "Error, cannot write dump\n");
|
||||||
|
fclose(pfDump);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
fclose(pfDump);
|
fclose(pfDump);
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
fclose(pfDump);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
free(t.sectors);
|
free(t.sectors);
|
||||||
@ -788,7 +790,7 @@ void usage(FILE *stream, int errno)
|
|||||||
fprintf(stream, " P number of probes per sector, instead of default of 20\n");
|
fprintf(stream, " P number of probes per sector, instead of default of 20\n");
|
||||||
fprintf(stream, " T nonce tolerance half-range, instead of default of 20\n (i.e., 40 for the total range, in both directions)\n");
|
fprintf(stream, " T nonce tolerance half-range, instead of default of 20\n (i.e., 40 for the total range, in both directions)\n");
|
||||||
// fprintf(stream, " s specify the list of sectors to crack, for example -s 0,1,3,5\n");
|
// fprintf(stream, " s specify the list of sectors to crack, for example -s 0,1,3,5\n");
|
||||||
fprintf(stream, " O file in which the card contents will be written (REQUIRED)\n");
|
fprintf(stream, " O file in which the card contents will be written\n");
|
||||||
fprintf(stream, " D file in which partial card info will be written in case PRNG is not vulnerable\n");
|
fprintf(stream, " D file in which partial card info will be written in case PRNG is not vulnerable\n");
|
||||||
fprintf(stream, "\n");
|
fprintf(stream, "\n");
|
||||||
fprintf(stream, "Example: mfoc -O mycard.mfd\n");
|
fprintf(stream, "Example: mfoc -O mycard.mfd\n");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user