From e182e805575b41a6f30a93eb77170ef8121ab2c9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 28 Aug 2020 11:27:53 +0200 Subject: [PATCH] textual Q5 --- client/src/cmdlfjablotron.c | 11 ++++++----- client/src/cmdlfkeri.c | 12 +++++------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/client/src/cmdlfjablotron.c b/client/src/cmdlfjablotron.c index 415e3e9af..a831436e2 100644 --- a/client/src/cmdlfjablotron.c +++ b/client/src/cmdlfjablotron.c @@ -30,12 +30,12 @@ static int CmdHelp(const char *Cmd); static int usage_lf_jablotron_clone(void) { - PrintAndLogEx(NORMAL, "clone a Jablotron tag to a T55x7 tag."); + PrintAndLogEx(NORMAL, "clone a Jablotron tag to a T55x7 or Q5/T5555 tag."); PrintAndLogEx(NORMAL, "Usage: lf jablotron clone [h] "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h : This help"); PrintAndLogEx(NORMAL, " : jablotron card ID"); - PrintAndLogEx(NORMAL, " : specify write to Q5 (t5555 instead of t55x7)"); + PrintAndLogEx(NORMAL, " : specify writing to Q5/T5555 tag"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, _YELLOW_(" lf jablotron clone 112233")); @@ -153,7 +153,8 @@ static int CmdJablotronClone(const char *Cmd) { fullcode = param_get64ex(Cmd, 0, 0, 16); //Q5 - if (tolower(param_getchar(Cmd, 1)) == 'q') + bool q5 = tolower(param_getchar(Cmd, 1)) == 'q'; + if (q5) blocks[0] = T5555_FIXED | T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | T5555_SET_BITRATE(64) | 2 << T5555_MAXBLOCK_SHIFT; // clearing the topbit needed for the preambl detection. @@ -178,7 +179,7 @@ static int CmdJablotronClone(const char *Cmd) { free(bits); - PrintAndLogEx(INFO, "Preparing to clone Jablotron to T55x7 with FullCode: %"PRIx64, fullcode); + PrintAndLogEx(INFO, "Preparing to clone Jablotron to " _YELLOW_("%s") " with FullCode: %"PRIx64, (q5) ? "Q5/T5555" : "T55x7", fullcode); print_blocks(blocks, ARRAYLEN(blocks)); return clone_t55xx_tag(blocks, ARRAYLEN(blocks)); @@ -234,7 +235,7 @@ static command_t CommandTable[] = { {"help", CmdHelp, AlwaysAvailable, "This help"}, {"demod", CmdJablotronDemod, AlwaysAvailable, "Demodulate an Jablotron tag from the GraphBuffer"}, {"read", CmdJablotronRead, IfPm3Lf, "Attempt to read and extract tag data from the antenna"}, - {"clone", CmdJablotronClone, IfPm3Lf, "clone jablotron tag to T55x7 (or to q5/T5555)"}, + {"clone", CmdJablotronClone, IfPm3Lf, "clone jablotron tag to T55x7 or Q5/T5555"}, {"sim", CmdJablotronSim, IfPm3Lf, "simulate jablotron tag"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/cmdlfkeri.c b/client/src/cmdlfkeri.c index 91ff23f49..0d4c6e8b8 100644 --- a/client/src/cmdlfkeri.c +++ b/client/src/cmdlfkeri.c @@ -28,13 +28,13 @@ static int CmdHelp(const char *Cmd); static int usage_lf_keri_clone(void) { - PrintAndLogEx(NORMAL, "clone a KERI tag to a T55x7 / T5555 (Q5) tag\n"); + PrintAndLogEx(NORMAL, "clone a KERI tag to a T55x7 or Q5/T5555 tag\n"); PrintAndLogEx(NORMAL, "Usage: lf keri clone [h] "); - PrintAndLogEx(NORMAL, "Usage extended: lf keri clone [h] t [f ] [c ] [Q5]"); + PrintAndLogEx(NORMAL, "Usage extended: lf keri clone [h] t [f ] [c ] "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h : This help"); PrintAndLogEx(NORMAL, " : Keri Internal ID"); - PrintAndLogEx(NORMAL, " : specify write to Q5 (t5555 instead of t55x7)"); + PrintAndLogEx(NORMAL, " : specify writing to Q5/T5555 tag"); // New format PrintAndLogEx(NORMAL, " [m|i] : Type m - MS, i - Internal ID"); PrintAndLogEx(NORMAL, " : Facility Code"); @@ -212,8 +212,6 @@ int demodKeri(void) { return PM3_SUCCESS; } - - static int CmdKeriRead(const char *Cmd) { lf_read(false, 10000); return CmdKeriDemod(Cmd); @@ -288,7 +286,7 @@ static int CmdKeriClone(const char *Cmd) { // Prepare and write to card // 3 LSB is ONE uint64_t data = ((uint64_t)internalid << 3) + 7; - PrintAndLogEx(INFO, "Preparing to clone KERI to " _YELLOW_("%s") " with Internal Id " _YELLOW_("%" PRIx32), (q5) ? "T5555/Q5" : "T55x77",internalid); + PrintAndLogEx(INFO, "Preparing to clone KERI to " _YELLOW_("%s") " with Internal Id " _YELLOW_("%" PRIx32), (q5) ? "Q5/T5555" : "T55x7",internalid); blocks[1] = data >> 32; blocks[2] = data & 0xFFFFFFFF; @@ -346,7 +344,7 @@ static command_t CommandTable[] = { {"help", CmdHelp, AlwaysAvailable, "This help"}, {"demod", CmdKeriDemod, AlwaysAvailable, "Demodulate an KERI tag from the GraphBuffer"}, {"read", CmdKeriRead, IfPm3Lf, "Attempt to read and extract tag data from the antenna"}, - {"clone", CmdKeriClone, IfPm3Lf, "clone KERI tag to T55x7 (or to q5/T5555)"}, + {"clone", CmdKeriClone, IfPm3Lf, "clone KERI tag to T55x7 or Q5/T5555"}, {"sim", CmdKeriSim, IfPm3Lf, "simulate KERI tag"}, {NULL, NULL, NULL, NULL} };