fix reading NDEF from Mifare Classic

This commit is contained in:
dash 2023-05-10 00:33:15 +03:00
parent 5b53bf803d
commit cb0a3257be

View file

@ -5922,10 +5922,10 @@ int CmdHFMFNDEFRead(const char *Cmd) {
}
PrintAndLogEx(INFO, "reading data from tag");
for (int i = 1; i <= madlen; i++) {
for (int i = 0; i < madlen; i++) {
if (ndef_aid == mad[i]) {
uint8_t vsector[MFBLOCK_SIZE * 4] = {0};
if (mfReadSector(i, keyB ? MF_KEY_B : MF_KEY_A, ndefkey, vsector)) {
if (mfReadSector(i + 1, keyB ? MF_KEY_B : MF_KEY_A, ndefkey, vsector)) {
PrintAndLogEx(ERR, "error, reading sector %d ", i + 1);
return PM3_ESOFT;
}