From 0ff41fa652438a4911503a3c5518c614705d7fbc Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 12 Oct 2023 14:53:26 +0200 Subject: [PATCH] style --- armsrc/Standalone/hf_msdsal.c | 32 ++++++++++++++++---------------- armsrc/Standalone/hf_reblay.c | 6 +++--- armsrc/iso14443a.c | 8 ++++---- client/src/cmdhficlass.c | 2 +- client/src/emv/cmdemv.c | 6 +++--- client/src/iso7816/iso7816core.c | 20 ++++++++++---------- client/src/pm3line_vocabulary.h | 2 +- doc/commands.json | 2 +- doc/commands.md | 2 +- include/protocols.h | 2 +- 10 files changed, 41 insertions(+), 41 deletions(-) diff --git a/armsrc/Standalone/hf_msdsal.c b/armsrc/Standalone/hf_msdsal.c index b382a9fc3..b58c36856 100644 --- a/armsrc/Standalone/hf_msdsal.c +++ b/armsrc/Standalone/hf_msdsal.c @@ -304,15 +304,15 @@ void RunMod(void) { LED_C_OFF(); LED_B_ON(); - // add loop visa - // for (int i = 0; i < ARRAYLEN(AIDlist); i ++) { + // add loop visa + // for (int i = 0; i < ARRAYLEN(AIDlist); i ++) { // hexstr_to_byte_array("a0da02631a440a44000000a012ad10a00e800200048108", sam_apdu, &sam_len); uint8_t apdulen = iso14_apdu(apdus[i], (uint16_t) apduslen[i], false, apdubuffer, NULL); if (apdulen > 0) { DbpString("[ " _YELLOW_("Proxmark command") " ]"); Dbhexdump(apduslen[i], apdus[i], false); - DbpString("[ " _GREEN_( "Card answer") " ]"); + DbpString("[ " _GREEN_("Card answer") " ]"); Dbhexdump(apdulen - 2, apdubuffer, false); DbpString("-------------------------------"); @@ -447,7 +447,7 @@ void RunMod(void) { p_response = &responses[RESP_INDEX_RATS]; } else { - if (g_dbglevel == DBG_DEBUG ) { + if (g_dbglevel == DBG_DEBUG) { DbpString("[ "_YELLOW_("Card reader command") " ]"); Dbhexdump(len, receivedCmd, false); } @@ -459,14 +459,14 @@ void RunMod(void) { // depending on card reader commands, the Proxmark will answer to fool the reader // respond with PPSE if (receivedCmd[2] == 0xA4 && receivedCmd[6] == 0x32 && prevCmd == 0) { - // need to adapt lengths.. + // need to adapt lengths.. uint8_t ppsea[39] = { - // 0x23 = 35, skip two first bytes then the message - SW 2 is 35 = 0x23 + // 0x23 = 35, skip two first bytes then the message - SW 2 is 35 = 0x23 0x6F, 0x23, 0x84, 0x0E, 0x32, 0x50, 0x41, 0x59, 0x2E, 0x53, 0x59, 0x53, 0x2E, 0x44, 0x44, 0x46, 0x30, 0x31, 0xA5, 0x11, 0xBF, 0x0C, 0x0E, 0x61, - 0x0C, 0x4F, - // len aid0 aid1 aid2... + 0x0C, 0x4F, + // len aid0 aid1 aid2... 0x07, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10, 0x87, 0x01, 0x01, 0x90, 0x00 }; @@ -477,13 +477,13 @@ void RunMod(void) { // respond Visa AID } else if (receivedCmd[2] == 0xA4 && receivedCmd[10] == 0x03 && receivedCmd[11] == 0x10 && prevCmd == 1) { uint8_t visauid_long[34] = { - // 0x1E = 30, skip two first bytes then the message - SW 2 is 30 = 0x1E - 0x6F, 0x1E, 0x84, - // len aid0 aid1 aid2.... - 0x07, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10, - 0xA5, 0x13, 0x50, - // len V I S A C R E D I T - 0x0B, 0x56, 0x49, 0x53, 0x41, 0x20, 0x43, 0x52, 0x45, 0x44, 0x49, 0x54, + // 0x1E = 30, skip two first bytes then the message - SW 2 is 30 = 0x1E + 0x6F, 0x1E, 0x84, + // len aid0 aid1 aid2.... + 0x07, 0xA0, 0x00, 0x00, 0x00, 0x03, 0x10, 0x10, + 0xA5, 0x13, 0x50, + // len V I S A C R E D I T + 0x0B, 0x56, 0x49, 0x53, 0x41, 0x20, 0x43, 0x52, 0x45, 0x44, 0x49, 0x54, 0x9F, 0x38, 0x03, 0x9F, 0x66, 0x02, 0x90, 0x00 }; @@ -503,7 +503,7 @@ void RunMod(void) { uint8_t card[25] = { 0x70, 0x15, 0x57, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x90, 0x00 }; // add token array == Track 2 found before diff --git a/armsrc/Standalone/hf_reblay.c b/armsrc/Standalone/hf_reblay.c index 497d215a3..62fea749e 100644 --- a/armsrc/Standalone/hf_reblay.c +++ b/armsrc/Standalone/hf_reblay.c @@ -73,7 +73,7 @@ void ModInfo(void) { void RunMod() { StandAloneMode(); - DbpString(""); + DbpString(""); Dbprintf(_YELLOW_(">>> ") " Relaying ISO/14443A data over Bluetooth a.k.a. reblay Started " _YELLOW_("<<<")); DbpString(""); FpgaDownloadAndGo(FPGA_BITSTREAM_HF); @@ -286,7 +286,7 @@ void RunMod() { int retval = PM3_SUCCESS; // Bluetooth response - uint8_t resp = 0; + uint8_t resp = 0; lenpacket = 0; // Keep track of last terminal type command @@ -357,7 +357,7 @@ void RunMod() { DbpString(_YELLOW_("!!") " Avoiding request - Bluetooth data already in memory!!"); } } else { - if (g_dbglevel == DBG_DEBUG ) { + if (g_dbglevel == DBG_DEBUG) { DbpString("[ "_YELLOW_("Card reader command") " ]"); Dbhexdump(len - 2, &receivedCmd[1], false); } diff --git a/armsrc/iso14443a.c b/armsrc/iso14443a.c index d1b63264e..9de1e9a31 100644 --- a/armsrc/iso14443a.c +++ b/armsrc/iso14443a.c @@ -1021,7 +1021,7 @@ bool prepare_allocated_tag_modulation(tag_response_info_t *response_info, uint8_ } } -bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_response_info_t **responses, +bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_response_info_t **responses, uint32_t *cuid, uint32_t counters[3], uint8_t tearings[3], uint8_t *pages) { uint8_t sak = 0; // The first response contains the ATQA (note: bytes are transmitted in reverse order). @@ -1042,7 +1042,7 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_r // Format byte = 0x58: FSCI=0x08 (FSC=256), TA(1) and TC(1) present, // TA(1) = 0x80: different divisors not supported, DR = 1, DS = 1 // TB(1) = not present. Defaults: FWI = 4 (FWT = 256 * 16 * 2^4 * 1/fc = 4833us), SFGI = 0 (SFG = 256 * 16 * 2^0 * 1/fc = 302us) - // TC(1) = 0x02: CID supported, NAD not supported + // TC(1) = 0x02: CID supported, NAD not supported // static uint8_t rRATS[] = { 0x04, 0x58, 0x80, 0x02, 0x00, 0x00 }; static uint8_t rRATS[40] = { 0x05, 0x75, 0x80, 0x60, 0x02, 0x00, 0x00, 0x00 }; uint8_t rRATS_len = 8; @@ -1314,10 +1314,10 @@ bool SimulateIso14443aInit(uint8_t tagType, uint16_t flags, uint8_t *data, tag_r // since rats len is variable now. responses_init[RESP_INDEX_RATS].response_n = rRATS_len; - // "precompiled" responses. + // "precompiled" responses. // These exist for speed reasons. There are no time in the anti collision phase to calculate responses. // There are 12 predefined responses with a total of 84 bytes data to transmit. - // + // // Coded responses need one byte per bit to transfer (data, parity, start, stop, correction) // 85 * 8 data bits, 85 * 1 parity bits, 12 start bits, 12 stop bits, 12 correction bits // 85 * 8 + 85 + 12 + 12 + 12 == 801 diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index 635b1bfaa..96ecefdd1 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -2772,7 +2772,7 @@ static void detect_credential(uint8_t *iclass_dump, size_t dump_len, bool *is_le picopass_hdr_t *hdr = (picopass_hdr_t *)iclass_dump; if (!memcmp(hdr->app_issuer_area, "\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF", PICOPASS_BLOCK_SIZE)) { - // Legacy AIA + // Legacy AIA *is_legacy = true; if (dump_len < 11 * PICOPASS_BLOCK_SIZE) { diff --git a/client/src/emv/cmdemv.c b/client/src/emv/cmdemv.c index d149a381a..47cd6de55 100644 --- a/client/src/emv/cmdemv.c +++ b/client/src/emv/cmdemv.c @@ -53,7 +53,7 @@ static void ParamLoadDefaults(struct tlvdb *tlvRoot) { TLV_ADD(0x5F2A, "\x090\x78"); // 9A:(Transaction Date) len:3 TLV_ADD(0x9A, "\x00\x00\x00"); - // 9C:(Transaction Type) len:1 + // 9C:(Transaction Type) len:1 // | 00 => Goods and Service // | 01 => Cash TLV_ADD(0x9C, "\x00"); @@ -544,7 +544,7 @@ static int emv_parse_card_details(uint8_t *response, size_t reslen, bool verbose // Track 3 Data // to be impl. - + // Unpredicable Number (UN) struct tlvdb *un1_full = tlvdb_find_full(root, 0x9f37); if (un1_full != NULL) { @@ -2018,7 +2018,7 @@ static int CmdEMVScan(const char *Cmd) { bool paramLoadJSON = arg_get_lit(ctx, 4); enum TransactionType TrType = TT_MSD; - if (arg_get_lit(ctx, 6)){ + if (arg_get_lit(ctx, 6)) { TrType = TT_QVSDCMCHIP; } if (arg_get_lit(ctx, 7)) { diff --git a/client/src/iso7816/iso7816core.c b/client/src/iso7816/iso7816core.c index c03a11956..025d55d16 100644 --- a/client/src/iso7816/iso7816core.c +++ b/client/src/iso7816/iso7816core.c @@ -205,14 +205,14 @@ int Iso7816Select(Iso7816CommandChannel channel, bool activate_field, bool leave uint8_t *result, size_t max_result_len, size_t *result_len, uint16_t *sw) { return Iso7816ExchangeEx(channel - , activate_field - , leave_field_on - , (sAPDU_t) {0x00, 0xa4, 0x04, 0x00, aid_len, aid} - , (channel == CC_CONTACTLESS) - , 0 - , result - , max_result_len - , result_len - , sw - ); + , activate_field + , leave_field_on + , (sAPDU_t) {0x00, 0xa4, 0x04, 0x00, aid_len, aid} + , (channel == CC_CONTACTLESS) + , 0 + , result + , max_result_len + , result_len + , sw + ); } diff --git a/client/src/pm3line_vocabulary.h b/client/src/pm3line_vocabulary.h index 5cbe8b495..e4a05dd2c 100644 --- a/client/src/pm3line_vocabulary.h +++ b/client/src/pm3line_vocabulary.h @@ -285,7 +285,7 @@ const static vocabulary_t vocabulary[] = { { 0, "hf iclass esave" }, { 0, "hf iclass esetblk" }, { 0, "hf iclass eview" }, - { 1, "hf iclass configcard" }, + { 0, "hf iclass configcard" }, { 1, "hf iclass calcnewkey" }, { 1, "hf iclass encode" }, { 1, "hf iclass encrypt" }, diff --git a/doc/commands.json b/doc/commands.json index 08d0007e2..02fec71df 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -11857,6 +11857,6 @@ "metadata": { "commands_extracted": 687, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2023-10-03T15:10:12" + "extracted_on": "2023-10-12T12:53:10" } } \ No newline at end of file diff --git a/doc/commands.md b/doc/commands.md index 0c94700e6..cf385dc1a 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -424,7 +424,7 @@ Check column "offline" for their availability. |`hf iclass esave `|N |`Save emulator memory to file` |`hf iclass esetblk `|N |`Set emulator memory block data` |`hf iclass eview `|N |`View emulator memory` -|`hf iclass configcard `|Y |`Reader configuration card` +|`hf iclass configcard `|N |`Reader configuration card` |`hf iclass calcnewkey `|Y |`Calc diversified keys (blocks 3 & 4) to write new keys` |`hf iclass encode `|Y |`Encode binary wiegand to block 7` |`hf iclass encrypt `|Y |`Encrypt given block data` diff --git a/include/protocols.h b/include/protocols.h index db088fd22..1c8dac3de 100644 --- a/include/protocols.h +++ b/include/protocols.h @@ -444,7 +444,7 @@ ISO 7816-4 Basic interindustry commands. For command APDU's. // Picopass Pagemode fuses #define PICOPASS_SECURE_PAGEMODE_AUTH_DISABLED 0x00 #define PICOPASS_NON_SECURE_PAGEMODE 0x01 -#define PICOPASS_SECURE_PAGEMODE_KEYS_LOCKED 0x02 +#define PICOPASS_SECURE_PAGEMODE_KEYS_LOCKED 0x02 #define PICOPASS_SECURE_PAGEMODE_KEYS_MODIFIABLE 0x03 // ISO 7816-4 Basic interindustry commands. For command APDU's.