mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-08-28 22:58:26 +00:00
Fix MAD1 off-by-one in MADDecode: loop read Key A as 16th AID
This commit is contained in:
@@ -262,8 +262,7 @@ int MADDecode(uint8_t *sector0, uint8_t *sector16, uint16_t *mad, size_t *madlen
|
||||
PrintAndLogEx(INFO, "overriding crc check");
|
||||
}
|
||||
|
||||
// 7 + 8 == 15
|
||||
for (int i = 1; i <= 16; i++) {
|
||||
for (int i = 1; i < 16; i++) {
|
||||
mad[*madlen] = madGetAID(sector0, swapmad, 1, i);
|
||||
(*madlen)++;
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
|
||||
#include "common.h"
|
||||
|
||||
// 16 MAD1 AIDs + 1 MAD2 marker (0x0005) + 23 MAD2 AIDs = 40
|
||||
#define MAD_MAX_AID_ENTRIES 40
|
||||
// 15 MAD1 AIDs (sectors 1-15) + 1 MAD2 marker (0x0005) + 23 MAD2 AIDs (sectors 17-39) = 39
|
||||
#define MAD_MAX_AID_ENTRIES 39
|
||||
|
||||
int MADCheck(uint8_t *sector0, uint8_t *sector16, bool verbose, bool *haveMAD2);
|
||||
int MADDecode(uint8_t *sector0, uint8_t *sector16, uint16_t *mad, size_t *madlen, bool swapmad, bool override);
|
||||
|
||||
Reference in New Issue
Block a user