mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
fixed some color to mad directory printings and fixed a sector issue in when saving keyfiles to Mifare Plus cards
This commit is contained in:
parent
2010d10f81
commit
d65094b7e0
2 changed files with 18 additions and 8 deletions
|
@ -551,19 +551,19 @@ int saveFileJSONex(const char *preferredName, JSONFileType ftype, uint8_t *data,
|
|||
if (atslen > 0)
|
||||
JsonSaveBufAsHexCompact(root, "$.Card.ATS", &data[14], atslen);
|
||||
|
||||
uint8_t vdata[2][64][16 + 1] = {{{0}}};
|
||||
memcpy(vdata, &data[14 + atslen], 2 * 64 * 17);
|
||||
uint8_t vdata[2][64][17] = {{{0}}};
|
||||
memcpy(vdata, data + (14 + atslen), 2 * 64 * 17);
|
||||
|
||||
for (size_t i = 0; i < datalen; i++) {
|
||||
char path[PATH_MAX_LENGTH] = {0};
|
||||
|
||||
if (vdata[0][i][0]) {
|
||||
snprintf(path, sizeof(path), "$.SectorKeys.%d.KeyA", mfSectorNum(i));
|
||||
snprintf(path, sizeof(path), "$.SectorKeys.%zu.KeyA", i);
|
||||
JsonSaveBufAsHexCompact(root, path, &vdata[0][i][1], 16);
|
||||
}
|
||||
|
||||
if (vdata[1][i][0]) {
|
||||
snprintf(path, sizeof(path), "$.SectorKeys.%d.KeyB", mfSectorNum(i));
|
||||
snprintf(path, sizeof(path), "$.SectorKeys.%zu.KeyB", i);
|
||||
JsonSaveBufAsHexCompact(root, path, &vdata[1][i][1], 16);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -331,12 +331,22 @@ int MAD1DecodeAndPrint(uint8_t *sector, bool swapmad, bool verbose, bool *haveMA
|
|||
for (int i = 1; i < 16; i++) {
|
||||
uint16_t aid = madGetAID(sector, swapmad, 1, i);
|
||||
if (aid < 6) {
|
||||
PrintAndLogEx(INFO, (ibs == i) ? _MAGENTA_(" %02d [%04X] (%s)") : " %02d [%04X] (%s)", i, aid, aid_admin[aid]);
|
||||
PrintAndLogEx(INFO,
|
||||
(ibs == i) ? _MAGENTA_(" %02d [%04X] %s") : " %02d [" _GREEN_("%04X") "] %s",
|
||||
i,
|
||||
aid,
|
||||
aid_admin[aid]
|
||||
);
|
||||
|
||||
} else if (prev_aid == aid) {
|
||||
PrintAndLogEx(INFO, (ibs == i) ? _MAGENTA_(" %02d [%04X] (continuation)") : " %02d [%04X] (continuation)", i, aid);
|
||||
PrintAndLogEx(INFO,
|
||||
(ibs == i) ? _MAGENTA_(" %02d [%04X] continuation") : " %02d [" _YELLOW_("%04X") "] continuation",
|
||||
i,
|
||||
aid
|
||||
);
|
||||
} else {
|
||||
char fmt[30];
|
||||
snprintf(fmt, sizeof(fmt), (ibs == i) ? _MAGENTA_(" %02d [%04X]%s") : " %02d [%04X]%s", i, aid, "%s");
|
||||
char fmt[60];
|
||||
snprintf(fmt, sizeof(fmt), (ibs == i) ? _MAGENTA_(" %02d [%04X]%s") : " %02d [" _GREEN_("%04X") "]%s", i, aid, "%s");
|
||||
print_aid_description(mad_known_aids, aid, fmt, verbose);
|
||||
prev_aid = aid;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue