From 44fe3ec38f4d763f867ad27c2f6022deebe895b4 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Wed, 27 Sep 2023 22:09:01 +0200 Subject: [PATCH] smart raw --timeout parameter --- client/src/cmdsmartcard.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/client/src/cmdsmartcard.c b/client/src/cmdsmartcard.c index 55a3b62e4..cf6cbe67d 100644 --- a/client/src/cmdsmartcard.c +++ b/client/src/cmdsmartcard.c @@ -355,6 +355,7 @@ static int smart_responseEx(uint8_t *out, int maxoutlen, bool verbose) { smart_card_raw_t *payload = calloc(1, sizeof(smart_card_raw_t) + sizeof(cmd_getresp)); payload->flags = SC_RAW | SC_LOG; payload->len = sizeof(cmd_getresp); + payload->wait_delay = 0; memcpy(payload->data, cmd_getresp, sizeof(cmd_getresp)); clearCommandBuffer(); @@ -504,9 +505,9 @@ static int CmdSmartRaw(const char *Cmd) { data[4] = 0; } - if (decode_tlv && len > 4) + if (decode_tlv && len > 4) { TLVPrintFromBuffer(buf, len - 2); - else { + } else { if (len > 2) { PrintAndLogEx(INFO, "Response data:"); PrintAndLogEx(INFO, " # | bytes | ascii"); @@ -907,6 +908,7 @@ static void smart_brute_prim(void) { smart_card_raw_t *payload = calloc(1, sizeof(smart_card_raw_t) + 5); payload->flags = SC_RAW_T0; payload->len = 5; + payload->wait_delay = 0; memcpy(payload->data, get_card_data + i, 5); clearCommandBuffer(); @@ -950,6 +952,7 @@ static int smart_brute_sfi(bool decodeTLV) { smart_card_raw_t *payload = calloc(1, sizeof(smart_card_raw_t) + sizeof(READ_RECORD)); payload->flags = SC_RAW_T0; payload->len = sizeof(READ_RECORD); + payload->wait_delay = 0; memcpy(payload->data, READ_RECORD, sizeof(READ_RECORD)); clearCommandBuffer(); @@ -1103,7 +1106,7 @@ static int CmdSmartBruteforceSFI(const char *Cmd) { smart_card_raw_t *payload = calloc(1, sizeof(smart_card_raw_t) + hexlen); payload->flags = SC_RAW_T0; payload->len = hexlen; - + payload->wait_delay = 0; memcpy(payload->data, cmddata, hexlen); clearCommandBuffer(); SendCommandNG(CMD_SMART_RAW, (uint8_t *)payload, sizeof(smart_card_raw_t) + hexlen); @@ -1187,6 +1190,7 @@ int ExchangeAPDUSC(bool verbose, uint8_t *datain, int datainlen, bool activateCa payload->flags |= (SC_SELECT | SC_CONNECT); } payload->len = datainlen; + payload->wait_delay = 0; memcpy(payload->data, datain, datainlen); clearCommandBuffer();