fix mad v2 cps offset
card publisher sector is an absolute sector index but the code compared it against a relative index of mifare 4k sectors
This commit is contained in:
1 parent
3a8c3174a8
commit
fd3a644289
1 file changed
+3
-3
@@ -408,14 +408,14 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) {
|
|||||||
uint16_t aid = madGetAID(sector, swapmad, 2, i);
|
uint16_t aid = madGetAID(sector, swapmad, 2, i);
|
||||||
if (aid < 6) {
|
if (aid < 6) {
|
||||||
PrintAndLogEx(INFO,
|
PrintAndLogEx(INFO,
|
||||||
(ibs == i) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s",
|
(ibs == i + 16) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s",
|
||||||
i + 16,
|
i + 16,
|
||||||
aid,
|
aid,
|
||||||
aid_admin[aid]
|
aid_admin[aid]
|
||||||
);
|
);
|
||||||
} else if (prev_aid == aid) {
|
} else if (prev_aid == aid) {
|
||||||
PrintAndLogEx(INFO,
|
PrintAndLogEx(INFO,
|
||||||
(ibs == i) ? _MAGENTA_(" %02d [%04X] continuation") : " %02d [" _YELLOW_("%04X") "] continuation",
|
(ibs == i + 16) ? _MAGENTA_(" %02d [%04X] continuation") : " %02d [" _YELLOW_("%04X") "] continuation",
|
||||||
i + 16,
|
i + 16,
|
||||||
aid
|
aid
|
||||||
);
|
);
|
||||||
@@ -423,7 +423,7 @@ int MAD2DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose) {
|
|||||||
char fmt[80];
|
char fmt[80];
|
||||||
snprintf(fmt
|
snprintf(fmt
|
||||||
, sizeof(fmt)
|
, sizeof(fmt)
|
||||||
, (ibs == i) ?
|
, (ibs == i + 16) ?
|
||||||
_MAGENTA_(" %02d [%04X] %s") :
|
_MAGENTA_(" %02d [%04X] %s") :
|
||||||
" %02d [" _GREEN_("%04X") "] %s"
|
" %02d [" _GREEN_("%04X") "] %s"
|
||||||
, i + 16
|
, i + 16
|
||||||
|
|||||||
Reference in new issue
Block a user