X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/b62b5e2527e36cdbfda2e3d2a7ce8a46e45969e1..deb965b54df637e3170ef365ea7d87443bd72bee:/client/cmdlfio.c?ds=sidebyside diff --git a/client/cmdlfio.c b/client/cmdlfio.c index c71928ec..feb7d373 100644 --- a/client/cmdlfio.c +++ b/client/cmdlfio.c @@ -8,14 +8,14 @@ // FSK2a, rf/64, 64 bits (complete) //----------------------------------------------------------------------------- +#include "cmdlfio.h" + #include #include #include #include #include -#include "cmdlfio.h" -#include "proxmark3.h" -#include "data.h" +#include "comms.h" #include "graph.h" #include "ui.h" #include "cmdparser.h" @@ -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;