Fix Gen 3 APDU block 0 SAK not being written correctly

This commit is contained in:
Lucifer Voeltner 2024-12-01 16:27:35 +07:00
commit 4adf663300
No known key found for this signature in database
GPG key ID: 4D597A80D50E6B18

View file

@ -3482,7 +3482,8 @@ void MifareGen3Blk(uint8_t block_len, uint8_t *block) {
retval = PM3_ESOFT;
goto OUT;
}
cmd[ofs++] = card_info->sak;
cmd[ofs] = block_len < card_info->uidlen ? card_info->sak : cmd[ofs];
ofs++;
cmd[ofs++] = card_info->atqa[0];
cmd[ofs++] = card_info->atqa[1];
AddCrc14A(cmd, sizeof(block_cmd) + MIFARE_BLOCK_SIZE);