From 3f977043bdb6417c0f06a122dd7786e9470d20a9 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 8 Oct 2020 20:32:45 +0200 Subject: [PATCH] lf hid clone - textual --- client/src/cmdlfhid.c | 11 ++++++----- client/src/wiegand_formats.c | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/client/src/cmdlfhid.c b/client/src/cmdlfhid.c index bd04ba6e7..1432ce673 100644 --- a/client/src/cmdlfhid.c +++ b/client/src/cmdlfhid.c @@ -298,9 +298,6 @@ static int CmdHIDClone(const char *Cmd) { int raw_len = 0; char raw[40] = {0}; CLIParamStrToBuf(arg_get_str(ctx, 6), (uint8_t *)raw, sizeof(raw), &raw_len); - if (raw_len > 0) { - PrintAndLogEx(INFO, "RAW %s", raw); - } //bool q5 = arg_get_lit(ctx, 7); CLIParserFree(ctx); @@ -328,8 +325,12 @@ static int CmdHIDClone(const char *Cmd) { } } - PrintAndLogEx(INFO, "Preparing to clone HID tag"); - HIDTryUnpack(&packed, false); + if (raw_len == 0) { + PrintAndLogEx(INFO, "Preparing to clone HID tag"); + HIDTryUnpack(&packed, false); + } else { + PrintAndLogEx(INFO, "Preparing to clone HID tag using raw " _YELLOW_("%s"), raw); + } lf_hidsim_t payload; payload.hi2 = packed.Top; diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index 2d62d4cdb..22434862e 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -708,7 +708,7 @@ bool HIDTryUnpack(wiegand_message_t *packed, bool ignore_parity) { } ++i; } - if (result == false) { + if (result == false && packed->Length) { PrintAndLogEx(SUCCESS, "Unknown. Bit len %d", packed->Length); }