mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-13 10:43:01 +08:00
check MAD crc
This commit is contained in:
parent
b9dc841bf9
commit
01c9325469
1 changed files with 6 additions and 1 deletions
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include "mad.h"
|
||||
#include "ui.h"
|
||||
#include "crc.h"
|
||||
|
||||
madAIDDescr madKnownAIDs[] = {
|
||||
{0x0000, "free"},
|
||||
|
@ -48,7 +49,11 @@ int MAD1DecodeAndPrint(uint8_t *sector, bool verbose, bool *haveMAD2) {
|
|||
if (haveMAD2)
|
||||
*haveMAD2 = (MADVer == 2);
|
||||
|
||||
|
||||
uint8_t crc = CRC8Mad(§or[16 + 1], 31);
|
||||
if (crc != sector[16]) {
|
||||
PrintAndLogEx(ERR, "Wrong MAD CRC. Calculated crc: 0x%02x, from sector: 0x%02x", crc, sector[16]);
|
||||
return 3;
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue