return values

This commit is contained in:
iceman1001 2019-08-28 21:12:32 +02:00
parent 94f6a402e8
commit f3ab9632f0

View file

@ -209,7 +209,8 @@ int mfCheckKeys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk,
// initialize storage for found keys // initialize storage for found keys
icesector_t *tmp = calloc(sectorsCnt, sizeof(icesector_t)); icesector_t *tmp = calloc(sectorsCnt, sizeof(icesector_t));
if (tmp == NULL) if (tmp == NULL)
return 1; return PM3_EMALLOC;
memcpy(tmp, resp.data.asBytes, sectorsCnt * sizeof(icesector_t)); memcpy(tmp, resp.data.asBytes, sectorsCnt * sizeof(icesector_t));
for (int i = 0; i < sectorsCnt; i++) { for (int i = 0; i < sectorsCnt; i++) {
@ -227,11 +228,11 @@ int mfCheckKeys_fast(uint8_t sectorsCnt, uint8_t firstChunk, uint8_t lastChunk,
free(tmp); free(tmp);
if (curr_keys == sectorsCnt * 2) if (curr_keys == sectorsCnt * 2)
return 0; return PM3_SUCCESS;
if (lastChunk) if (lastChunk)
return 1; return PM3_ESOFT;
} }
return 1; return PM3_ESOFT;
} }
// PM3 imp of J-Run mf_key_brute (part 2) // PM3 imp of J-Run mf_key_brute (part 2)