]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/cmdlfio.c
10 #include "cmdparser.h"
15 static int CmdHelp(const char *Cmd
);
17 int CmdIODemodFSK(const char *Cmd
)
19 UsbCommand c
={CMD_IO_DEMOD_FSK
};
24 int CmdIOProxDemod(const char *Cmd
){
25 if (GraphTraceLen
< 4800) {
26 PrintAndLog("too short; need at least 4800 samples");
30 for (int i
= 0; i
< GraphTraceLen
; ++i
) {
31 GraphBuffer
[i
] = (GraphBuffer
[i
] < 0) ? 0 : 1;
37 int CmdIOClone(const char *Cmd
)
39 unsigned int hi
= 0, lo
= 0;
44 //if (1 == sscanf(str, "0x%"SCNx32, &hi)) {
45 // value now contains the value in the string--decimal 255, in this case.
48 while (sscanf(&Cmd
[i
++], "%1x", &n
) == 1) {
49 hi
= (hi
<< 4) | (lo
>> 28);
50 lo
= (lo
<< 4) | (n
& 0xf);
53 PrintAndLog("Cloning tag with ID %08x %08x", hi
, lo
);
55 c
.cmd
= CMD_IO_CLONE_TAG
;
63 static command_t CommandTable
[] =
65 {"help", CmdHelp
, 1, "This help"},
66 {"demod", CmdIOProxDemod
, 1, "Demodulate Stream"},
67 {"fskdemod", CmdIODemodFSK
, 1, "Demodulate ioProx Tag"},
68 {"clone", CmdIOClone
, 1, "Clone ioProx Tag"},
72 int CmdLFIO(const char *Cmd
)
74 CmdsParse(CommandTable
, Cmd
);
78 int CmdHelp(const char *Cmd
)
80 CmdsHelp(CommandTable
);