mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 22:03:42 -07:00
Merge pull request #773 from lukaskuzmiak/madv2-fixes
Mifare MADv2 fixes
This commit is contained in:
commit
150017ce09
1 changed files with 6 additions and 7 deletions
|
@ -148,7 +148,7 @@ static int madCRCCheck(uint8_t *sector, bool verbose, int MADver) {
|
||||||
} else {
|
} else {
|
||||||
uint8_t crc = CRC8Mad(§or[1], 15 + 16 + 16);
|
uint8_t crc = CRC8Mad(§or[1], 15 + 16 + 16);
|
||||||
if (crc != sector[0]) {
|
if (crc != sector[0]) {
|
||||||
PrintAndLogEx(WARNING, _RED_("Wrong MAD %d CRC") " calculated: 0x%02x != 0x%02x", MADver, crc, sector[16]);
|
PrintAndLogEx(WARNING, _RED_("Wrong MAD %d CRC") " calculated: 0x%02x != 0x%02x", MADver, crc, sector[0]);
|
||||||
return PM3_ESOFT;
|
return PM3_ESOFT;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -282,10 +282,7 @@ static int MADInfoByteDecode(uint8_t *sector, bool swapmad, int mad_ver, bool ve
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info) {
|
|
||||||
return info;
|
return info;
|
||||||
}
|
|
||||||
return PM3_ESOFT;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int MAD1DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose, bool *haveMAD2) {
|
int MAD1DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose, bool *haveMAD2) {
|
||||||
|
@ -333,8 +330,6 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) {
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(INFO, "------------ " _CYAN_("MAD v2 details") " -------------");
|
PrintAndLogEx(INFO, "------------ " _CYAN_("MAD v2 details") " -------------");
|
||||||
|
|
||||||
PrintAndLogEx(INFO, " 16 MAD v2");
|
|
||||||
|
|
||||||
int res = madCRCCheck(sector, true, 2);
|
int res = madCRCCheck(sector, true, 2);
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
if (res == PM3_SUCCESS)
|
if (res == PM3_SUCCESS)
|
||||||
|
@ -350,6 +345,10 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) {
|
||||||
PrintAndLogEx(WARNING, "Card publisher " _RED_("not") " present " _YELLOW_("0x%02x"), ibs);
|
PrintAndLogEx(WARNING, "Card publisher " _RED_("not") " present " _YELLOW_("0x%02x"), ibs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PrintAndLogEx(NORMAL, "");
|
||||||
|
PrintAndLogEx(INFO, "---------------- " _CYAN_("Listing") " ----------------");
|
||||||
|
|
||||||
|
PrintAndLogEx(INFO, " 16 MAD v2");
|
||||||
|
|
||||||
uint32_t prev_aid = 0xFFFFFFFF;
|
uint32_t prev_aid = 0xFFFFFFFF;
|
||||||
for (int i = 1; i < 8 + 8 + 7 + 1; i++) {
|
for (int i = 1; i < 8 + 8 + 7 + 1; i++) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue