From: pwpiwi Date: Thu, 13 Jul 2017 16:12:53 +0000 (+0200) Subject: fix lf io clone (issue #331): X-Git-Tag: v3.1.0~186^2 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/edf8806f154a5015c2498253f7be07ebb088d84d?hp=067bfc8b762f86d5ebb65ecca9e1ba3a304ecd84 fix lf io clone (issue #331): - remove confusing message about simulation - add h (help) parameter and usage text --- diff --git a/client/cmdlfio.c b/client/cmdlfio.c index c71928ec..4ccd5538 100644 --- a/client/cmdlfio.c +++ b/client/cmdlfio.c @@ -133,20 +133,21 @@ int CmdIOClone(const char *Cmd) { unsigned int hi = 0, lo = 0; int n = 0, i = 0; + char ch; UsbCommand c; - - //if (1 == sscanf(str, "0x%"SCNx32, &hi)) { - // value now contains the value in the string--decimal 255, in this case. - //} - while (sscanf(&Cmd[i++], "%1x", &n ) == 1) { hi = (hi << 4) | (lo >> 28); lo = (lo << 4) | (n & 0xf); } - PrintAndLog("Cloning tag with ID %08x %08x", hi, lo); - PrintAndLog("Press pm3-button to abort simulation"); + if (sscanf(&Cmd[--i], "%c", &ch) == 1) { + PrintAndLog("Usage: lf io clone "); + return 0; + } + + PrintAndLog("Cloning ioProx tag with ID %08x %08x", hi, lo); + c.cmd = CMD_IO_CLONE_TAG; c.arg[0] = hi; c.arg[1] = lo;