diff --git a/client/deps/cliparser/cliparser.c b/client/deps/cliparser/cliparser.c index acefe7105..64de03871 100644 --- a/client/deps/cliparser/cliparser.c +++ b/client/deps/cliparser/cliparser.c @@ -239,11 +239,11 @@ int CLIParserParseStringEx(CLIParserContext *ctx, const char *str, void *vargtab } else { // if (isSpace(str[i]) == false) { - *bufptr++ = str[i]; + *bufptr++ = str[i]; // } } break; - } + } } if (bufptr > bufptrend) { diff --git a/client/src/cmdhf14a.c b/client/src/cmdhf14a.c index eab7dfce8..7bd292489 100644 --- a/client/src/cmdhf14a.c +++ b/client/src/cmdhf14a.c @@ -1228,57 +1228,57 @@ static int CmdExchangeAPDU(bool chainingin, const uint8_t *datain, int datainlen return PM3_EAPDU_FAIL; } - const uint8_t *recv = resp.data.asBytes; - int iLen = resp.oldarg[0]; - uint8_t res = resp.oldarg[1]; + const uint8_t *recv = resp.data.asBytes; + int iLen = resp.oldarg[0]; + uint8_t res = resp.oldarg[1]; - int dlen = iLen - 2; + int dlen = iLen - 2; if (dlen < 0) { - dlen = 0; + dlen = 0; } - *dataoutlen += dlen; + *dataoutlen += dlen; - if (maxdataoutlen && *dataoutlen > maxdataoutlen) { - PrintAndLogEx(DEBUG, "ERR: APDU: Buffer too small(%d), needs %d bytes", *dataoutlen, maxdataoutlen); - return PM3_EAPDU_FAIL; - } + if (maxdataoutlen && *dataoutlen > maxdataoutlen) { + PrintAndLogEx(DEBUG, "ERR: APDU: Buffer too small(%d), needs %d bytes", *dataoutlen, maxdataoutlen); + return PM3_EAPDU_FAIL; + } - // I-block ACK - if ((res & 0xF2) == 0xA2) { - *dataoutlen = 0; - *chainingout = true; - return PM3_SUCCESS; - } + // I-block ACK + if ((res & 0xF2) == 0xA2) { + *dataoutlen = 0; + *chainingout = true; + return PM3_SUCCESS; + } if (iLen == 0) { - PrintAndLogEx(DEBUG, "ERR: APDU: No APDU response"); - return PM3_EAPDU_FAIL; - } + PrintAndLogEx(DEBUG, "ERR: APDU: No APDU response"); + return PM3_EAPDU_FAIL; + } - // check apdu length - if (iLen < 2 && iLen >= 0) { - PrintAndLogEx(DEBUG, "ERR: APDU: Small APDU response, len %d", iLen); - return PM3_EAPDU_FAIL; - } + // check apdu length + if (iLen < 2 && iLen >= 0) { + PrintAndLogEx(DEBUG, "ERR: APDU: Small APDU response, len %d", iLen); + return PM3_EAPDU_FAIL; + } - // check block TODO - if (iLen == -2) { - PrintAndLogEx(DEBUG, "ERR: APDU: Block type mismatch"); - return PM3_EAPDU_FAIL; - } + // check block TODO + if (iLen == -2) { + PrintAndLogEx(DEBUG, "ERR: APDU: Block type mismatch"); + return PM3_EAPDU_FAIL; + } - memcpy(dataout, recv, dlen); + memcpy(dataout, recv, dlen); - // chaining - if ((res & 0x10) != 0) { - *chainingout = true; - } + // chaining + if ((res & 0x10) != 0) { + *chainingout = true; + } - // CRC Check - if (iLen == -1) { - PrintAndLogEx(DEBUG, "ERR: APDU: ISO 14443A CRC error"); - return PM3_EAPDU_FAIL; - } + // CRC Check + if (iLen == -1) { + PrintAndLogEx(DEBUG, "ERR: APDU: ISO 14443A CRC error"); + return PM3_EAPDU_FAIL; + } return PM3_SUCCESS; } diff --git a/client/src/cmdhflist.c b/client/src/cmdhflist.c index 5b0bb7636..4e04819bf 100644 --- a/client/src/cmdhflist.c +++ b/client/src/cmdhflist.c @@ -464,7 +464,7 @@ int applyIso14443a(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool i } else { return PM3_ESOFT; } - } + } } } else { @@ -1798,7 +1798,7 @@ void annotateSeos(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize, bool is default: { pos = 2; break; - } + } } if (memcmp(cmd + pos, "\x00\xA4\x04\x00", 4) == 0) { diff --git a/client/src/util.c b/client/src/util.c index 5db38bf86..f01067534 100644 --- a/client/src/util.c +++ b/client/src/util.c @@ -1305,7 +1305,7 @@ int detect_num_CPUs(void) { void str_lower(char *s) { for (size_t i = 0; i < strlen(s); i++) { s[i] = tolower(s[i]); -} + } } void str_upper(char *s) { @@ -1315,7 +1315,7 @@ void str_upper(char *s) { void strn_upper(char *s, size_t n) { for (size_t i = 0; i < n; i++) { s[i] = toupper(s[i]); -} + } } // check for prefix in string bool str_startswith(const char *s, const char *pre) { @@ -1352,9 +1352,9 @@ void str_creplace(char *buf, size_t len, char from, char to) { for (size_t i = 0; i < len; i++) { if (buf[i] == from) { buf[i] = to; + } } } -} char *str_dup(const char *src) { return str_ndup(src, strlen(src)); diff --git a/doc/commands.json b/doc/commands.json index 8e00c0031..04d547610 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -13232,6 +13232,6 @@ "metadata": { "commands_extracted": 760, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-03-12T08:23:41" + "extracted_on": "2025-03-12T15:46:33" } }