From 8387bdbdadf09a022612fdd85a4c6aff2806f044 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:23:02 +0100 Subject: [PATCH 1/6] change hint loglevel --- client/cmdlf.c | 4 ++-- client/cmdlfpyramid.c | 2 +- client/cmdlfti.c | 2 +- client/cmdlfverichip.c | 2 +- client/cmdlfviking.c | 2 +- client/cmdlfvisa2000.c | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/client/cmdlf.c b/client/cmdlf.c index 29854c6b6..31d10ce49 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -1189,7 +1189,7 @@ static bool CheckChipType(bool getDeviceData) { uint32_t word = 0; if (EM4x05IsBlock0(&word)) { PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("EM4x05/EM4x69")); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf em 4x05`") "commands"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf em 4x05`") "commands"); retval = true; goto out; } @@ -1197,7 +1197,7 @@ static bool CheckChipType(bool getDeviceData) { //check for t55xx chip... if (tryDetectP1(true)) { PrintAndLogEx(SUCCESS, "Chipset detection: " _GREEN_("T55xx")); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf t55xx`") "commands"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf t55xx`") "commands"); retval = true; } diff --git a/client/cmdlfpyramid.c b/client/cmdlfpyramid.c index 14357201a..91b2fb25e 100644 --- a/client/cmdlfpyramid.c +++ b/client/cmdlfpyramid.c @@ -252,7 +252,7 @@ static int CmdPyramidClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf pyramid read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf pyramid read`") "to verify"); return res; } diff --git a/client/cmdlfti.c b/client/cmdlfti.c index 8507fa36a..7aa04ca28 100644 --- a/client/cmdlfti.c +++ b/client/cmdlfti.c @@ -297,7 +297,7 @@ static int CmdTIWrite(const char *Cmd) { clearCommandBuffer(); SendCommandMIX(CMD_LF_TI_WRITE, arg0, arg1, arg2, NULL, 0); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf ti read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf ti read`") "to verify"); return PM3_SUCCESS; } diff --git a/client/cmdlfverichip.c b/client/cmdlfverichip.c index 91b49b8f4..a8cd68195 100644 --- a/client/cmdlfverichip.c +++ b/client/cmdlfverichip.c @@ -123,7 +123,7 @@ static int CmdVerichipClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf verichip read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf verichip read`") "to verify"); return res; } diff --git a/client/cmdlfviking.c b/client/cmdlfviking.c index 407c28f7e..e30234e5a 100644 --- a/client/cmdlfviking.c +++ b/client/cmdlfviking.c @@ -118,7 +118,7 @@ static int CmdVikingClone(const char *Cmd) { return PM3_ETIMEOUT; } PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf viking read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf viking read`") "to verify"); return resp.status; } diff --git a/client/cmdlfvisa2000.c b/client/cmdlfvisa2000.c index 1a628e51d..7293b5efc 100644 --- a/client/cmdlfvisa2000.c +++ b/client/cmdlfvisa2000.c @@ -186,7 +186,7 @@ static int CmdVisa2kClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf visa2000 read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf visa2000 read`") "to verify"); return res; } From 3e11d8d522c22ddcd8e8db2d11ba94bf7d032010 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:26:15 +0100 Subject: [PATCH 2/6] update hint loglevel --- client/cmdlfawid.c | 2 +- client/cmdlfem4x.c | 6 +++--- client/cmdlffdx.c | 2 +- client/cmdlfgallagher.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/cmdlfawid.c b/client/cmdlfawid.c index 9bcf9e874..468941022 100644 --- a/client/cmdlfawid.c +++ b/client/cmdlfawid.c @@ -424,7 +424,7 @@ static int CmdAWIDClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf awid read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf awid read`") "to verify"); return res; } diff --git a/client/cmdlfem4x.c b/client/cmdlfem4x.c index 02a86c2da..e759a4cf3 100644 --- a/client/cmdlfem4x.c +++ b/client/cmdlfem4x.c @@ -701,7 +701,7 @@ static int CmdEM410xWrite(const char *Cmd) { SendCommandMIX(CMD_LF_EM410X_WRITE, card, (uint32_t)(id >> 32), (uint32_t)id, NULL, 0); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf em 410x_read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf em 410x_read`") "to verify"); return PM3_SUCCESS; } @@ -1041,7 +1041,7 @@ static int CmdEM4x50Write(const char *Cmd) { PrintAndLogEx(NORMAL, "no implemented yet"); // // PrintAndLogEx(SUCCESS, "Done"); -// PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf em 4x50_read`") "to verify"); +// PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf em 4x50_read`") "to verify"); return PM3_SUCCESS; } @@ -1442,7 +1442,7 @@ static int CmdEM4x05Write(const char *Cmd) { PrintAndLogEx(SUCCESS, "Success writing to tag"); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf em 4x05_read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf em 4x05_read`") "to verify"); return status; } static int CmdEM4x05Wipe(const char *Cmd) { diff --git a/client/cmdlffdx.c b/client/cmdlffdx.c index 11ec2dd64..58f427a3d 100644 --- a/client/cmdlffdx.c +++ b/client/cmdlffdx.c @@ -303,7 +303,7 @@ static int CmdFdxClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf fdx read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf fdx read`") "to verify"); return res; } diff --git a/client/cmdlfgallagher.c b/client/cmdlfgallagher.c index e44682e2b..97a7e0e09 100644 --- a/client/cmdlfgallagher.c +++ b/client/cmdlfgallagher.c @@ -180,7 +180,7 @@ static int CmdGallagherClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf gallagher read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf gallagher read`") "to verify"); return res; } From 3cf06cf478e7860b88bec53408d14f76eef0469a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:27:43 +0100 Subject: [PATCH 3/6] update hint loglevel --- client/cmdlfguard.c | 2 +- client/cmdlfhid.c | 2 +- client/cmdlfindala.c | 10 ++++++++-- client/cmdlfio.c | 2 +- client/cmdlfkeri.c | 2 +- client/cmdlfmotorola.c | 2 +- client/cmdlfnedap.c | 2 +- 7 files changed, 14 insertions(+), 8 deletions(-) diff --git a/client/cmdlfguard.c b/client/cmdlfguard.c index ba9023c21..a1dbf0587 100644 --- a/client/cmdlfguard.c +++ b/client/cmdlfguard.c @@ -189,7 +189,7 @@ static int CmdGuardClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf gprox read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf gprox read`") "to verify"); return res; } diff --git a/client/cmdlfhid.c b/client/cmdlfhid.c index b5d449623..53af57ab7 100644 --- a/client/cmdlfhid.c +++ b/client/cmdlfhid.c @@ -348,7 +348,7 @@ static int CmdHIDClone(const char *Cmd) { clearCommandBuffer(); SendCommandMIX(CMD_LF_HID_CLONE, hi2, hi, lo, longid, sizeof(longid)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf hid read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf hid read`") "to verify"); return PM3_SUCCESS; } diff --git a/client/cmdlfindala.c b/client/cmdlfindala.c index 6da2aa8f2..e5651a3ad 100644 --- a/client/cmdlfindala.c +++ b/client/cmdlfindala.c @@ -246,7 +246,7 @@ static int CmdIndalaDemod(const char *Cmd) { checksum |= DemodBuffer[63] << 0; // b1 PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(SUCCESS, "Fmt 26 bit FC " _YELLOW_("%u") ", CN " _YELLOW_("%u") ", checksum %1d%1d" + PrintAndLogEx(SUCCESS, "Fmt 26 bit FC " _YELLOW_("%u") ", CN " _YELLOW_("%u") ", checksum " _YELLOW_("%1d%1d") , fc , csn , checksum >> 1 & 0x01 @@ -505,6 +505,7 @@ static int CmdIndalaSim(const char *Cmd) { uint8_t hexuid[100]; int len = 0; param_gethex_ex(Cmd, 0, hexuid, &len); + if (len > 28) return usage_lf_indala_sim(); @@ -670,7 +671,7 @@ static int CmdIndalaClone(const char *Cmd) { print_blocks(blocks, max); int res = clone_t55xx_tag(blocks, max); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf indala read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf indala read`") "to verify"); return res; } @@ -749,6 +750,11 @@ int getIndalaBits(uint8_t fc, uint16_t cn, uint8_t *bits) { bits[62] = 1; bits[63] = 0; } + + // add parity + bits[34] = 1; // p1 64 - 30 = 34 + bits[38] = 1; // p2 68 - 30 = 38 + // 92 = 62 // 93 = 63 diff --git a/client/cmdlfio.c b/client/cmdlfio.c index 994c69a7d..28c653ab4 100644 --- a/client/cmdlfio.c +++ b/client/cmdlfio.c @@ -277,7 +277,7 @@ static int CmdIOProxClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf io read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf io read`") "to verify"); return res; } diff --git a/client/cmdlfkeri.c b/client/cmdlfkeri.c index c698842a6..801307fd3 100644 --- a/client/cmdlfkeri.c +++ b/client/cmdlfkeri.c @@ -282,7 +282,7 @@ static int CmdKeriClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf keri read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf keri read`") "to verify"); return res; } diff --git a/client/cmdlfmotorola.c b/client/cmdlfmotorola.c index c34b48d8e..66427a49a 100644 --- a/client/cmdlfmotorola.c +++ b/client/cmdlfmotorola.c @@ -179,7 +179,7 @@ static int CmdMotorolaClone(const char *Cmd) { print_blocks(blocks, ARRAYLEN(blocks)); int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf motorola read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf motorola read`") "to verify"); return res; } diff --git a/client/cmdlfnedap.c b/client/cmdlfnedap.c index a1d23cd91..5ac4e07fa 100644 --- a/client/cmdlfnedap.c +++ b/client/cmdlfnedap.c @@ -476,7 +476,7 @@ static int CmdLFNedapClone(const char *Cmd) { PrintAndLogEx(NORMAL, ""); } PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf nedap read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf nedap read`") "to verify"); return res; } From 3f8157387871fc11378d070673fe54dab0591d77 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:28:39 +0100 Subject: [PATCH 4/6] update hint loglevel --- client/cmdlfnexwatch.c | 2 +- client/cmdlfnoralsy.c | 2 +- client/cmdlfpac.c | 2 +- client/cmdlfparadox.c | 2 +- client/cmdlfpcf7931.c | 2 +- client/cmdlfpresco.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/cmdlfnexwatch.c b/client/cmdlfnexwatch.c index d288eeadc..5e3801118 100644 --- a/client/cmdlfnexwatch.c +++ b/client/cmdlfnexwatch.c @@ -160,7 +160,7 @@ static int CmdNexWatchClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf nexwatch read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf nexwatch read`") "to verify"); return res; } diff --git a/client/cmdlfnoralsy.c b/client/cmdlfnoralsy.c index bbb7de0c9..dc8fb4df0 100644 --- a/client/cmdlfnoralsy.c +++ b/client/cmdlfnoralsy.c @@ -171,7 +171,7 @@ static int CmdNoralsyClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf noralsy read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf noralsy read`") "to verify"); return res; } diff --git a/client/cmdlfpac.c b/client/cmdlfpac.c index 9ac9aa511..c633ccc1a 100644 --- a/client/cmdlfpac.c +++ b/client/cmdlfpac.c @@ -241,7 +241,7 @@ static int CmdPacClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf pac read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf pac read`") "to verify"); return res; } diff --git a/client/cmdlfparadox.c b/client/cmdlfparadox.c index c540290f8..8422f0f6f 100644 --- a/client/cmdlfparadox.c +++ b/client/cmdlfparadox.c @@ -171,7 +171,7 @@ static int CmdParadoxClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf paradox read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf paradox read`") "to verify"); return res; } diff --git a/client/cmdlfpcf7931.c b/client/cmdlfpcf7931.c index ddcad195d..c37fc9470 100644 --- a/client/cmdlfpcf7931.c +++ b/client/cmdlfpcf7931.c @@ -151,7 +151,7 @@ static int CmdLFPCF7931Write(const char *Cmd) { SendCommandMIX(CMD_LF_PCF7931_WRITE, block, bytepos, data, buf, sizeof(buf)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf pcf7931 read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf pcf7931 read`") "to verify"); return PM3_SUCCESS; } diff --git a/client/cmdlfpresco.c b/client/cmdlfpresco.c index 9f00dbdce..fe4f3dd1c 100644 --- a/client/cmdlfpresco.c +++ b/client/cmdlfpresco.c @@ -138,7 +138,7 @@ static int CmdPrescoClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf presco read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf presco read`") "to verify"); return res; } From fb3f4ecd361fe09a9b20d976812b8d995ea4d933 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:29:00 +0100 Subject: [PATCH 5/6] update hint loglevel --- client/cmdlfsecurakey.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/cmdlfsecurakey.c b/client/cmdlfsecurakey.c index 0061d56c4..643ab980d 100644 --- a/client/cmdlfsecurakey.c +++ b/client/cmdlfsecurakey.c @@ -170,7 +170,7 @@ static int CmdSecurakeyClone(const char *Cmd) { int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); PrintAndLogEx(SUCCESS, "Done"); - PrintAndLogEx(INFO, "Hint: try " _YELLOW_("`lf securakey read`") "to verify"); + PrintAndLogEx(HINT, "Hint: try " _YELLOW_("`lf securakey read`") "to verify"); return res; } From e5b38c46c60dd199f1b923f5f835358bbad1597d Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Sun, 15 Mar 2020 13:48:50 +0100 Subject: [PATCH 6/6] chg: hints - allow ON/OFF --- client/cmdmain.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/client/cmdmain.c b/client/cmdmain.c index d9cbbac74..57cd4d10a 100644 --- a/client/cmdmain.c +++ b/client/cmdmain.c @@ -194,20 +194,31 @@ int CmdRem(const char *Cmd) { static int CmdHints(const char *Cmd) { uint32_t ms = 0; char ctmp = tolower(param_getchar(Cmd, 0)); - if (ctmp == 'h') return usage_hints(); + if (ctmp == 'h') return usage_hints(); if (strlen(Cmd) < 1) { PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF"); return PM3_SUCCESS; } - if (param_getchar(Cmd, 0) != 0x00) { - ms = param_get32ex(Cmd, 0, 0, 10); - if (ms == 0) + if (strlen(Cmd) > 1){ + str_lower((char *)Cmd); + if (str_startswith(Cmd, "of")) { g_showhints = false; - else - g_showhints = true; + } else { + g_showhints = true; + } + } else { + if (param_getchar(Cmd, 0) != 0x00) { + ms = param_get32ex(Cmd, 0, 0, 10); + if (ms == 0) { + g_showhints = false; + } else { + g_showhints = true; + } + } } + PrintAndLogEx(INFO, "Hints are %s", (g_showhints) ? "ON" : "OFF"); return PM3_SUCCESS; }