]>
git.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
};
25 int CmdIOProxDemod(const char *Cmd
){
26 if (GraphTraceLen
< 4800) {
27 PrintAndLog("too short; need at least 4800 samples");
32 for (int i
= 0; i
< GraphTraceLen
; ++i
) {
33 if (GraphBuffer
[i
] < 0) {
43 int CmdIOClone(const char *Cmd
)
45 unsigned int hi
= 0, lo
= 0;
50 //if (1 == sscanf(str, "0x%"SCNx32, &hi)) {
51 // value now contains the value in the string--decimal 255, in this case.
54 while (sscanf(&Cmd
[i
++], "%1x", &n
) == 1) {
55 hi
= (hi
<< 4) | (lo
>> 28);
56 lo
= (lo
<< 4) | (n
& 0xf);
59 PrintAndLog("Cloning tag with ID %08x %08x", hi
, lo
);
61 c
.cmd
= CMD_IO_CLONE_TAG
;
69 static command_t CommandTable
[] =
71 {"help", CmdHelp
, 1, "This help"},
72 {"demod", CmdIOProxDemod
, 1, "Demodulate Stream"},
73 {"fskdemod", CmdIODemodFSK
, 1, "Demodulate ioProx Tag"},
74 {"clone", CmdIOClone
, 1, "Clone ioProx Tag"},
78 int CmdLFIO(const char *Cmd
)
80 CmdsParse(CommandTable
, Cmd
);
84 int CmdHelp(const char *Cmd
)
86 CmdsHelp(CommandTable
);