diff --git a/armsrc/Standalone/lf_nedap_sim.c b/armsrc/Standalone/lf_nedap_sim.c index 491199c27..dcd093fee 100644 --- a/armsrc/Standalone/lf_nedap_sim.c +++ b/armsrc/Standalone/lf_nedap_sim.c @@ -30,11 +30,11 @@ #define MODULE_LONG_NAME "LF Nedap simple simulator" typedef struct _NEDAP_TAG { - uint8_t subType; - uint16_t customerCode; - uint32_t id; - - uint8_t bIsLong; + uint8_t subType; + uint16_t customerCode; + uint32_t id; + + uint8_t bIsLong; } NEDAP_TAG, *PNEDAP_TAG; const NEDAP_TAG Tag = {.subType = 0x5, .customerCode = 0x123, .id = 42424, .bIsLong = 1}; @@ -46,78 +46,67 @@ static uint8_t isEven_64_63(const uint8_t *data); static inline uint32_t bitcount32(uint32_t a); static void bytes_to_bytebits(const void *src, const size_t srclen, void *dest); -void ModInfo(void) -{ +void ModInfo(void) { DbpString(" " MODULE_LONG_NAME); } -void RunMod(void) -{ - int n; +void RunMod(void) { + int n; - StandAloneMode(); + StandAloneMode(); Dbprintf("[=] " MODULE_LONG_NAME " -- started"); - FpgaDownloadAndGo(FPGA_BITSTREAM_LF); - Dbprintf("[=] NEDAP (%s) - ID: " _GREEN_("%05u") " subtype: " _GREEN_("%1u") " customer code: " _GREEN_("%u / 0x%03X"), Tag.bIsLong ? "128b" : "64b", Tag.id, Tag.subType, Tag.customerCode, Tag.customerCode); - - n = NedapPrepareBigBuffer(&Tag); - do - { + FpgaDownloadAndGo(FPGA_BITSTREAM_LF); + Dbprintf("[=] NEDAP (%s) - ID: " _GREEN_("%05u") " subtype: " _GREEN_("%1u") " customer code: " _GREEN_("%u / 0x%03X"), Tag.bIsLong ? "128b" : "64b", Tag.id, Tag.subType, Tag.customerCode, Tag.customerCode); + + n = NedapPrepareBigBuffer(&Tag); + do { WDT_HIT(); if (data_available()) - break; + break; + + SimulateTagLowFrequency(n, 0, true); - SimulateTagLowFrequency(n, 0, true); - } while (BUTTON_HELD(1000) == BUTTON_NO_CLICK); Dbprintf("[=] " MODULE_LONG_NAME " -- exiting"); - + LEDsoff(); } -static int NedapPrepareBigBuffer(const NEDAP_TAG *pTag) -{ - int ret = 0; - uint8_t data[16], bitStream[sizeof(data) * 8], phase = 0; - uint16_t i, size = pTag->bIsLong ? sizeof(data) : (sizeof(data) / 2); - - NedapGen(pTag->subType, pTag->customerCode, pTag->id, pTag->bIsLong, data); - bytes_to_bytebits(data, size, bitStream); - size <<= 3; - - for (i = 0; i < size; i++) - { - biphaseSimBitInverted(!bitStream[i], &ret, &phase); - } - if (phase == 1) //run a second set inverted to keep phase in check - { - for (i = 0; i < size; i++) - { - biphaseSimBitInverted(!bitStream[i], &ret, &phase); - } - } - - return ret; +static int NedapPrepareBigBuffer(const NEDAP_TAG *pTag) { + int ret = 0; + uint8_t data[16], bitStream[sizeof(data) * 8], phase = 0; + uint16_t i, size = pTag->bIsLong ? sizeof(data) : (sizeof(data) / 2); + + NedapGen(pTag->subType, pTag->customerCode, pTag->id, pTag->bIsLong, data); + bytes_to_bytebits(data, size, bitStream); + size <<= 3; + + for (i = 0; i < size; i++) { + biphaseSimBitInverted(!bitStream[i], &ret, &phase); + } + if (phase == 1) { //run a second set inverted to keep phase in check + for (i = 0; i < size; i++) { + biphaseSimBitInverted(!bitStream[i], &ret, &phase); + } + } + + return ret; } -static void biphaseSimBitInverted(uint8_t c, int *n, uint8_t *phase) -{ - uint8_t *dest = BigBuf_get_addr(); +static void biphaseSimBitInverted(uint8_t c, int *n, uint8_t *phase) { + uint8_t *dest = BigBuf_get_addr(); - if (c) - { - memset(dest + (*n), c ^ 1 ^ *phase, 32); - memset(dest + (*n) + 32, c ^ *phase, 32); - } - else - { - memset(dest + (*n), c ^ *phase, 64); - *phase ^= 1; - } - *n += 64; + if (c) { + memset(dest + (*n), c ^ 1 ^ *phase, 32); + memset(dest + (*n) + 32, c ^ *phase, 32); + } else { + memset(dest + (*n), c ^ *phase, 64); + *phase ^= 1; + } + *n += 64; } #define FIXED_71 0x71 @@ -190,13 +179,11 @@ static uint8_t isEven_64_63(const uint8_t *data) { // 8 return (bitcount32(tmp[0]) + (bitcount32(tmp[1] & 0xfeffffff))) & 1; } -static void bytes_to_bytebits(const void *src, const size_t srclen, void *dest) -{ +static void bytes_to_bytebits(const void *src, const size_t srclen, void *dest) { uint8_t *s = (uint8_t *)src, *d = (uint8_t *)dest; size_t i = srclen * 8, j = srclen; - while (j--) - { + while (j--) { uint8_t b = s[j]; d[--i] = (b >> 0) & 1; d[--i] = (b >> 1) & 1; @@ -209,8 +196,7 @@ static void bytes_to_bytebits(const void *src, const size_t srclen, void *dest) } } -static inline uint32_t bitcount32(uint32_t a) -{ +static inline uint32_t bitcount32(uint32_t a) { #if defined __GNUC__ return __builtin_popcountl(a); #else diff --git a/client/src/cmdhfemrtd.c b/client/src/cmdhfemrtd.c index c99c4b939..bb0808a51 100644 --- a/client/src/cmdhfemrtd.c +++ b/client/src/cmdhfemrtd.c @@ -1964,11 +1964,11 @@ int infoHF_EMRTD_offline(const char *path) { strncat(filepath, PATHSEP, 2); strcat(filepath, dg_table[EF_COM].filename); - if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS) && - (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS)) { - PrintAndLogEx(ERR, "Failed to read EF_COM"); - free(filepath); - return PM3_ESOFT; + if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS) && + (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS)) { + PrintAndLogEx(ERR, "Failed to read EF_COM"); + free(filepath); + return PM3_ESOFT; } int res = emrtd_print_ef_com_info(data, datalen); @@ -1999,9 +1999,9 @@ int infoHF_EMRTD_offline(const char *path) { strcat(filepath, dg_table[EF_CardAccess].filename); if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS) || - (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS)) { - emrtd_print_ef_cardaccess_info(data, datalen); - free(data); + (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS)) { + emrtd_print_ef_cardaccess_info(data, datalen); + free(data); } else { PrintAndLogEx(HINT, "The error above this is normal. It just means that your eMRTD lacks PACE"); } @@ -2010,11 +2010,11 @@ int infoHF_EMRTD_offline(const char *path) { strncat(filepath, PATHSEP, 2); strcat(filepath, dg_table[EF_SOD].filename); - if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS) && - (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS)) { - PrintAndLogEx(ERR, "Failed to read EF_SOD"); - free(filepath); - return PM3_ESOFT; + if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS) && + (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) != PM3_SUCCESS)) { + PrintAndLogEx(ERR, "Failed to read EF_SOD"); + free(filepath); + return PM3_ESOFT; } // coverity scan CID 395630, @@ -2040,7 +2040,7 @@ int infoHF_EMRTD_offline(const char *path) { strncat(filepath, PATHSEP, 2); strcat(filepath, dg->filename); if ((loadFile_safeEx(filepath, ".BIN", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS) || - (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS)) { + (loadFile_safeEx(filepath, ".bin", (void **)&data, (size_t *)&datalen, false) == PM3_SUCCESS)) { // we won't halt on parsing errors if (dg->parser != NULL) { dg->parser(data, datalen); @@ -2111,7 +2111,7 @@ static int CmdHFeMRTDDump(const char *Cmd) { if (CLIParamStrToBuf(arg_get_str(ctx, 1), docnum, 9, &slen) != 0 || slen == 0) { BAC = false; } else { - strn_upper((char*)docnum, slen); + strn_upper((char *)docnum, slen); if (slen != 9) { // Pad to 9 with < memset(docnum + slen, '<', 9 - slen); @@ -2144,7 +2144,7 @@ static int CmdHFeMRTDDump(const char *Cmd) { error = true; } else { BAC = true; - strn_upper((char*)mrz, slen); + strn_upper((char *)mrz, slen); memcpy(docnum, &mrz[0], 9); memcpy(dob, &mrz[13], 6); memcpy(expiry, &mrz[21], 6); @@ -2213,7 +2213,7 @@ static int CmdHFeMRTDInfo(const char *Cmd) { if (CLIParamStrToBuf(arg_get_str(ctx, 1), docnum, 9, &slen) != 0 || slen == 0) { BAC = false; } else { - strn_upper((char*)docnum, slen); + strn_upper((char *)docnum, slen); if (slen != 9) { memset(docnum + slen, '<', 9 - slen); } @@ -2245,7 +2245,7 @@ static int CmdHFeMRTDInfo(const char *Cmd) { error = true; } else { BAC = true; - strn_upper((char*)mrz, slen); + strn_upper((char *)mrz, slen); memcpy(docnum, &mrz[0], 9); memcpy(dob, &mrz[13], 6); memcpy(expiry, &mrz[21], 6); diff --git a/client/src/cmdhfmf.c b/client/src/cmdhfmf.c index 2ea197cf7..98a587cf1 100644 --- a/client/src/cmdhfmf.c +++ b/client/src/cmdhfmf.c @@ -569,7 +569,7 @@ static int CmdHF14AMfWrBl(const char *Cmd) { uint8_t blockno = (uint8_t)b; - // Sector trailer sanity checks. + // Sector trailer sanity checks. // Warn if ACL is strict read-only, or invalid ACL. if (mfIsSectorTrailer(blockno)) { PrintAndLogEx(INFO, "Sector trailer (ST) write detected"); diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 00df6e710..bc8c10859 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -1376,7 +1376,7 @@ static int mfu_fingerprint(TagTypeUL_t tagtype, bool hasAuthKey, uint8_t *authke } } - // OTP checks + // OTP checks mfu_otp_identify_t *item = mfu_match_otp_fingerprint(data); if (item) { PrintAndLogEx(SUCCESS, "Found " _GREEN_("%s"), item->desc); @@ -1391,9 +1391,9 @@ static int mfu_fingerprint(TagTypeUL_t tagtype, bool hasAuthKey, uint8_t *authke } } } - // - - + // + + out: free(data); diff --git a/client/src/cmdlfparadox.c b/client/src/cmdlfparadox.c index e1a714c96..bbd6cd205 100644 --- a/client/src/cmdlfparadox.c +++ b/client/src/cmdlfparadox.c @@ -264,7 +264,7 @@ static int CmdParadoxClone(const char *Cmd) { } uint32_t blocks[4]; - + if (raw_len != 0) { if (raw_len != 12) { PrintAndLogEx(ERR, "Data must be 12 bytes (24 HEX characters) %d", raw_len); @@ -280,39 +280,39 @@ static int CmdParadoxClone(const char *Cmd) { manchester[0] = 0x0F; // preamble manchester[1] = 0x05; // Leading zeros - Note: from this byte on, is part of the CRC calculation - manchester[2] = 0x55; // Leading zeros its 4 bits out for the CRC, so we need too move + manchester[2] = 0x55; // Leading zeros its 4 bits out for the CRC, so we need too move manchester[3] = 0x55; // Leading zeros back 4 bits once we have the crc (done below) // add FC - t1 = manchesterEncode2Bytes (fc); + t1 = manchesterEncode2Bytes(fc); manchester[4] = (t1 >> 8) & 0xFF; manchester[5] = t1 & 0xFF; - + // add cn - t1 = manchesterEncode2Bytes (cn); + t1 = manchesterEncode2Bytes(cn); manchester[6] = (t1 >> 24) & 0xFF; manchester[7] = (t1 >> 16) & 0xFF; manchester[8] = (t1 >> 8) & 0xFF; manchester[9] = t1 & 0xFF; - uint8_t crc = (CRC8Maxim(manchester+1, 9) ^ 0x6) & 0xFF; + uint8_t crc = (CRC8Maxim(manchester + 1, 9) ^ 0x6) & 0xFF; // add crc - t1 = manchesterEncode2Bytes (crc); + t1 = manchesterEncode2Bytes(crc); manchester[10] = (t1 >> 8) & 0xFF; manchester[11] = t1 & 0xFF; // move left 4 bits left 4 bits - Now that we have the CRC we need to re-align the data. for (int i = 1; i < 12; i++) - manchester[i] = (manchester[i] << 4) + (manchester[i+1] >> 4); - + manchester[i] = (manchester[i] << 4) + (manchester[i + 1] >> 4); + // Add trailing 1010 (11) manchester[11] |= (1 << 3); manchester[11] |= (1 << 1); - + // move into tag blocks for (int i = 0; i < 12; i++) - blocks[1 + (i/4)] += (manchester[i] << (8 * (3 - i % 4))); + blocks[1 + (i / 4)] += (manchester[i] << (8 * (3 - i % 4))); } // Paradox - FSK2a, data rate 50, 3 data blocks diff --git a/client/src/cmdpiv.c b/client/src/cmdpiv.c index 3d703e1ec..12b217ebc 100644 --- a/client/src/cmdpiv.c +++ b/client/src/cmdpiv.c @@ -66,7 +66,7 @@ static const struct piv_container PIV_CONTAINERS[] = { {0x0100, PIV_TAG_ID("\x5F\xC1\x0A"), 3, PIV_CONDITIONAL, "X.509 Certificate for Digital Signature (key ref 9C)"}, {0x0102, PIV_TAG_ID("\x5F\xC1\x0B"), 3, PIV_CONDITIONAL, "X.509 Certificate for Key Management (key ref 9D)"}, {0x3001, PIV_TAG_ID("\x5F\xC1\x09"), 3, PIV_OPTIONAL, "Printed Information"}, - {0x6050, PIV_TAG_ID( "\x7E"), 1, PIV_OPTIONAL, "Discovery Object"}, + {0x6050, PIV_TAG_ID("\x7E"), 1, PIV_OPTIONAL, "Discovery Object"}, {0x6060, PIV_TAG_ID("\x5F\xC1\x0C"), 3, PIV_OPTIONAL, "Key History Object"}, {0x1001, PIV_TAG_ID("\x5F\xC1\x0D"), 3, PIV_OPTIONAL, "Retired X.509 Certificate for Key Management 1 (key ref 82)"}, {0x1002, PIV_TAG_ID("\x5F\xC1\x0E"), 3, PIV_OPTIONAL, "Retired X.509 Certificate for Key Management 2 (key ref 83)"}, @@ -89,7 +89,7 @@ static const struct piv_container PIV_CONTAINERS[] = { {0x1013, PIV_TAG_ID("\x5F\xC1\x1F"), 3, PIV_OPTIONAL, "Retired X.509 Certificate for Key Management 19 (key ref 94)"}, {0x1014, PIV_TAG_ID("\x5F\xC1\x20"), 3, PIV_OPTIONAL, "Retired X.509 Certificate for Key Management 20 (key ref 95)"}, {0x1015, PIV_TAG_ID("\x5F\xC1\x21"), 3, PIV_OPTIONAL, "Cardholder Iris Images"}, - {0x1016, PIV_TAG_ID( "\x7F\x61"), 2, PIV_OPTIONAL, "Biometric Information Templates Group Template"}, + {0x1016, PIV_TAG_ID("\x7F\x61"), 2, PIV_OPTIONAL, "Biometric Information Templates Group Template"}, {0x1017, PIV_TAG_ID("\x5F\xC1\x22"), 3, PIV_OPTIONAL, "Secure Messaging Certificate Signer"}, {0x1018, PIV_TAG_ID("\x5F\xC1\x23"), 3, PIV_OPTIONAL, "Pairing Code Reference Data Container"}, PIV_CONTAINER_FINISH, @@ -493,13 +493,13 @@ static void piv_print_cb(void *data, const struct tlv *tlv, int level, bool is_l } } -static void PrintTLV(const struct tlvdb* tlvdb) { +static void PrintTLV(const struct tlvdb *tlvdb) { if (tlvdb) { tlvdb_visit(tlvdb, piv_print_cb, NULL, 0); } } -static void PrintTLVFromBuffer(const uint8_t* buf, size_t len) { +static void PrintTLVFromBuffer(const uint8_t *buf, size_t len) { if (buf == NULL || len == 0) { return; } @@ -598,7 +598,7 @@ static int PivGetData(Iso7816CommandChannel channel, const uint8_t tag[], size_t return PM3_SUCCESS; } -static int PivGetDataByCidAndPrint(Iso7816CommandChannel channel, const struct piv_container* cid, bool decodeTLV, bool verbose) { +static int PivGetDataByCidAndPrint(Iso7816CommandChannel channel, const struct piv_container *cid, bool decodeTLV, bool verbose) { struct tlvdb_root *root = NULL; if (cid == NULL) { diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 22cf3ad5e..e42ac5a16 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -258,13 +258,13 @@ static size_t path_size(savePaths_t a) { if (a == spItemCount) { return 0; } - return strlen( g_session.defaultPaths[a] ); + return strlen(g_session.defaultPaths[a]); } char *newfilenamemcopy(const char *preferredName, const char *suffix) { if (preferredName == NULL || suffix == NULL) { return NULL; - } + } uint16_t p_namelen = strlen(preferredName); if (str_endswith(preferredName, suffix)) @@ -328,7 +328,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t } char *fileName = newfilenamemcopy(preferredName, ".eml"); - if (fileName == NULL) { + if (fileName == NULL) { return PM3_EMALLOC; } diff --git a/client/src/mifare/mifarehost.c b/client/src/mifare/mifarehost.c index 5ce88123d..0c8c8b274 100644 --- a/client/src/mifare/mifarehost.c +++ b/client/src/mifare/mifarehost.c @@ -1466,7 +1466,7 @@ int convert_mfc_2_arr(uint8_t *in, uint16_t ilen, uint8_t *out, uint16_t *olen) ilen -= MFBLOCK_SIZE; *olen += MFBLOCK_SIZE; } - return PM3_SUCCESS; + return PM3_SUCCESS; } static const vigik_pk_t vigik_rsa_pk[] = { @@ -1502,7 +1502,7 @@ static void reverse_array(const uint8_t *src, int src_len, uint8_t *dest) { int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature_len) { // iso9796 - // Exponent V = 2 + // Exponent V = 2 // n = The public modulus n is the product of the secret prime factors p and q. Its length is 1024 bits. if (g_debugMode == DEBUG) { @@ -1527,7 +1527,7 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature // signature = h( C || M1 || h(M2) ) // 1024 - 786 - 160 - 16 -1 - // salt C + // salt C // message M = 96 bytes, 768 bits // sha1 hash H = 20 bytes, 160 bits // padding = 20 bytes, 96 bits @@ -1563,18 +1563,18 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature mbedtls_mpi_init(&sqr); mbedtls_mpi_init(&res); - mbedtls_mpi_read_binary(&N, (const unsigned char*)n, PUBLIC_VIGIK_KEYLEN); + mbedtls_mpi_read_binary(&N, (const unsigned char *)n, PUBLIC_VIGIK_KEYLEN); //mbedtls_mpi_read_binary(&s, (const unsigned char*)signature, signature_len); - mbedtls_mpi_read_binary(&s, (const unsigned char*)rev_sig, signature_len); + mbedtls_mpi_read_binary(&s, (const unsigned char *)rev_sig, signature_len); // check is sign < (N/2) - + mbedtls_mpi n_2; mbedtls_mpi_init(&n_2); mbedtls_mpi_copy(&n_2, &N); mbedtls_mpi_shift_r(&n_2, 1); - bool is_less = (mbedtls_mpi_cmp_mpi(&s, &n_2) > 0) ? false : true; + bool is_less = (mbedtls_mpi_cmp_mpi(&s, &n_2) > 0) ? false : true; PrintAndLogEx(DEBUG, "z < (N/2) ..... %s", (is_less) ? _GREEN_("YES") : _RED_("NO")); mbedtls_mpi_free(&n_2); @@ -1644,10 +1644,10 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature PrintAndLogEx(DEBUG, "LSB............ " _GREEN_("%u"), lsb); if (g_debugMode == DEBUG) { - mbedtls_mpi_write_file( "[=] N.............. ", &N, 16, NULL ); - mbedtls_mpi_write_file( "[=] signature...... ", &s, 16, NULL ); - mbedtls_mpi_write_file( "[=] square mod n... ", &sqr, 16, NULL ); - mbedtls_mpi_write_file( "[=] n-fs........... ", &res, 16, NULL ); + mbedtls_mpi_write_file("[=] N.............. ", &N, 16, NULL); + mbedtls_mpi_write_file("[=] signature...... ", &s, 16, NULL); + mbedtls_mpi_write_file("[=] square mod n... ", &sqr, 16, NULL); + mbedtls_mpi_write_file("[=] n-fs........... ", &res, 16, NULL); } @@ -1656,9 +1656,9 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature // xor 0xDC01 int count_zero = 0; - for (int x = 0; x < sizeof(nfs); x +=2) { + for (int x = 0; x < sizeof(nfs); x += 2) { nfs[x] ^= 0xDC; - nfs[x+1] ^= 0x01; + nfs[x + 1] ^= 0x01; if (nfs[x] == 0x00) count_zero++; @@ -1689,10 +1689,10 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature PrintAndLogEx(INFO, "Hash byte... 0x%02X", ts.hash); switch(ts.rsa[126]) { case 0x11: - PrintAndLogEx(INFO, "Hash algo ( 0x%02X ) - SHA1"); + PrintAndLogEx(INFO, "Hash algo ( 0x%02X ) - SHA1"); break; case 0x22: - PrintAndLogEx(INFO, "Hash algo ( 0x%02X ) - RIPEMD"); + PrintAndLogEx(INFO, "Hash algo ( 0x%02X ) - RIPEMD"); break; case 0x33: PrintAndLogEx(INFO, "Hash algo ( 0x%02X ) - SHA1"); @@ -1711,7 +1711,7 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature print_hex_noascii_break(ts.rsa, sizeof(ts.rsa) - 20, 32); } */ - + mbedtls_mpi_free(&N); mbedtls_mpi_free(&s); mbedtls_mpi_free(&res); @@ -1722,7 +1722,7 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature PrintAndLogEx(INFO, ""); PrintAndLogEx(INFO, "--- " _CYAN_("Tag Signature")); PrintAndLogEx(INFO, "RSA: 1024bit"); - + if (is_valid == false || i == ARRAYLEN(vigik_rsa_pk)) { PrintAndLogEx(INFO, "Signature:"); print_hex_noascii_break(signature, signature_len, MFBLOCK_SIZE * 2); @@ -1736,7 +1736,7 @@ int vigik_verify(uint8_t *uid, uint8_t uidlen, uint8_t *signature, int signature PrintAndLogEx(INFO, "%.64s", vigik_rsa_pk[i].n + 64); PrintAndLogEx(INFO, "%.64s", vigik_rsa_pk[i].n + 128); PrintAndLogEx(INFO, "%.64s", vigik_rsa_pk[i].n + 192); - + PrintAndLogEx(INFO, "Signature:"); print_hex_noascii_break(signature, signature_len, MFBLOCK_SIZE * 2); @@ -1749,7 +1749,7 @@ int vigik_annotate(uint8_t *d) { if (d == NULL) return PM3_EINVARG; - mfc_vigik_t *foo = (mfc_vigik_t*)d; + mfc_vigik_t *foo = (mfc_vigik_t *)d; PrintAndLogEx(INFO, "Manufacture......... %s", sprint_hex(foo->b0, sizeof(foo->b0))); PrintAndLogEx(INFO, "MAD................. %s", sprint_hex(foo->mad, sizeof(foo->mad))); @@ -1773,4 +1773,4 @@ int vigik_annotate(uint8_t *d) { PrintAndLogEx(INFO, ""); return PM3_SUCCESS; -} \ No newline at end of file +} diff --git a/client/src/pm3line_vocabulory.h b/client/src/pm3line_vocabulory.h index de0cb6ace..4ea275639 100644 --- a/client/src/pm3line_vocabulory.h +++ b/client/src/pm3line_vocabulory.h @@ -244,11 +244,11 @@ const static vocabulory_t vocabulory[] = { { 1, "hf gallagher diversifykey" }, { 1, "hf gallagher decode" }, { 1, "hf ksx6924 help" }, - { 0, "hf ksx6924 select" }, - { 0, "hf ksx6924 info" }, { 0, "hf ksx6924 balance" }, - { 0, "hf ksx6924 init" }, + { 0, "hf ksx6924 info" }, + { 0, "hf ksx6924 initialize" }, { 0, "hf ksx6924 prec" }, + { 0, "hf ksx6924 select" }, { 1, "hf jooki help" }, { 0, "hf jooki clone" }, { 1, "hf jooki decode" }, @@ -347,10 +347,6 @@ const static vocabulory_t vocabulory[] = { { 0, "hf mf gen3uid" }, { 0, "hf mf gen3blk" }, { 0, "hf mf gen3freeze" }, - { 0, "hf mf ggetblk" }, - { 0, "hf mf gload" }, - { 0, "hf mf gsave" }, - { 0, "hf mf gsetblk" }, { 0, "hf mf gview" }, { 0, "hf mf ndefformat" }, { 0, "hf mf ndefread" }, @@ -380,7 +376,6 @@ const static vocabulory_t vocabulory[] = { { 1, "hf mfu view" }, { 0, "hf mfu wrbl" }, { 0, "hf mfu eload" }, - { 0, "hf mfu esave" }, { 0, "hf mfu eview" }, { 0, "hf mfu sim" }, { 0, "hf mfu setpwd" }, @@ -589,7 +584,6 @@ const static vocabulory_t vocabulory[] = { { 0, "lf idteck clone" }, { 0, "lf idteck sim" }, { 1, "lf indala help" }, - { 0, "lf indala brute" }, { 1, "lf indala demod" }, { 1, "lf indala altdemod" }, { 0, "lf indala reader" }, @@ -737,11 +731,6 @@ const static vocabulory_t vocabulory[] = { { 0, "nfc barcode read" }, { 0, "nfc barcode sim" }, { 1, "nfc barcode help" }, - { 1, "piv help" }, - { 0, "piv select" }, - { 0, "piv getdata" }, - { 0, "piv scan" }, - { 1, "piv list" }, { 1, "smart help" }, { 1, "smart list" }, { 0, "smart info" }, diff --git a/client/src/ui.c b/client/src/ui.c index 839dd22b0..d9f4514cf 100644 --- a/client/src/ui.c +++ b/client/src/ui.c @@ -62,9 +62,9 @@ pthread_mutex_t g_print_lock = PTHREAD_MUTEX_INITIALIZER; static void fPrintAndLog(FILE *stream, const char *fmt, ...); #ifdef _WIN32 - #define MKDIR_CHK _mkdir(path) +#define MKDIR_CHK _mkdir(path) #else - #define MKDIR_CHK mkdir(path, 0700) +#define MKDIR_CHK mkdir(path, 0700) #endif @@ -107,8 +107,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam if ((result != 0) && create_home) { - if (MKDIR_CHK) - { + if (MKDIR_CHK) { fprintf(stderr, "Could not create user directory %s\n", path); free(path); return PM3_EFILE; @@ -140,8 +139,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam if ((result != 0) && create_home) { - if (MKDIR_CHK) - { + if (MKDIR_CHK) { fprintf(stderr, "Could not create user directory %s\n", path); free(path); return PM3_EFILE; @@ -155,7 +153,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam } pathlen += strlen(filename); - char *tmp = realloc(path, pathlen *sizeof(char)); + char *tmp = realloc(path, pathlen * sizeof(char)); if (tmp == NULL) { //free(path); return PM3_EMALLOC; diff --git a/doc/commands.json b/doc/commands.json index 7546493bb..47f77d21a 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -761,7 +761,7 @@ "options": [ "-h, --help This help", "-k, -K, --keep Keep field ON for next command", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)" ], "usage": "emv challenge [-hkaw]" @@ -777,7 +777,7 @@ "options": [ "-h, --help This help", "-s, -S, --select Activate field and select card", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results", "-j, -J, --jload Load transaction parameters from `emv_defparams.json` file", "-f, -F, --forceaid Force search AID. Search AID instead of execute PPSE", @@ -807,7 +807,7 @@ "-d, -D, --decision Terminal decision. aac - declined, tc - approved, arqc - online authorisation requested", "-p, -P, --params Load parameters from `emv_defparams.json` file for CDOLdata making from CDOL and parameters", "-m, -M, --make Make CDOLdata from CDOL (tag 8C and 8D) and parameters (def: use default parameters)", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results of selected applets", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", " CDOLdata/CDOL" @@ -828,7 +828,7 @@ "-k, -K, --keep Keep field ON for next command", "-p, -P, --params Load parameters from `emv_defparams.json` file for PDOLdata making from PDOL and parameters", "-m, -M, --make Make PDOLdata from PDOL (tag 9F38) and parameters (def: uses default parameters)", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results of selected applets", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", " PDOLdata/PDOL" @@ -857,7 +857,7 @@ "-k, -K, --keep Keep field ON for next command", "-p, -P, --params Load parameters from `emv_defparams.json` file for DDOLdata making from DDOL and parameters", "-m, -M, --make Make DDOLdata from DDOL (tag 9F49) and parameters (def: use default parameters)", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results of selected applets", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", " DDOLdata/DDOL" @@ -868,22 +868,22 @@ "command": "emv list", "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "emv list --frame -> show frame delay times", + "emv list -f -> show frame delay times", "emv list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "emv list [-h1crux] [--frame] [-f ]" + "usage": "emv list [-h1fcrux] [--dict ]" }, "emv pse": { "command": "emv pse", @@ -899,7 +899,7 @@ "-k, -K, --keep Keep field ON for next command", "-1, --pse PSE (1PAY.SYS.DDF01) mode", "-2, --ppse PPSE (2PAY.SYS.DDF01) mode (def)", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results of selected applets", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)" ], @@ -916,7 +916,7 @@ "options": [ "-h, --help This help", "-k, -K, --keep Keep field ON for next command", - "-a, -A, --apdu Show APDU requests and responses", + "-a, -A, --apdu Show APDU reqests and responses", "-t, -T, --tlv TLV decode results of selected applets", "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", " help` for details of a command prefs { Edit client/device preferences... } -------- ----------------------- Technology ----------------------- analyse { Analyse utils... } data { Plot window / data buffer manipulation... } emv { EMV ISO-14443 / ISO-7816... } hf { High frequency commands... } hw { Hardware commands... } lf { Low frequency commands... } nfc { NFC commands... } piv { PIV commands... } reveng { CRC calculations from RevEng software... } smart { Smart card ISO-7816 commands... } script { Scripting commands... } trace { Trace manipulation... } wiegand { Wiegand format manipulation... } -------- ----------------------- General ----------------------- clear Clear screen hints Turn hints on / off msleep Add a pause in milliseconds rem Add a text line in log file quit exit Exit program", + "description": "help Use ` help` for details of a command prefs { Edit client/device preferences... } -------- ----------------------- Technology ----------------------- analyse { Analyse utils... } data { Plot window / data buffer manipulation... } emv { EMV ISO-14443 / ISO-7816... } hf { High frequency commands... } hw { Hardware commands... } lf { Low frequency commands... } nfc { NFC commands... } reveng { CRC calculations from RevEng software... } smart { Smart card ISO-7816 commands... } script { Scripting commands... } trace { Trace manipulation... } wiegand { Wiegand format manipulation... } -------- ----------------------- General ----------------------- clear Clear screen hints Turn hints on / off msleep Add a pause in milliseconds rem Add a text line in log file quit exit Exit program", "notes": [], "offline": true, "options": [], @@ -1145,22 +1145,22 @@ "command": "hf 14a list", "description": "Alias of `trace list -t 14a` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf 14a list --frame -> show frame delay times", + "hf 14a list -f -> show frame delay times", "hf 14a list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf 14a list [-h1crux] [--frame] [-f ]" + "usage": "hf 14a list [-h1fcrux] [--dict ]" }, "hf 14a ndefformat": { "command": "hf 14a ndefformat", @@ -1259,7 +1259,7 @@ }, "hf 14a sim": { "command": "hf 14a sim", - "description": "Simulate ISO/IEC 14443 type A tag with 4,7 or 10 byte UID Use type 7 for Mifare Ultralight EV1, Amiibo (NTAG215 pack 0x8080)", + "description": "Simulate ISO/IEC 14443 type A tag with 4,7 or 10 byte UID", "notes": [ "hf 14a sim -t 1 --uid 11223344 -> MIFARE Classic 1k", "hf 14a sim -t 2 -> MIFARE Ultralight", @@ -1267,7 +1267,7 @@ "hf 14a sim -t 4 -> ISO/IEC 14443-4", "hf 14a sim -t 5 -> MIFARE Tnp3xxx", "hf 14a sim -t 6 -> MIFARE Mini", - "hf 14a sim -t 7 -> MFU EV1 / NTAG 215 Amiibo", + "hf 14a sim -t 7 -> Amiibo (NTAG 215), pack 0x8080", "hf 14a sim -t 8 -> MIFARE Classic 4k", "hf 14a sim -t 9 -> FM11RF005SH Shanghai Metro", "hf 14a sim -t 10 -> ST25TA IKEA Rothult" @@ -1363,22 +1363,22 @@ "command": "hf 14b list", "description": "Alias of `trace list -t 14b` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf 14b list --frame -> show frame delay times", + "hf 14b list -f -> show frame delay times", "hf 14b list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf 14b list [-h1crux] [--frame] [-f ]" + "usage": "hf 14b list [-h1fcrux] [--dict ]" }, "hf 14b ndefread": { "command": "hf 14b ndefread", @@ -1637,22 +1637,22 @@ "command": "hf 15 list", "description": "Alias of `trace list -t 15` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf 15 list --frame -> show frame delay times", + "hf 15 list -f -> show frame delay times", "hf 15 list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf 15 list [-h1crux] [--frame] [-f ]" + "usage": "hf 15 list [-h1fcrux] [--dict ]" }, "hf 15 raw": { "command": "hf 15 raw", @@ -2232,22 +2232,22 @@ "command": "hf emrtd list", "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf emrtd list --frame -> show frame delay times", + "hf emrtd list -f -> show frame delay times", "hf emrtd list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf emrtd list [-h1crux] [--frame] [-f ]" + "usage": "hf emrtd list [-h1fcrux] [--dict ]" }, "hf epa cnonces": { "command": "hf epa cnonces", @@ -2367,22 +2367,22 @@ "command": "hf felica list", "description": "Alias of `trace list -t felica` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf felica list --frame -> show frame delay times", + "hf felica list -f -> show frame delay times", "hf felica list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf felica list [-h1crux] [--frame] [-f ]" + "usage": "hf felica list [-h1fcrux] [--dict ]" }, "hf felica litedump": { "command": "hf felica litedump", @@ -2575,7 +2575,7 @@ "offline": false, "options": [ "-h, --help This help", - "-a, --apdu Show APDU requests and responses", + "-a, --apdu Show APDU reqests and responses", "-v, --verbose Verbose mode. vv - show full certificates data", "-c, --cbor Show CBOR decoded data", "-l, --list Add CredentialId from json to allowList", @@ -2596,7 +2596,7 @@ "offline": false, "options": [ "-h, --help This help", - "-a, --apdu Show APDU requests and responses", + "-a, --apdu Show APDU reqests and responses", "-v, --verbose Verbose mode", "default mode: dont-enforce-user-presence-and-sign", "-u, --user mode: enforce-user-presence-and-sign", @@ -2635,22 +2635,22 @@ "command": "hf fido list", "description": "Alias of `trace list -t 14a` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf fido list --frame -> show frame delay times", + "hf fido list -f -> show frame delay times", "hf fido list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf fido list [-h1crux] [--frame] [-f ]" + "usage": "hf fido list [-h1fcrux] [--dict ]" }, "hf fido make": { "command": "hf fido make", @@ -2662,7 +2662,7 @@ "offline": false, "options": [ "-h, --help This help", - "-a, --apdu Show APDU requests and responses", + "-a, --apdu Show APDU reqests and responses", "-v, --verbose Verbose mode. vv - show full certificates data", "-t, --tlv Show DER certificate contents in TLV representation", "-c, --cbor Show CBOR decoded data", @@ -2916,10 +2916,9 @@ "-f, --file Dictionary file with default iclass keys", "--credit key is assumed to be the credit key", "--elite elite computations applied to key", - "--raw no computations applied to key (raw)", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "--raw no computations applied to key (raw)" ], - "usage": "hf iclass chk [-h] -f [--credit] [--elite] [--raw] [--shallow]" + "usage": "hf iclass chk [-h] -f [--credit] [--elite] [--raw]" }, "hf iclass configcard": { "command": "hf iclass configcard", @@ -2970,11 +2969,9 @@ "--elite elite computations applied to key", "--raw raw, the key is interpreted as raw block 3/4", "--nr replay of NR/MAC", - "-z, --dense dense dump output style", - "--force force unsecure card read", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-z, --dense dense dump output style" ], - "usage": "hf iclass dump [-hz] [-f ] [-k ] [--ki ] [--credit ] [--ci ] [--elite] [--raw] [--nr] [--force] [--shallow]" + "usage": "hf iclass dump [-hz] [-f ] [-k ] [--ki ] [--credit ] [--ci ] [--elite] [--raw] [--nr]" }, "hf iclass eload": { "command": "hf iclass eload", @@ -2993,7 +2990,7 @@ }, "hf iclass encode": { "command": "hf iclass encode", - "description": "Encode binary wiegand to block 7,8,9 Use either --bin or --wiegand/--fc/--cn", + "description": "Encode binary wiegand to block 7 Use either --bin or --wiegand/--fc/--cn", "notes": [ "hf iclass encode --bin 10001111100000001010100011 --ki 0 -> FC 31 CN 337", "hf iclass encode --fc 31 --cn 337 --ki 0 -> FC 31 CN 337", @@ -3010,10 +3007,9 @@ "--enckey 3DES transport key, 16 hex bytes", "--fc facility code", "--cn card number", - "-w, --wiegand see `wiegand list` for available formats", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-w, --wiegand see `wiegand list` for available formats" ], - "usage": "hf iclass encode [-h] [--bin ] --ki [--credit] [--elite] [--raw] [--enckey ] [--fc ] [--cn ] [-w ] [--shallow]" + "usage": "hf iclass encode [-h] [--bin ] --ki [--credit] [--elite] [--raw] [--enckey ] [--fc ] [--cn ] [-w ]" }, "hf iclass encrypt": { "command": "hf iclass encrypt", @@ -3080,31 +3076,30 @@ ], "offline": true, "options": [ - "-h, --help This help", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-h, --help This help" ], - "usage": "hf iclass info [-h] [--shallow]" + "usage": "hf iclass info [-h]" }, "hf iclass list": { "command": "hf iclass list", "description": "Alias of `trace list -t iclass` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf iclass list --frame -> show frame delay times", + "hf iclass list -f -> show frame delay times", "hf iclass list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf iclass list [-h1crux] [--frame] [-f ]" + "usage": "hf iclass list [-h1fcrux] [--dict ]" }, "hf iclass loclass": { "command": "hf iclass loclass", @@ -3195,10 +3190,9 @@ "--elite elite computations applied to key", "--raw no computations applied to key", "--nr replay of NR/MAC", - "-v, --verbose verbose output", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-v, --verbose verbose output" ], - "usage": "hf iclass rdbl [-hv] [-k ] [--ki ] -b [--credit] [--elite] [--raw] [--nr] [--shallow]" + "usage": "hf iclass rdbl [-hv] [-k ] [--ki ] -b [--credit] [--elite] [--raw] [--nr]" }, "hf iclass reader": { "command": "hf iclass reader", @@ -3209,10 +3203,9 @@ "offline": false, "options": [ "-h, --help This help", - "-@ optional - continuous reader mode", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-@ optional - continuous reader mode" ], - "usage": "hf iclass reader [-h@] [--shallow]" + "usage": "hf iclass reader [-h@]" }, "hf iclass restore": { "command": "hf iclass restore", @@ -3233,10 +3226,9 @@ "--credit key is assumed to be the credit key", "--elite elite computations applied to key", "--raw no computations applied to key", - "-v, --verbose verbose output", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-v, --verbose verbose output" ], - "usage": "hf iclass restore [-hv] -f [-k ] [--ki ] --first --last [--credit] [--elite] [--raw] [--shallow]" + "usage": "hf iclass restore [-hv] -f [-k ] [--ki ] --first --last [--credit] [--elite] [--raw]" }, "hf iclass sim": { "command": "hf iclass sim", @@ -3308,10 +3300,9 @@ "--elite elite computations applied to key", "--raw no computations applied to key", "--nr replay of NR/MAC", - "-v, --verbose verbose output", - "--shallow use shallow (ASK) reader modulation instead of OOK" + "-v, --verbose verbose output" ], - "usage": "hf iclass wrbl [-hv] [-k ] [--ki ] -b -d [-m ] [--credit] [--elite] [--raw] [--nr] [--shallow]" + "usage": "hf iclass wrbl [-hv] [-k ] [--ki ] -b -d [-m ] [--credit] [--elite] [--raw] [--nr]" }, "hf jooki clone": { "command": "hf jooki clone", @@ -3409,7 +3400,7 @@ "options": [ "-h, --help This help", "-k, --keep keep field ON for next command", - "-a, --apdu Show APDU requests and responses" + "-a, --apdu show APDU reqests and responses" ], "usage": "hf ksx6924 balance [-hka]" }, @@ -3431,23 +3422,23 @@ "options": [ "-h, --help This help", "-k, --keep keep field ON for next command", - "-a, --apdu Show APDU requests and responses" + "-a, --apdu show APDU reqests and responses" ], "usage": "hf ksx6924 info [-hka]" }, - "hf ksx6924 init": { - "command": "hf ksx6924 init", - "description": "Perform transaction initialization with Mpda (Money of Purchase Transaction)", + "hf ksx6924 initialize": { + "command": "hf ksx6924 initialize", + "description": "Perform transaction initialization (mpda)", "notes": [ - "hf ksx6924 init 000003e8 -> Mpda" + "hf ksx6924 initialize 000003e8 -> mpda" ], "offline": false, "options": [ "-h, --help This help", "-k, --keep keep field ON for next command", - "-a, --apdu Show APDU requests and responses" + "-a, --apdu show APDU reqests and responses" ], - "usage": "hf ksx6924 init [-hka] " + "usage": "hf ksx6924 initialize [-hka] " }, "hf ksx6924 prec": { "command": "hf ksx6924 prec", @@ -3459,7 +3450,7 @@ "options": [ "-h, --help This help", "-k, --keep keep field ON for next command", - "-a, --apdu Show APDU requests and responses" + "-a, --apdu show APDU reqests and responses" ], "usage": "hf ksx6924 prec [-hka] " }, @@ -3472,7 +3463,7 @@ "offline": false, "options": [ "-h, --help This help", - "-a, --apdu Show APDU requests and responses" + "-a, --apdu show APDU reqests and responses" ], "usage": "hf ksx6924 select [-ha]" }, @@ -3582,22 +3573,22 @@ "command": "hf legic list", "description": "Alias of `trace list -t legic` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf legic list --frame -> show frame delay times", + "hf legic list -f -> show frame delay times", "hf legic list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf legic list [-h1crux] [--frame] [-f ]" + "usage": "hf legic list [-h1fcrux] [--dict ]" }, "hf legic rdbl": { "command": "hf legic rdbl", @@ -3704,22 +3695,22 @@ "command": "hf list", "description": "Alias of `trace list -t raw` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf list --frame -> show frame delay times", + "hf list -f -> show frame delay times", "hf list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf list [-h1crux] [--frame] [-f ]" + "usage": "hf list [-h1fcrux] [--dict ]" }, "hf lto dump": { "command": "hf lto dump", @@ -3758,22 +3749,22 @@ "command": "hf lto list", "description": "Alias of `trace list -t lto` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf lto list --frame -> show frame delay times", + "hf lto list -f -> show frame delay times", "hf lto list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf lto list [-h1crux] [--frame] [-f ]" + "usage": "hf lto list [-h1fcrux] [--dict ]" }, "hf lto rdbl": { "command": "hf lto rdbl", @@ -3978,7 +3969,7 @@ "--1k MIFARE Classic 1k / S50 (def)", "--2k MIFARE Classic/Plus 2k", "--4k MIFARE Classic 4k / S70", - "--emu to emulator memory" + "--emu from emulator memory" ], "usage": "hf mf csave [-h] [-f ] [--mini] [--1k] [--2k] [--4k] [--emu]" }, @@ -4312,85 +4303,6 @@ ], "usage": "hf mf gen3uid [-h] [-u ]" }, - "hf mf ggetblk": { - "command": "hf mf ggetblk", - "description": "Get block data from magic gen4 GTU card.", - "notes": [ - "hf mf ggetblk --blk 0 -> get block 0 (manufacturer)", - "hf mf ggetblk --blk 3 -v -> get block 3, decode sector trailer" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-b, --blk block number", - "-v, --verbose verbose output", - "-p, --pwd password 4bytes" - ], - "usage": "hf mf ggetblk [-hv] -b [-p ]" - }, - "hf mf gload": { - "command": "hf mf gload", - "description": "Load magic gen4 gtu card with data from (bin/eml/json) dump file or from emulator memory.", - "notes": [ - "hf mf gload --emu", - "hf mf gload -f hf-mf-01020304.eml", - "hf mf gload -p AABBCCDD --4k -v -f hf-mf-01020304-dump.bin", - "", - "Card must be configured beforehand with `script run hf_mf_ultimatecard`.", - "Blocks are 16 bytes long." - ], - "offline": false, - "options": [ - "-h, --help This help", - "--mini MIFARE Classic Mini / S20", - "--1k MIFARE Classic 1k / S50 (def)", - "--2k MIFARE Classic/Plus 2k", - "--4k MIFARE Classic 4k / S70", - "-p, --pwd password 4bytes", - "-v, --verbose verbose output", - "-f, --file filename of dump", - "--emu from emulator memory", - "--start index of block to start writing (default 0)", - "--end index of block to end writing (default last block)" - ], - "usage": "hf mf gload [-hv] [--mini] [--1k] [--2k] [--4k] [-p ] [-f ] [--emu] [--start ] [--end ]" - }, - "hf mf gsave": { - "command": "hf mf gsave", - "description": "Save `magic gen4 gtu` card memory into three files (BIN/EML/JSON)or into emulator memory", - "notes": [ - "hf mf gsave", - "hf mf gsave --4k", - "hf mf gsave -p DEADBEEF -f hf-mf-01020304.json" - ], - "offline": false, - "options": [ - "-h, --help This help", - "--mini MIFARE Classic Mini / S20", - "--1k MIFARE Classic 1k / S50 (def)", - "--2k MIFARE Classic/Plus 2k", - "--4k MIFARE Classic 4k / S70", - "-p, --pwd password 4bytes", - "-f, --file filename of dump", - "--emu to emulator memory" - ], - "usage": "hf mf gsave [-h] [--mini] [--1k] [--2k] [--4k] [-p ] [-f ] [--emu]" - }, - "hf mf gsetblk": { - "command": "hf mf gsetblk", - "description": "Set block data on a magic gen4 GTU card", - "notes": [ - "hf mf gsetblk --blk 1 -d 000102030405060708090a0b0c0d0e0f" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-b, --blk block number", - "-d, --data bytes to write, 16 hex bytes", - "-p, --pwd password 4bytes" - ], - "usage": "hf mf gsetblk [-h] -b [-d ] [-p ]" - }, "hf mf gview": { "command": "hf mf gview", "description": "View `magic gen4 gtu` card memory", @@ -4412,9 +4324,8 @@ }, "hf mf hardnested": { "command": "hf mf hardnested", - "description": "Nested attack for hardened MIFARE Classic cards. if card is EV1, command can detect and use known key see example below `--i` set type of SIMD instructions. Without this flag programs autodetect it. or hf mf hardnested -r --tk [known target key] Add the known target key to check if it is present in the remaining key space hf mf hardnested --blk 0 -a -k A0A1A2A3A4A5 --tblk 4 --ta --tk FFFFFFFFFFFF", + "description": "Nested attack for hardened MIFARE Classic cards. `--i` set type of SIMD instructions. Without this flag programs autodetect it. or hf mf hardnested -r --tk [known target key] Add the known target key to check if it is present in the remaining key space hf mf hardnested --blk 0 -a -k A0A1A2A3A4A5 --tblk 4 --ta --tk FFFFFFFFFFFF", "notes": [ - "hf mf hardnested --tblk 4 --ta -> works for MFC EV1", "hf mf hardnested --blk 0 -a -k FFFFFFFFFFFF --tblk 4 --ta", "hf mf hardnested --blk 0 -a -k FFFFFFFFFFFF --tblk 4 --ta -w", "hf mf hardnested --blk 0 -a -k FFFFFFFFFFFF --tblk 4 --ta -f nonces.bin -w -s", @@ -4461,22 +4372,22 @@ "command": "hf mf list", "description": "Alias of `trace list -t mf` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf mf list --frame -> show frame delay times", + "hf mf list -f -> show frame delay times", "hf mf list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf mf list [-h1crux] [--frame] [-f ]" + "usage": "hf mf list [-h1fcrux] [--dict ]" }, "hf mf mad": { "command": "hf mf mad", @@ -5640,22 +5551,22 @@ "command": "hf mfdes list", "description": "Alias of `trace list -t des` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf mfdes list --frame -> show frame delay times", + "hf mfdes list -f -> show frame delay times", "hf mfdes list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf mfdes list [-h1crux] [--frame] [-f ]" + "usage": "hf mfdes list [-h1fcrux] [--dict ]" }, "hf mfdes lsapp": { "command": "hf mfdes lsapp", @@ -6202,35 +6113,17 @@ ], "usage": "hf mfu eload [-h] -f [-q ]" }, - "hf mfu esave": { - "command": "hf mfu esave", - "description": "Saves emulator memory to a MIFARE Ultralight/NTAG dump file (bin/eml/json) By default number of pages saved depends on defined tag type. You can override this with option --end.", - "notes": [ - "hf mfu esave", - "hf mfu esave --end 255 -> saves whole memory", - "hf mfu esave -f hf-mfu-04010203040506-dump.json" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-e, --end index of last block", - "-f, --file filename of dump" - ], - "usage": "hf mfu esave [-h] [-e ] [-f ]" - }, "hf mfu eview": { "command": "hf mfu eview", - "description": "Displays emulator memory By default number of pages shown depends on defined tag type. You can override this with option --end.", + "description": "It displays emulator memory", "notes": [ - "hf mfu eview", - "hf mfu eview --end 255 -> dumps whole memory" + "hf mfu eview" ], "offline": false, "options": [ - "-h, --help This help", - "-e, --end index of last block" + "-h, --help This help" ], - "usage": "hf mfu eview [-h] [-e ]" + "usage": "hf mfu eview [-h]" }, "hf mfu help": { "command": "hf mfu help", @@ -6398,8 +6291,8 @@ "description": "Simulate MIFARE Ultralight family type based upon ISO/IEC 14443 type A tag with 4,7 or 10 byte UID from emulator memory. See `hf mfu eload` first. The UID from emulator memory will be used if not specified. See `hf 14a sim -h` to see available types. You want 2 or 7 usually.", "notes": [ "hf mfu sim -t 2 --uid 11223344556677 -> MIFARE Ultralight", - "hf mfu sim -t 7 --uid 11223344556677 -n 5 -> MFU EV1 / NTAG 215 Amiibo", - "hf mfu sim -t 7 -> MFU EV1 / NTAG 215 Amiibo" + "hf mfu sim -t 7 --uid 11223344556677 -n 5 -> Amiibo (NTAG 215), pack 0x8080", + "hf mfu sim -t 7 -> Amiibo (NTAG 215), pack 0x8080" ], "offline": false, "options": [ @@ -6540,22 +6433,22 @@ "command": "hf seos list", "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf seos list --frame -> show frame delay times", + "hf seos list -f -> show frame delay times", "hf seos list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf seos list [-h1crux] [--frame] [-f ]" + "usage": "hf seos list [-h1fcrux] [--dict ]" }, "hf sniff": { "command": "hf sniff", @@ -6598,22 +6491,22 @@ "command": "hf st25ta list", "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf st25ta list --frame -> show frame delay times", + "hf st25ta list -f -> show frame delay times", "hf st25ta list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf st25ta list [-h1crux] [--frame] [-f ]" + "usage": "hf st25ta list [-h1fcrux] [--dict ]" }, "hf st25ta ndefread": { "command": "hf st25ta ndefread", @@ -6748,22 +6641,22 @@ "command": "hf thinfilm list", "description": "Alias of `trace list -t thinfilm` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf thinfilm list --frame -> show frame delay times", + "hf thinfilm list -f -> show frame delay times", "hf thinfilm list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf thinfilm list [-h1crux] [--frame] [-f ]" + "usage": "hf thinfilm list [-h1fcrux] [--dict ]" }, "hf thinfilm sim": { "command": "hf thinfilm sim", @@ -6819,22 +6712,22 @@ "command": "hf topaz list", "description": "Alias of `trace list -t topaz` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "hf topaz list --frame -> show frame delay times", + "hf topaz list -f -> show frame delay times", "hf topaz list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "hf topaz list [-h1crux] [--frame] [-f ]" + "usage": "hf topaz list [-h1fcrux] [--dict ]" }, "hf topaz raw": { "command": "hf topaz raw", @@ -8562,22 +8455,22 @@ "command": "lf hitag list", "description": "Alias of `trace list -t hitag2` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "lf hitag list --frame -> show frame delay times", + "lf hitag list -f -> show frame delay times", "lf hitag list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "lf hitag list [-h1crux] [--frame] [-f ]" + "usage": "lf hitag list [-h1fcrux] [--dict ]" }, "lf hitag reader": { "command": "lf hitag reader", @@ -8734,28 +8627,6 @@ ], "usage": "lf indala altdemod [-hl]" }, - "lf indala brute": { - "command": "lf indala brute", - "description": "Enables bruteforce of INDALA readers with specified facility code. This is a attack against reader. if cardnumber is given, it starts with it and goes up / down one step if cardnumber is not given, it starts with 1 and goes up to 65535", - "notes": [ - "lf indala brute --fc 224", - "lf indala brute --fc 21 -d 2000", - "lf indala brute -v --fc 21 --cn 200 -d 2000", - "lf indala brute -v --fc 21 --cn 200 -d 2000 --up" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-v, --verbose verbose output", - "--fc facility code", - "--cn card number to start with", - "-d, --delay delay betweens attempts in ms. Default 1000ms", - "--up direction to increment card number. (default is both directions)", - "--down direction to decrement card number. (default is both directions)", - "--4041x specify Indala 4041X format" - ], - "usage": "lf indala brute [-hv] [--fc ] [--cn ] [-d ] [--up] [--down] [--4041x]" - }, "lf indala clone": { "command": "lf indala clone", "description": "clone Indala UID to T55x7 or Q5/T5555 tag using different known formats", @@ -8811,8 +8682,6 @@ "description": "Enables simulation of Indala card with specified facility code and card number. Simulation runs until the button is pressed or another USB command is issued.", "notes": [ "lf indala sim --heden 888", - "lf indala sim --fc 123 --cn 1337", - "lf indala sim --fc 123 --cn 1337 --4041x", "lf indala sim --raw a0000000a0002021", "lf indala sim --raw 80000001b23523a6c2e31eba3cbee4afb3c6ad1fcf649393928c14e5" ], @@ -8820,12 +8689,9 @@ "options": [ "-h, --help This help", "-r, --raw raw bytes", - "--heden Cardnumber for Heden 2L format", - "--fc Facility code (26 bit H10301 format)", - "--cn Card number (26 bit H10301 format)", - "--4041x Optional - specify Indala 4041X format, must use with fc and cn" + "--heden Cardnumber for Heden 2L format" ], - "usage": "lf indala sim [-h] [-r ] [--heden ] [--fc ] [--cn ] [--4041x]" + "usage": "lf indala sim [-h] [-r ] [--heden ]" }, "lf io clone": { "command": "lf io clone", @@ -10952,93 +10818,6 @@ ], "usage": "hf 14b ndefread [-hv] [-f ]" }, - "piv getdata": { - "command": "piv getdata", - "description": "Get a data container of a given tag", - "notes": [ - "piv getdata -s 5fc102 -> select card, select applet, get card holder unique identifer", - "piv getdata -st 5fc102 -> select card, select applet, get card holder unique identifer, show result in TLV" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-s, -S, --select Activate field and select applet", - "-k, -K, --keep Keep field for next command", - "-a, -A, --apdu Show APDU requests and responses", - "-t, -T, --tlv TLV decode results", - "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", - "--aid Applet ID to select. By default A0000003080000100 will be used", - " Tag ID to read, between 1 and 3 bytes." - ], - "usage": "piv getdata [-hskatw] [--aid ] " - }, - "piv help": { - "command": "piv help", - "description": "help This help list List ISO7816 history", - "notes": [], - "offline": true, - "options": [], - "usage": "" - }, - "piv list": { - "command": "piv list", - "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", - "notes": [ - "piv list --frame -> show frame delay times", - "piv list -1 -> use trace buffer" - ], - "offline": true, - "options": [ - "-h, --help This help", - "-1, --buffer use data from trace buffer", - "--frame show frame delay times", - "-c mark CRC bytes", - "-r show relative times (gap and duration)", - "-u display times in microseconds instead of clock cycles", - "-x show hexdump to convert to pcap(ng)", - "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" - ], - "usage": "piv list [-h1crux] [--frame] [-f ]" - }, - "piv scan": { - "command": "piv scan", - "description": "Scan a PIV card for known containers", - "notes": [ - "piv scan -s -> select card, select applet and run scan", - "piv scan -st --aid a00000030800001000 -> select card, select applet a00000030800001000, show result of the scan in TLV" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-s, -S, --select Activate field and select applet", - "-k, -K, --keep Keep field for next command", - "-a, -A, --apdu Show APDU requests and responses", - "-t, -T, --tlv TLV decode results", - "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", - "--aid Applet ID to select. By default A0000003080000100 will be used" - ], - "usage": "piv scan [-hskatw] [--aid ]" - }, - "piv select": { - "command": "piv select", - "description": "Executes select applet command", - "notes": [ - "piv select -s -> select card, select applet", - "piv select -st --aid a00000030800001000 -> select card, select applet a00000030800001000, show result in TLV" - ], - "offline": false, - "options": [ - "-h, --help This help", - "-s, -S, --select Activate field and select applet", - "-k, -K, --keep Keep field for next command", - "-a, -A, --apdu Show APDU requests and responses", - "-t, -T, --tlv TLV decode results", - "-w, -W, --wired Send data via contact (iso7816) interface. (def: Contactless interface)", - "--aid Applet ID to select. By default A0000003080000100 will be used" - ], - "usage": "piv select [-hskatw] [--aid ]" - }, "prefs get barmode": { "command": "prefs get barmode", "description": "Get preference of HF/LF tune command styled output in the client", @@ -11394,22 +11173,22 @@ "command": "smart list", "description": "Alias of `trace list -t 7816` with selected protocol data to annotate trace buffer You can load a trace from file (see `trace load -h`) or it be downloaded from device by default It accepts all other arguments of `trace list`. Note that some might not be relevant for this specific protocol", "notes": [ - "smart list --frame -> show frame delay times", + "smart list -f -> show frame delay times", "smart list -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "smart list [-h1crux] [--frame] [-f ]" + "usage": "smart list [-h1fcrux] [--dict ]" }, "smart raw": { "command": "smart raw", @@ -11516,24 +11295,24 @@ "trace list -t thinfilm -> interpret as Thinfilm", "trace list -t topaz -> interpret as Topaz", "", - "trace list -t mf -f mfc_default_keys.dic -> use default dictionary file", - "trace list -t 14a --frame -> show frame delay times", + "trace list -t mf --dict -> use dictionary keys file", + "trace list -t 14a -f -> show frame delay times", "trace list -t 14a -1 -> use trace buffer" ], "offline": true, "options": [ "-h, --help This help", "-1, --buffer use data from trace buffer", - "--frame show frame delay times", + "-f show frame delay times", "-c mark CRC bytes", "-r show relative times (gap and duration)", "-u display times in microseconds instead of clock cycles", "-x show hexdump to convert to pcap(ng)", "or to import into Wireshark using encapsulation type \"ISO 14443\"", "-t, --type protocol to annotate the trace", - "-f, --file filename of dictionary" + "--dict use dictionary keys file" ], - "usage": "trace list [-h1crux] [--frame] [-t ] [-f ]" + "usage": "trace list [-h1fcrux] [-t ] [--dict ]" }, "trace load": { "command": "trace load", @@ -11731,8 +11510,8 @@ } }, "metadata": { - "commands_extracted": 738, + "commands_extracted": 727, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2023-01-06T21:37:50" + "extracted_on": "2023-01-14T21:16:27" } } \ No newline at end of file diff --git a/doc/commands.md b/doc/commands.md index bb4c68869..2133d960b 100644 --- a/doc/commands.md +++ b/doc/commands.md @@ -367,11 +367,11 @@ Check column "offline" for their availability. |command |offline |description |------- |------- |----------- |`hf ksx6924 help `|Y |`This help` -|`hf ksx6924 select `|N |`Select application, and leave field up` -|`hf ksx6924 info `|N |`Get info about a KS X 6924 (T-Money, Snapper+) transit card` |`hf ksx6924 balance `|N |`Get current purse balance` -|`hf ksx6924 init `|N |`Perform transaction initialization with Mpda` +|`hf ksx6924 info `|N |`Get info about a KS X 6924 (T-Money, Snapper+) transit card` +|`hf ksx6924 initialize `|N |`Perform transaction initialization (Mpda)` |`hf ksx6924 prec `|N |`Send proprietary get record command (CLA=90, INS=4C)` +|`hf ksx6924 select `|N |`Select application, and leave field up` ### hf jooki @@ -510,10 +510,6 @@ Check column "offline" for their availability. |`hf mf gen3uid `|N |`Set UID without changing manufacturer block` |`hf mf gen3blk `|N |`Overwrite manufacturer block` |`hf mf gen3freeze `|N |`Perma lock UID changes. irreversible` -|`hf mf ggetblk `|N |`Read block from card` -|`hf mf gload `|N |`Load dump to card` -|`hf mf gsave `|N |`Save dump from card into file or emulator` -|`hf mf gsetblk `|N |`Write block to card` |`hf mf gview `|N |`View card` |`hf mf ndefformat `|N |`Format MIFARE Classic Tag as NFC Tag` |`hf mf ndefread `|N |`Read and print NDEF records from card` @@ -558,8 +554,7 @@ Check column "offline" for their availability. |`hf mfu restore `|N |`Restore a dump onto a MFU MAGIC tag` |`hf mfu view `|Y |`Display content from tag dump file` |`hf mfu wrbl `|N |`Write block` -|`hf mfu eload `|N |`Load Ultralight dump file into emulator memory` -|`hf mfu esave `|N |`Save Ultralight dump file from emulator memory` +|`hf mfu eload `|N |`Load Ultralight .eml dump file into emulator memory` |`hf mfu eview `|N |`View emulator memory` |`hf mfu sim `|N |`Simulate MIFARE Ultralight from emulator memory` |`hf mfu setpwd `|N |`Set 3DES key - Ultralight-C` @@ -976,7 +971,6 @@ Check column "offline" for their availability. |command |offline |description |------- |------- |----------- |`lf indala help `|Y |`This help` -|`lf indala brute `|N |`Demodulate an Indala tag (PSK1) from the GraphBuffer` |`lf indala demod `|Y |`Demodulate an Indala tag (PSK1) from the GraphBuffer` |`lf indala altdemod `|Y |`Alternative method to demodulate samples for Indala 64 bit UID (option '224' for 224 bit)` |`lf indala reader `|N |`Read an Indala tag from the antenna` @@ -1334,19 +1328,6 @@ Check column "offline" for their availability. |`nfc barcode help `|Y |`This help` -### piv - - { PIV commands... } - -|command |offline |description -|------- |------- |----------- -|`piv help `|Y |`This help` -|`piv select `|N |`Select the PIV applet` -|`piv getdata `|N |`Gets a container on a PIV card` -|`piv scan `|N |`Scan PIV card for known containers` -|`piv list `|Y |`List ISO7816 history` - - ### reveng { CRC calculations from RevEng software... } diff --git a/include/protocol_vigik.h b/include/protocol_vigik.h index a61c4ce03..7512c1c2d 100644 --- a/include/protocol_vigik.h +++ b/include/protocol_vigik.h @@ -42,4 +42,4 @@ typedef struct vigik_pk_s { const char *n; } vigik_pk_t; -#endif \ No newline at end of file +#endif diff --git a/include/protocols.h b/include/protocols.h index 8a00f064c..016584098 100644 --- a/include/protocols.h +++ b/include/protocols.h @@ -506,7 +506,7 @@ ISO 7816-4 Basic interindustry commands. For command APDU's. #define ISO7816_LC_TLV_CONFLICT 0x6A85 // LC / TLV conlict #define ISO7816_INCORRECT_P1P2 0x6A86 // Incorrect parameters (P1,P2) #define ISO7816_FILE_EXISTS 0x6A89 // File exists -#define ISO7816_NOT_IMPLEMENTED 0x6AFF // +#define ISO7816_NOT_IMPLEMENTED 0x6AFF // // 6x 00 #define ISO7816_WRONG_P1P2 0x6B00 // Incorrect parameters (P1,P2)