mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2026-05-12 11:18:11 -07:00
fix few printf arg types
This commit is contained in:
@@ -1522,7 +1522,7 @@ struct arg_dbl *arg_dbln(
|
||||
addr = (size_t)(result + 1);
|
||||
rem = addr % sizeof(double);
|
||||
result->dval = (double *)(addr + sizeof(double) - rem);
|
||||
ARG_TRACE(("addr=%p, dval=%p, sizeof(double)=%d rem=%d\n", addr, result->dval, (int)sizeof(double), (int)rem));
|
||||
ARG_TRACE(("addr=%zu, dval=%p, sizeof(double)=%d rem=%d\n", addr, result->dval, (int)sizeof(double), (int)rem));
|
||||
|
||||
result->count = 0;
|
||||
}
|
||||
|
||||
+1
-1
@@ -260,7 +260,7 @@ static int CmdAnalyseLCR(const char *Cmd) {
|
||||
PrintAndLogEx(WARNING, "Invalid HEX value.");
|
||||
return 1;
|
||||
case 2:
|
||||
PrintAndLogEx(WARNING, "Too many bytes. Max %d bytes", sizeof(data));
|
||||
PrintAndLogEx(WARNING, "Too many bytes. Max %zu bytes", sizeof(data));
|
||||
return 1;
|
||||
case 3:
|
||||
PrintAndLogEx(WARNING, "Hex must have even number of digits.");
|
||||
|
||||
+16
-16
@@ -553,7 +553,7 @@ int ASKDemod_ext(const char *Cmd, bool verbose, bool emSearch, uint8_t askType,
|
||||
|
||||
size_t BitLen = getFromGraphBuf(bits);
|
||||
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) #samples from graphbuff: %d", BitLen);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) #samples from graphbuff: %zu", BitLen);
|
||||
|
||||
if (BitLen < 255) {
|
||||
free(bits);
|
||||
@@ -591,18 +591,18 @@ int ASKDemod_ext(const char *Cmd, bool verbose, bool emSearch, uint8_t askType,
|
||||
int errCnt = askdemod_ext(bits, &BitLen, &clk, &invert, maxErr, askamp, askType, &startIdx);
|
||||
|
||||
if (errCnt < 0 || BitLen < 16) { //if fatal error (or -1)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) No data found errors:%d, invert:%c, bitlen:%d, clock:%d", errCnt, (invert) ? 'Y' : 'N', BitLen, clk);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) No data found errors:%d, invert:%c, bitlen:%zu, clock:%d", errCnt, (invert) ? 'Y' : 'N', BitLen, clk);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
if (errCnt > maxErr) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) Too many errors found, errors:%d, bits:%d, clock:%d", errCnt, BitLen, clk);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) Too many errors found, errors:%d, bits:%zu, clock:%d", errCnt, BitLen, clk);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
if (verbose) PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) Using clock:%d, invert:%d, bits found:%d, start index %d", clk, invert, BitLen, startIdx);
|
||||
if (verbose) PrintAndLogEx(DEBUG, "DEBUG: (ASKDemod_ext) Using clock:%d, invert:%d, bits found:%zu, start index %d", clk, invert, BitLen, startIdx);
|
||||
|
||||
//output
|
||||
setDemodBuff(bits, BitLen, 0);
|
||||
@@ -812,7 +812,7 @@ int AutoCorrelate(const int *in, int *out, size_t len, size_t window, bool SaveG
|
||||
// sanity check
|
||||
if (window > len) window = len;
|
||||
|
||||
if (verbose) PrintAndLogEx(INFO, "performing " _YELLOW_("%d")" correlations", GraphTraceLen - window);
|
||||
if (verbose) PrintAndLogEx(INFO, "performing " _YELLOW_("%zu")" correlations", GraphTraceLen - window);
|
||||
|
||||
//test
|
||||
double autocv = 0.0; // Autocovariance value
|
||||
@@ -870,7 +870,7 @@ int AutoCorrelate(const int *in, int *out, size_t len, size_t window, bool SaveG
|
||||
distance = idx_1 - idx;
|
||||
PrintAndLogEx(SUCCESS, "possible visible correlation %4d samples", distance);
|
||||
} else if (verbose && (correlation > 1)) {
|
||||
PrintAndLogEx(SUCCESS, "possible correlation %4d samples", correlation);
|
||||
PrintAndLogEx(SUCCESS, "possible correlation %4zu samples", correlation);
|
||||
} else {
|
||||
PrintAndLogEx(FAILED, "no repeating pattern found, try increasing window size");
|
||||
}
|
||||
@@ -912,7 +912,7 @@ static int CmdAutoCorr(const char *Cmd) {
|
||||
case 'w':
|
||||
window = param_get32ex(Cmd, cmdp + 1, 4000, 10);
|
||||
if (window >= GraphTraceLen) {
|
||||
PrintAndLogEx(WARNING, "window must be smaller than trace (%d samples)", GraphTraceLen);
|
||||
PrintAndLogEx(WARNING, "window must be smaller than trace (%zu samples)", GraphTraceLen);
|
||||
errors = true;
|
||||
}
|
||||
cmdp += 2;
|
||||
@@ -1222,17 +1222,17 @@ int PSKDemod(const char *Cmd, bool verbose) {
|
||||
int startIdx = 0;
|
||||
int errCnt = pskRawDemod_ext(bits, &bitlen, &clk, &invert, &startIdx);
|
||||
if (errCnt > maxErr) {
|
||||
if (g_debugMode || verbose) PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) Too many errors found, clk: %d, invert: %d, numbits: %d, errCnt: %d", clk, invert, bitlen, errCnt);
|
||||
if (g_debugMode || verbose) PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) Too many errors found, clk: %d, invert: %d, numbits: %zu, errCnt: %d", clk, invert, bitlen, errCnt);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
if (errCnt < 0 || bitlen < 16) { //throw away static - allow 1 and -1 (in case of threshold command first)
|
||||
if (g_debugMode || verbose) PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) no data found, clk: %d, invert: %d, numbits: %d, errCnt: %d", clk, invert, bitlen, errCnt);
|
||||
if (g_debugMode || verbose) PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) no data found, clk: %d, invert: %d, numbits: %zu, errCnt: %d", clk, invert, bitlen, errCnt);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
if (verbose || g_debugMode) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) Using Clock:%d, invert:%d, Bits Found:%d", clk, invert, bitlen);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) Using Clock:%d, invert:%d, Bits Found:%zu", clk, invert, bitlen);
|
||||
if (errCnt > 0) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (PSKdemod) errors during Demoding (shown as 7 in bit stream): %d", errCnt);
|
||||
}
|
||||
@@ -1264,7 +1264,7 @@ static int CmdIdteckDemod(const char *Cmd) {
|
||||
else if (idx == -3)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: preamble not found");
|
||||
else if (idx == -4)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: size not correct: %d", size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: size not correct: %zu", size);
|
||||
else
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: idx: %d", idx);
|
||||
|
||||
@@ -1283,7 +1283,7 @@ static int CmdIdteckDemod(const char *Cmd) {
|
||||
else if (idx == -3)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: preamble not found");
|
||||
else if (idx == -4)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: size not correct: %d", size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: size not correct: %zu", size);
|
||||
else
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Idteck: idx: %d", idx);
|
||||
|
||||
@@ -1346,17 +1346,17 @@ int NRZrawDemod(const char *Cmd, bool verbose) {
|
||||
|
||||
errCnt = nrzRawDemod(bits, &BitLen, &clk, &invert, &clkStartIdx);
|
||||
if (errCnt > maxErr) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) Too many errors found, clk: %d, invert: %d, numbits: %d, errCnt: %d", clk, invert, BitLen, errCnt);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) Too many errors found, clk: %d, invert: %d, numbits: %zu, errCnt: %d", clk, invert, BitLen, errCnt);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
if (errCnt < 0 || BitLen < 16) { //throw away static - allow 1 and -1 (in case of threshold command first)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) no data found, clk: %d, invert: %d, numbits: %d, errCnt: %d", clk, invert, BitLen, errCnt);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) no data found, clk: %d, invert: %d, numbits: %zu, errCnt: %d", clk, invert, BitLen, errCnt);
|
||||
free(bits);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
if (verbose || g_debugMode) PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) Tried NRZ Demod using Clock: %d - invert: %d - Bits Found: %d", clk, invert, BitLen);
|
||||
if (verbose || g_debugMode) PrintAndLogEx(DEBUG, "DEBUG: (NRZrawDemod) Tried NRZ Demod using Clock: %d - invert: %d - Bits Found: %zu", clk, invert, BitLen);
|
||||
//prime demod buffer for output
|
||||
setDemodBuff(bits, BitLen, 0);
|
||||
setClockGrid(clk, clkStartIdx);
|
||||
@@ -1779,7 +1779,7 @@ static int CmdLoad(const char *Cmd) {
|
||||
|
||||
fclose(f);
|
||||
|
||||
PrintAndLogEx(SUCCESS, "loaded %d samples", GraphTraceLen);
|
||||
PrintAndLogEx(SUCCESS, "loaded %zu samples", GraphTraceLen);
|
||||
|
||||
uint8_t bits[GraphTraceLen];
|
||||
size_t size = getFromGraphBuf(bits);
|
||||
|
||||
@@ -266,7 +266,7 @@ static int CmdFlashMemLoad(const char *Cmd) {
|
||||
|
||||
conn.block_after_ACK = false;
|
||||
free(data);
|
||||
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%u")"bytes to offset "_GREEN_("%u"), datalen, start_index);
|
||||
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%zu")"bytes to offset "_GREEN_("%u"), datalen, start_index);
|
||||
return PM3_SUCCESS;
|
||||
}
|
||||
static int CmdFlashMemDump(const char *Cmd) {
|
||||
|
||||
@@ -413,7 +413,7 @@ static int CmdFlashMemSpiFFSLoad(const char *Cmd) {
|
||||
|
||||
conn.block_after_ACK = false;
|
||||
free(data);
|
||||
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%u") "bytes to file "_GREEN_("%s"), datalen, destfilename);
|
||||
PrintAndLogEx(SUCCESS, "Wrote "_GREEN_("%zu") "bytes to file "_GREEN_("%s"), datalen, destfilename);
|
||||
|
||||
// We want to unmount after these to set things back to normal but more than this
|
||||
// unmouting ensure that SPIFFS CACHES are all flushed so our file is actually written on memory
|
||||
|
||||
+4
-4
@@ -553,7 +553,7 @@ int ExchangeRAW14a(uint8_t *datain, int datainlen, bool activateField, bool leav
|
||||
}
|
||||
|
||||
if (resp.oldarg[0] != 1 && resp.oldarg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.oldarg[0]);
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=" PRId64 ".", resp.oldarg[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -647,7 +647,7 @@ static int SelectCard14443_4(bool disconnect, iso14a_card_select_t *card) {
|
||||
}
|
||||
|
||||
if (resp.oldarg[0] != 1 && resp.oldarg[0] != 2) {
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%d.", resp.oldarg[0]);
|
||||
PrintAndLogEx(ERR, "Card not in iso14443-4. res=%" PRId64 ".", resp.oldarg[0]);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -1376,7 +1376,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
||||
int16_t fsci = card.ats[1] & 0x0f;
|
||||
|
||||
PrintAndLogEx(NORMAL, " - T0 : TA1 is%s present, TB1 is%s present, "
|
||||
"TC1 is%s present, FSCI is %d (FSC = %ld)",
|
||||
"TC1 is%s present, FSCI is %d (FSC = %d)",
|
||||
(ta1 ? "" : " NOT"),
|
||||
(tb1 ? "" : " NOT"),
|
||||
(tc1 ? "" : " NOT"),
|
||||
@@ -1408,7 +1408,7 @@ int infoHF14A(bool verbose, bool do_nack_test) {
|
||||
if (tb1) {
|
||||
uint32_t sfgi = card.ats[pos] & 0x0F;
|
||||
uint32_t fwi = card.ats[pos] >> 4;
|
||||
PrintAndLogEx(NORMAL, " - TB1 : SFGI = %d (SFGT = %s%ld/fc), FWI = %d (FWT = %ld/fc)",
|
||||
PrintAndLogEx(NORMAL, " - TB1 : SFGI = %d (SFGT = %s%d/fc), FWI = %d (FWT = %d/fc)",
|
||||
(sfgi),
|
||||
sfgi ? "" : "(not needed) ",
|
||||
sfgi ? (1 << 12) << sfgi : 0,
|
||||
|
||||
+1
-1
@@ -900,7 +900,7 @@ static int CmdHF14BDump(const char *Cmd) {
|
||||
//select
|
||||
if (WaitForResponseTimeout(CMD_ACK, &resp, 2000)) {
|
||||
if (resp.oldarg[0]) {
|
||||
PrintAndLogEx(INFO, "failed to select %d | %d", resp.oldarg[0], resp.oldarg[1]);
|
||||
PrintAndLogEx(INFO, "failed to select %" PRId64 " | %" PRId64, resp.oldarg[0], resp.oldarg[1]);
|
||||
goto out;
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -534,7 +534,7 @@ static int CmdHF15Demod(const char *Cmd) {
|
||||
}
|
||||
}
|
||||
|
||||
PrintAndLogEx(NORMAL, "SOF at %d, correlation %d", maxPos, max / (ARRAYLEN(FrameSOF) / skip));
|
||||
PrintAndLogEx(NORMAL, "SOF at %d, correlation %zu", maxPos, max / (ARRAYLEN(FrameSOF) / skip));
|
||||
|
||||
i = maxPos + ARRAYLEN(FrameSOF) / skip;
|
||||
int k = 0;
|
||||
@@ -1228,7 +1228,7 @@ static int CmdHF15Restore(const char *Cmd) {
|
||||
cmdp++;
|
||||
}
|
||||
|
||||
PrintAndLogEx(INFO, "Blocksize: %u", blocksize);
|
||||
PrintAndLogEx(INFO, "Blocksize: %zu", blocksize);
|
||||
|
||||
if (!strlen(filename)) {
|
||||
PrintAndLogEx(WARNING, "Please provide a filename");
|
||||
@@ -1259,7 +1259,7 @@ static int CmdHF15Restore(const char *Cmd) {
|
||||
fclose(f);
|
||||
return 0;
|
||||
} else if (bytes_read != blocksize) {
|
||||
PrintAndLogEx(ERR, "File reading error (%s), %u bytes read instead of %u bytes.", filename, bytes_read, blocksize);
|
||||
PrintAndLogEx(ERR, "File reading error (%s), %zu bytes read instead of %zu bytes.", filename, bytes_read, blocksize);
|
||||
fclose(f);
|
||||
return 2;
|
||||
}
|
||||
|
||||
+2
-2
@@ -50,7 +50,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) {
|
||||
|
||||
// check if command failed
|
||||
if (resp.oldarg[0] != 0) {
|
||||
PrintAndLogEx(FAILED, "Error in step %d, Return code: %d", resp.oldarg[0], (int)resp.oldarg[1]);
|
||||
PrintAndLogEx(FAILED, "Error in step %" PRId64 ", Return code: %" PRId64, resp.oldarg[0], (int)resp.oldarg[1]);
|
||||
} else {
|
||||
size_t nonce_length = resp.oldarg[1];
|
||||
char *nonce = (char *) calloc(2 * nonce_length + 1, sizeof(uint8_t));
|
||||
@@ -58,7 +58,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) {
|
||||
sprintf(nonce + (2 * j), "%02X", resp.data.asBytes[j]);
|
||||
}
|
||||
// print nonce
|
||||
PrintAndLogEx(NORMAL, "Length: %d, Nonce: %s", nonce_length, nonce);
|
||||
PrintAndLogEx(NORMAL, "Length: %zu, Nonce: %s", nonce_length, nonce);
|
||||
free(nonce);
|
||||
}
|
||||
if (i < n - 1) {
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "cmdparser.h" // command_t
|
||||
#include "comms.h"
|
||||
@@ -391,7 +392,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
uint64_t tracelen = resp.oldarg[1];
|
||||
uint32_t tracelen = resp.oldarg[1];
|
||||
if (tracelen == 0)
|
||||
return 1;
|
||||
|
||||
@@ -407,7 +408,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %d bytes)", tracelen);
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %"PRIu64" bytes)", tracelen);
|
||||
|
||||
print_hex_break(trace, tracelen, 32);
|
||||
printSep();
|
||||
|
||||
+7
-7
@@ -75,14 +75,14 @@ static int CmdHFFidoInfo(const char *cmd) {
|
||||
|
||||
if (!strncmp((char *)buf, "U2F_V2", 7)) {
|
||||
if (!strncmp((char *)buf, "FIDO_2_0", 8)) {
|
||||
PrintAndLogEx(INFO, "FIDO2 authenticator detected. Version: %.*s", len, buf);
|
||||
PrintAndLogEx(INFO, "FIDO2 authenticator detected. Version: %.*s", (int)len, buf);
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "FIDO authenticator detected (not standard U2F).");
|
||||
PrintAndLogEx(INFO, "Non U2F authenticator version:");
|
||||
dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(INFO, "FIDO U2F authenticator detected. Version: %.*s", len, buf);
|
||||
PrintAndLogEx(INFO, "FIDO U2F authenticator detected. Version: %.*s", (int)len, buf);
|
||||
}
|
||||
|
||||
res = FIDO2GetInfo(buf, sizeof(buf), &len, &sw);
|
||||
@@ -274,7 +274,7 @@ static int CmdHFFidoRegister(const char *cmd) {
|
||||
PrintAndLogEx(NORMAL, "");
|
||||
if (APDULogging)
|
||||
PrintAndLogEx(NORMAL, "---------------------------------------------------------------");
|
||||
PrintAndLogEx(NORMAL, "data len: %d", len);
|
||||
PrintAndLogEx(NORMAL, "data len: %zu", len);
|
||||
if (verbose2) {
|
||||
PrintAndLogEx(NORMAL, "--------------data----------------------");
|
||||
dump_buffer((const unsigned char *)buf, len, NULL, 0);
|
||||
@@ -316,7 +316,7 @@ static int CmdHFFidoRegister(const char *cmd) {
|
||||
|
||||
// get hash
|
||||
int hashp = 1 + 65 + 1 + keyHandleLen + derLen;
|
||||
PrintAndLogEx(SUCCESS, "Hash[%d]: %s", len - hashp, sprint_hex(&buf[hashp], len - hashp));
|
||||
PrintAndLogEx(SUCCESS, "Hash[%zu]: %s", len - hashp, sprint_hex(&buf[hashp], len - hashp));
|
||||
|
||||
// check ANSI X9.62 format ECDSA signature (on P-256)
|
||||
uint8_t rval[300] = {0};
|
||||
@@ -543,7 +543,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) {
|
||||
PrintAndLogEx(SUCCESS, "User presence: %s", (buf[0] ? "verified" : "not verified"));
|
||||
uint32_t cntr = (uint32_t)bytes_to_num(&buf[1], 4);
|
||||
PrintAndLogEx(SUCCESS, "Counter: %d", cntr);
|
||||
PrintAndLogEx(SUCCESS, "Hash[%d]: %s", len - 5, sprint_hex(&buf[5], len - 5));
|
||||
PrintAndLogEx(SUCCESS, "Hash[%zu]: %s", len - 5, sprint_hex(&buf[5], len - 5));
|
||||
|
||||
// check ANSI X9.62 format ECDSA signature (on P-256)
|
||||
uint8_t rval[300] = {0};
|
||||
@@ -736,7 +736,7 @@ static int CmdHFFido2MakeCredential(const char *cmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "MakeCredential result (%d b) OK.", len);
|
||||
PrintAndLogEx(SUCCESS, "MakeCredential result (%zu b) OK.", len);
|
||||
if (showCBOR) {
|
||||
PrintAndLogEx(SUCCESS, "CBOR make credential response:");
|
||||
PrintAndLogEx(NORMAL, "---------------- CBOR ------------------");
|
||||
@@ -862,7 +862,7 @@ static int CmdHFFido2GetAssertion(const char *cmd) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "GetAssertion result (%d b) OK.", len);
|
||||
PrintAndLogEx(SUCCESS, "GetAssertion result (%zu b) OK.", len);
|
||||
if (showCBOR) {
|
||||
PrintAndLogEx(SUCCESS, "CBOR get assertion response:");
|
||||
PrintAndLogEx(NORMAL, "---------------- CBOR ------------------");
|
||||
|
||||
@@ -1332,7 +1332,7 @@ static int CmdHFiClassReader_Dump(const char *Cmd) {
|
||||
}
|
||||
|
||||
// save the dump to .bin file
|
||||
PrintAndLogEx(SUCCESS, "saving dump file - %d blocks read", gotBytes / 8);
|
||||
PrintAndLogEx(SUCCESS, "saving dump file - %zu blocks read", gotBytes / 8);
|
||||
saveFile(filename, ".bin", tag_data, gotBytes);
|
||||
saveFileEML(filename, tag_data, gotBytes, 8);
|
||||
saveFileJSON(filename, jsfIclass, tag_data, gotBytes);
|
||||
@@ -2081,7 +2081,7 @@ static int loadKeys(char *filename) {
|
||||
size_t bytes_read = fread(dump, 1, fsize, f);
|
||||
fclose(f);
|
||||
if (bytes_read > ICLASS_KEYS_MAX * 8) {
|
||||
PrintAndLogEx(WARNING, "File is too long to load - bytes: %u", bytes_read);
|
||||
PrintAndLogEx(WARNING, "File is too long to load - bytes: %zu", bytes_read);
|
||||
free(dump);
|
||||
return 0;
|
||||
}
|
||||
@@ -2502,7 +2502,7 @@ static int CmdHFiClassLookUp(const char *Cmd) {
|
||||
case 'p':
|
||||
param_gethex_ex(Cmd, cmdp + 1, EPURSE, &len);
|
||||
if (len >> 1 != sizeof(EPURSE)) {
|
||||
PrintAndLogEx(WARNING, "Wrong EPURSE length, expected %d got [%d] ", sizeof(EPURSE), len >> 1);
|
||||
PrintAndLogEx(WARNING, "Wrong EPURSE length, expected %zu got [%d] ", sizeof(EPURSE), len >> 1);
|
||||
errors = true;
|
||||
}
|
||||
cmdp += 2;
|
||||
@@ -2652,7 +2652,7 @@ void PrintPreCalc(iclass_prekey_t *list, int itemcnt) {
|
||||
for (int i = 0; i < itemcnt; i++) {
|
||||
|
||||
if (i < 10) {
|
||||
PrintAndLogEx(NORMAL, "[%2d] | %016" PRIx64 " | %08" PRIx32, i, bytes_to_num(list[i].key, 8), bytes_to_num(list[i].mac, 4));
|
||||
PrintAndLogEx(NORMAL, "[%2d] | %016" PRIx64 " | %08" PRIx64, i, bytes_to_num(list[i].key, 8), bytes_to_num(list[i].mac, 4));
|
||||
} else if (i == 10) {
|
||||
PrintAndLogEx(SUCCESS, "... skip printing the rest");
|
||||
}
|
||||
|
||||
+4
-4
@@ -1036,7 +1036,7 @@ static int CmdLegicRestore(const char *Cmd) {
|
||||
fseek(f, 0, SEEK_SET); // seek back to beginning of file
|
||||
|
||||
if (filesize != numofbytes) {
|
||||
PrintAndLogEx(WARNING, "Fail, filesize and cardsize is not equal. [%u != %u]", filesize, numofbytes);
|
||||
PrintAndLogEx(WARNING, "Fail, filesize and cardsize is not equal. [%zu != %u]", filesize, numofbytes);
|
||||
free(data);
|
||||
fclose(f);
|
||||
return PM3_EFILE;
|
||||
@@ -1084,11 +1084,11 @@ static int CmdLegicRestore(const char *Cmd) {
|
||||
|
||||
uint8_t isOK = resp.oldarg[0] & 0xFF;
|
||||
if (!isOK) {
|
||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.oldarg[1] & 0xFF);
|
||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", (uint8_t)(resp.oldarg[1] & 0xFF));
|
||||
free(data);
|
||||
return PM3_ERFTRANS;
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, "Wrote chunk [offset %d | len %d | total %d", i, len, i + len);
|
||||
PrintAndLogEx(SUCCESS, "Wrote chunk [offset %zu | len %zu | total %zu", i, len, i + len);
|
||||
}
|
||||
|
||||
free(data);
|
||||
@@ -1281,7 +1281,7 @@ static int CmdLegicWipe(const char *Cmd) {
|
||||
|
||||
uint8_t isOK = resp.oldarg[0] & 0xFF;
|
||||
if (!isOK) {
|
||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", resp.oldarg[1] & 0xFF);
|
||||
PrintAndLogEx(WARNING, "Failed writing tag [msg = %u]", (uint8_t)(resp.oldarg[1] & 0xFF));
|
||||
free(data);
|
||||
return PM3_ERFTRANS;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1296,7 +1296,7 @@ static int CmdHF14AMfNested(const char *Cmd) {
|
||||
}
|
||||
|
||||
uint64_t t2 = msclock() - t1;
|
||||
PrintAndLogEx(SUCCESS, "Time to check %d known keys: %.0f seconds\n", ARRAYLEN(g_mifare_default_keys), (float)t2 / 1000.0);
|
||||
PrintAndLogEx(SUCCESS, "Time to check %zu known keys: %.0f seconds\n", ARRAYLEN(g_mifare_default_keys), (float)t2 / 1000.0);
|
||||
PrintAndLogEx(SUCCESS, "enter nested attack");
|
||||
|
||||
// nested sectors
|
||||
|
||||
+1
-1
@@ -2496,7 +2496,7 @@ static int CmdHF14AMfUCSetPwd(const char *Cmd) {
|
||||
if ((resp.oldarg[0] & 0xff) == 1) {
|
||||
PrintAndLogEx(INFO, "Ultralight-C new password: %s", sprint_hex(pwd, 16));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Failed writing at block %d", resp.oldarg[1] & 0xff);
|
||||
PrintAndLogEx(WARNING, "Failed writing at block %u", (uint8_t)(resp.oldarg[1] & 0xff));
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -65,7 +65,7 @@ static int print_barcode(uint8_t *barcode, const size_t barcode_len, bool verbos
|
||||
} else {
|
||||
PrintAndLogEx(SUCCESS, " Checksum : "_YELLOW_("too few data for checksum")"- " _RED_("fail"));
|
||||
}
|
||||
PrintAndLogEx(SUCCESS, " Data len (bits) : "_YELLOW_("%i")"- %s", barcode_len * 8, (barcode_len == 16 || barcode_len == 32) ? _GREEN_("OK") : _YELLOW_("warning"));
|
||||
PrintAndLogEx(SUCCESS, " Data len (bits) : "_YELLOW_("%zu")"- %s", barcode_len * 8, (barcode_len == 16 || barcode_len == 32) ? _GREEN_("OK") : _YELLOW_("warning"));
|
||||
PrintAndLogEx(SUCCESS, " Raw data : "_YELLOW_("%s"), sprint_hex(barcode, barcode_len));
|
||||
if (barcode_len < 4) // too few to go to next decoding stages
|
||||
return PM3_ESOFT;
|
||||
|
||||
+2
-1
@@ -13,6 +13,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#include "cmdparser.h" // command_t
|
||||
#include "comms.h"
|
||||
@@ -71,7 +72,7 @@ static int topaz_send_cmd_raw(uint8_t *cmd, uint8_t len, uint8_t *response, uint
|
||||
memcpy(response, resp.data.asBytes, *response_len);
|
||||
}
|
||||
} else {
|
||||
if (verbose) PrintAndLogEx(WARNING, "Wrong response length (%d != %d)", *response_len, resp.oldarg[0]);
|
||||
if (verbose) PrintAndLogEx(WARNING, "Wrong response length (%d != %" PRIu64 ")", *response_len, resp.oldarg[0]);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
return PM3_SUCCESS;
|
||||
|
||||
+4
-4
@@ -651,7 +651,7 @@ int CmdLFSim(const char *Cmd) {
|
||||
// convert to bitstream if necessary
|
||||
ChkBitstream();
|
||||
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Uploading %d bytes", GraphTraceLen);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Uploading %zu bytes", GraphTraceLen);
|
||||
|
||||
struct pupload {
|
||||
uint8_t flag;
|
||||
@@ -787,7 +787,7 @@ int CmdLFfskSim(const char *Cmd) {
|
||||
|
||||
size_t size = DemodBufferLen;
|
||||
if (size > (PM3_CMD_DATA_SIZE - sizeof(lf_fsksim_t))) {
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %d - max: %d", size, PM3_CMD_DATA_SIZE - sizeof(lf_fsksim_t));
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %zu - max: %zu", size, PM3_CMD_DATA_SIZE - sizeof(lf_fsksim_t));
|
||||
size = PM3_CMD_DATA_SIZE - sizeof(lf_fsksim_t);
|
||||
}
|
||||
|
||||
@@ -889,7 +889,7 @@ int CmdLFaskSim(const char *Cmd) {
|
||||
|
||||
size_t size = DemodBufferLen;
|
||||
if (size > (PM3_CMD_DATA_SIZE - sizeof(lf_asksim_t))) {
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %d - max: %d", size, PM3_CMD_DATA_SIZE - sizeof(lf_asksim_t));
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %zu - max: %zu", size, PM3_CMD_DATA_SIZE - sizeof(lf_asksim_t));
|
||||
size = PM3_CMD_DATA_SIZE - sizeof(lf_asksim_t);
|
||||
}
|
||||
|
||||
@@ -1009,7 +1009,7 @@ int CmdLFpskSim(const char *Cmd) {
|
||||
}
|
||||
size_t size = DemodBufferLen;
|
||||
if (size > (PM3_CMD_DATA_SIZE - sizeof(lf_psksim_t))) {
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %d - max: %d", size, PM3_CMD_DATA_SIZE - sizeof(lf_psksim_t));
|
||||
PrintAndLogEx(NORMAL, "DemodBuffer too long for current implementation - length: %zu - max: %zu", size, PM3_CMD_DATA_SIZE - sizeof(lf_psksim_t));
|
||||
size = PM3_CMD_DATA_SIZE - sizeof(lf_psksim_t);
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -324,7 +324,7 @@ static int CmdAWIDDemod(const char *Cmd) {
|
||||
}
|
||||
free(bits);
|
||||
|
||||
PrintAndLogEx(DEBUG, "DEBUG: AWID idx: %d, Len: %d Printing Demod Buffer:", idx, size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: AWID idx: %d, Len: %zu Printing Demod Buffer:", idx, size);
|
||||
if (g_debugMode)
|
||||
printDemodBuff();
|
||||
|
||||
|
||||
+2
-2
@@ -416,7 +416,7 @@ int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo) {
|
||||
setDemodBuff(DemodBuffer, (size == 40) ? 64 : 128, idx + 1);
|
||||
setClockGrid(g_DemodClock, g_DemodStartIdx + ((idx + 1)*g_DemodClock));
|
||||
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Em410x idx: %d, Len: %d, Printing Demod Buffer:", idx, size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Em410x idx: %zu, Len: %zu, Printing Demod Buffer:", idx, size);
|
||||
if (g_debugMode)
|
||||
printDemodBuff();
|
||||
|
||||
@@ -1085,7 +1085,7 @@ static bool doPreambleSearch(size_t *startIdx) {
|
||||
uint8_t preamble[EM_PREAMBLE_LEN] = {0, 0, 1, 0, 1, 0};
|
||||
|
||||
if (!preambleSearchEx(DemodBuffer, preamble, EM_PREAMBLE_LEN, &size, startIdx, true)) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - EM4305 preamble not found :: %d", *startIdx);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - EM4305 preamble not found :: %zu", *startIdx);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user