diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index ea9443e2e..3082707df 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -717,7 +717,7 @@ int Hf14443_4aGetCardData(iso14a_card_select_t *card) { PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card->uid, card->uidlen)); PrintAndLogEx(SUCCESS, "ATQA: %02X %02X", card->atqa[1], card->atqa[0]); - PrintAndLogEx(SUCCESS, " SAK: %02X [%u]", card->sak, select_status); + PrintAndLogEx(SUCCESS, " SAK: %02X [%" PRIu64 "]", card->sak, select_status); // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes if (card->ats_len < 3) { @@ -2891,7 +2891,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) { PrintAndLogEx(INFO, "---------- " _CYAN_("ISO14443-A Information") " ----------"); PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s") " %s", sprint_hex(card.uid, card.uidlen), get_uid_type(&card)); PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02X %02X"), card.atqa[1], card.atqa[0]); - PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%u]"), card.sak, select_status); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%" PRIu64 "]"), card.sak, select_status); if (version_hw_available) { PrintAndLogEx(DEBUG, "GetV: " _GREEN_("%s"), sprint_hex((uint8_t *)&version_hw, sizeof(version_hw))); } diff --git a/client/src/cmdhffudan.c b/client/src/cmdhffudan.c index 6b61ae969..c9c751000 100644 --- a/client/src/cmdhffudan.c +++ b/client/src/cmdhffudan.c @@ -147,7 +147,7 @@ static int fudan_get_type(iso14a_card_select_t *card, bool verbose) { PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card->uid, card->uidlen)); if (verbose) { PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02X %02X"), card->atqa[1], card->atqa[0]); - PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%u]"), card->sak, select_status); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%" PRIu64 "]"), card->sak, select_status); if (card->ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes if (card->ats_len == card->ats[0] + 2) diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index da1fa1acc..7473751b1 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -11350,7 +11350,7 @@ static int CmdHF14AMfInfo(const char *Cmd) { PrintAndLogEx(INFO, "--- " _CYAN_("ISO14443-a Information") " -----------------------------"); PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen)); PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02X %02X"), card.atqa[1], card.atqa[0]); - PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%u]"), card.sak, select_status); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%" PRIu64 "]"), card.sak, select_status); uint8_t ats_hist_pos = 0; @@ -11966,7 +11966,7 @@ static int CmdHF14AMfISEN(const char *Cmd) { PrintAndLogEx(INFO, "--- " _CYAN_("ISO14443-a Information") " -----------------------------"); PrintAndLogEx(SUCCESS, " UID: " _GREEN_("%s"), sprint_hex(card.uid, card.uidlen)); PrintAndLogEx(SUCCESS, "ATQA: " _GREEN_("%02X %02X"), card.atqa[1], card.atqa[0]); - PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%u]"), card.sak, select_status); + PrintAndLogEx(SUCCESS, " SAK: " _GREEN_("%02X [%" PRIu64 "]"), card.sak, select_status); // if (setDeviceDebugLevel(DBG_DEBUG, false) != PM3_SUCCESS) { if (setDeviceDebugLevel(DBG_EXTENDED, false) != PM3_SUCCESS) { diff --git a/client/src/cmdhfwaveshare.c b/client/src/cmdhfwaveshare.c index 92dd3c308..6f1d7efe9 100644 --- a/client/src/cmdhfwaveshare.c +++ b/client/src/cmdhfwaveshare.c @@ -141,7 +141,7 @@ static int transceive_blocking(uint8_t *txBuf, uint16_t txBufLen, uint8_t *rxBuf uint16_t rlen_141 = 0; if (WaitForIso14aReply(&resp, 2000, &rlen_141, NULL)) { if (rlen_141 > rxBufLen) { - PrintAndLogEx(WARNING, "Received %"PRIu64 " bytes, rxBuf too small (%u)", rlen_141, rxBufLen); + PrintAndLogEx(WARNING, "Received %u bytes, rxBuf too small (%u)", rlen_141, rxBufLen); memcpy(rxBuf, resp.data.asBytes, rxBufLen); *actLen = rxBufLen; return PM3_ESOFT; diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 641c871e1..b7f6e6bad 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -3784,11 +3784,6 @@ int insert_line_if_not_exists(const char *preferredName, const char *keystr) { return PM3_SUCCESS; } -// A dump file that is larger than the caller's buffer used to be clamped down to -// maxdumplen and handed over as if it had that size. That is lossy, and callers -// which sniff the format from the length -- `hf 15 ski` picks iso15_tag_t vs a -// raw memory image by comparing against sizeof(iso15_tag_t) -- then misparse an -// unrelated file as the exact struct they expected. Refuse instead. static int load_dump_check_len(const char *fn, void **pdump, size_t *dumplen, size_t maxdumplen) { if (*dumplen <= maxdumplen) { return PM3_SUCCESS;