"hf mf ekeyprn d" doesn't works properly (#904)

FIX: command "hf mf ekeyprn  d" doesn't use the correct offset to locate the A key in data[] array and record the 2 last bytes followed by 4 0x00 instead of the 6 good bytes (All the A keys are corrupted in file dumpkeys.bin). B keys are not affected.
This commit is contained in:
Phil 2019-12-28 14:04:46 +01:00 committed by pwpiwi
commit 1d4b67cb3d

View file

@ -2060,7 +2060,7 @@ int CmdHF14AMfEKeyPrn(const char *Cmd)
PrintAndLog("error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1); PrintAndLog("error get block %d", FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1);
break; break;
} }
fwrite(data+6, 1, 6, fkeys); fwrite(data, 1, 6, fkeys);
} }
for(i = 0; i < numSectors; i++) { for(i = 0; i < numSectors; i++) {
if (mfEmlGetMem(data, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1)) { if (mfEmlGetMem(data, FirstBlockOfSector(i) + NumBlocksPerSector(i) - 1, 1)) {