From 290eddddc6bd53f6eea216721e99182c5ca11775 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Fri, 28 Aug 2020 11:14:42 +0200 Subject: [PATCH] textual Q5 --- client/src/cmdlffdx.c | 11 ++++++----- client/src/cmdlfguard.c | 18 ++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/client/src/cmdlffdx.c b/client/src/cmdlffdx.c index b30d673ef..868a567c5 100644 --- a/client/src/cmdlffdx.c +++ b/client/src/cmdlffdx.c @@ -49,7 +49,7 @@ static int CmdHelp(const char *Cmd); static int usage_lf_fdx_clone(void) { - PrintAndLogEx(NORMAL, "Clone a FDX-B animal tag to a T55x7 tag."); + PrintAndLogEx(NORMAL, "Clone a FDX-B animal tag to a T55x7 or Q5/T5555 tag."); PrintAndLogEx(NORMAL, "Usage: lf fdx clone [h] "); PrintAndLogEx(NORMAL, "Options:"); PrintAndLogEx(NORMAL, " h : This help"); @@ -58,7 +58,7 @@ static int usage_lf_fdx_clone(void) { PrintAndLogEx(NORMAL, " : Extended data"); //reserved/rfu //is animal tag - 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 fdx clone 999 112233")); @@ -321,7 +321,8 @@ static int CmdFdxClone(const char *Cmd) { uint32_t blocks[5] = {T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_32 | 4 << T55x7_MAXBLOCK_SHIFT, 0, 0, 0, 0}; //Q5 - if (tolower(param_getchar(Cmd, 2)) == 'q') + bool q5 = tolower(param_getchar(Cmd, 2)) == 'q'; + if (q5) blocks[0] = T5555_FIXED | T5555_MODULATION_BIPHASE | T5555_INVERT_OUTPUT | T5555_SET_BITRATE(32) | 4 << T5555_MAXBLOCK_SHIFT; // convert from bit stream to block data @@ -332,7 +333,7 @@ static int CmdFdxClone(const char *Cmd) { free(bits); - PrintAndLogEx(INFO, "Preparing to clone FDX-B to T55x7 with animal ID: " _GREEN_("%04u-%"PRIu64)" (extended 0x%X)", countryid, animalid, extended); + PrintAndLogEx(INFO, "Preparing to clone FDX-B to " _YELLOW_("%s") " with animal ID: " _GREEN_("%04u-%"PRIu64)" (extended 0x%X)", (q5) ? "Q5/T5555" : "T55x7", countryid, animalid, extended); print_blocks(blocks, ARRAYLEN(blocks)); int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); @@ -393,7 +394,7 @@ static command_t CommandTable[] = { {"help", CmdHelp, AlwaysAvailable, "this help"}, {"demod", CmdFdxDemod, AlwaysAvailable, "demodulate a FDX-B ISO11784/85 tag from the GraphBuffer"}, {"read", CmdFdxRead, IfPm3Lf, "attempt to read and extract tag data"}, - {"clone", CmdFdxClone, IfPm3Lf, "clone animal ID tag to T55x7 (or to q5/T5555)"}, + {"clone", CmdFdxClone, IfPm3Lf, "clone animal ID tag to T55x7 or Q5/T5555"}, {"sim", CmdFdxSim, IfPm3Lf, "simulate Animal ID tag"}, {NULL, NULL, NULL, NULL} }; diff --git a/client/src/cmdlfguard.c b/client/src/cmdlfguard.c index 64573a03c..12d39ac71 100644 --- a/client/src/cmdlfguard.c +++ b/client/src/cmdlfguard.c @@ -27,15 +27,16 @@ static int CmdHelp(const char *Cmd); static int usage_lf_guard_clone(void) { - PrintAndLogEx(NORMAL, "clone a Guardall tag to a T55x7 tag."); + PrintAndLogEx(NORMAL, "clone a Guardall tag to a T55x7 or Q5/T5555 tag."); PrintAndLogEx(NORMAL, "The facility-code is 8-bit and the card number is 16-bit. Larger values are truncated. "); PrintAndLogEx(NORMAL, "Currently work only on 26bit"); PrintAndLogEx(NORMAL, ""); - PrintAndLogEx(NORMAL, "Usage: lf gprox clone [h] "); + PrintAndLogEx(NORMAL, "Usage: lf gprox clone [h] "); PrintAndLogEx(NORMAL, "Options:"); - PrintAndLogEx(NORMAL, " : format length 26|32|36|40"); - PrintAndLogEx(NORMAL, " : 8-bit value facility code"); - PrintAndLogEx(NORMAL, " : 16-bit value card number"); + PrintAndLogEx(NORMAL, " : format length 26|32|36|40"); + PrintAndLogEx(NORMAL, " : 8-bit value facility code"); + PrintAndLogEx(NORMAL, " : 16-bit value card number"); + PrintAndLogEx(NORMAL, " : Specify writing to Q5/T5555 tag"); PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "Examples:"); PrintAndLogEx(NORMAL, _YELLOW_(" lf gprox clone 26 123 11223")); @@ -175,7 +176,8 @@ static int CmdGuardClone(const char *Cmd) { } // Q5 - if (tolower(param_getchar(Cmd, 3)) == 'q') + bool q5 = tolower(param_getchar(Cmd, 3)) == 'q'; + if (q5) blocks[0] = T5555_FIXED | T5555_MODULATION_FSK2 | T5555_SET_BITRATE(50) | 3 << T5555_MAXBLOCK_SHIFT; blocks[1] = bytebits_to_byte(bs, 32); @@ -184,7 +186,7 @@ static int CmdGuardClone(const char *Cmd) { free(bs); - PrintAndLogEx(INFO, "Preparing to clone Guardall to T55x7 with Facility Code: %u, Card Number: %u", facilitycode, cardnumber); + PrintAndLogEx(INFO, "Preparing to clone Guardall to " _YELLOW_("%s") " with Facility Code: %u, Card Number: %u", (q5) ? "Q5/T5555" : "T55x7", facilitycode, cardnumber); print_blocks(blocks, ARRAYLEN(blocks)); int res = clone_t55xx_tag(blocks, ARRAYLEN(blocks)); @@ -241,7 +243,7 @@ static command_t CommandTable[] = { {"help", CmdHelp, AlwaysAvailable, "this help"}, {"demod", CmdGuardDemod, AlwaysAvailable, "demodulate a G Prox II tag from the GraphBuffer"}, {"read", CmdGuardRead, IfPm3Lf, "attempt to read and extract tag data from the antenna"}, - {"clone", CmdGuardClone, IfPm3Lf, "clone Guardall tag to T55x7"}, + {"clone", CmdGuardClone, IfPm3Lf, "clone Guardall tag to T55x7 or Q5/T5555"}, {"sim", CmdGuardSim, IfPm3Lf, "simulate Guardall tag"}, {NULL, NULL, NULL, NULL} };