Merge pull request #388 from sh7d/autopwn-fix

autopwn: fix card detection
This commit is contained in:
Philippe Teuwen 2019-09-07 20:07:26 +02:00 committed by GitHub
commit a8e922271b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1660,7 +1660,7 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
// Settings // Settings
bool slow = false; bool slow = false;
bool legacy_mfchk = false; bool legacy_mfchk = false;
bool prng_type = false; int prng_type = PM3_EUNDEF;
bool verbose = false; bool verbose = false;
bool has_filename = false; bool has_filename = false;
bool errors = false; bool errors = false;
@ -1776,8 +1776,13 @@ static int CmdHF14AMfAutoPWN(const char *Cmd) {
} }
} }
// card prng type (weak=true / hard=false) // card prng type (weak=1 / hard=0 / select/card comm error = negative value)
prng_type = detect_classic_prng(); prng_type = detect_classic_prng();
if (prng_type < 0){
PrintAndLogEx(FAILED, "\nNo tag detected or other tag communication error");
free(e_sector);
return prng_type;
}
// print parameters // print parameters
if (verbose) { if (verbose) {