]>
git.zerfleddert.de Git - proxmark3-svn/blob - client/cmdlfio.c
11 #include "cmdparser.h"
16 static int CmdHelp(const char *Cmd
);
18 int CmdIODemodFSK(const char *Cmd
)
20 UsbCommand c
={CMD_IO_DEMOD_FSK
};
26 int CmdIOProxDemod(const char *Cmd
){
27 if (GraphTraceLen
< 4800) {
28 PrintAndLog("too short; need at least 4800 samples");
33 for (int i
= 0; i
< GraphTraceLen
; ++i
) {
34 if (GraphBuffer
[i
] < 0) {
44 int CmdIOClone(const char *Cmd
)
46 unsigned int hi
= 0, lo
= 0;
51 //if (1 == sscanf(str, "0x%"SCNx32, &hi)) {
52 // value now contains the value in the string--decimal 255, in this case.
55 while (sscanf(&Cmd
[i
++], "%1x", &n
) == 1) {
56 hi
= (hi
<< 4) | (lo
>> 28);
57 lo
= (lo
<< 4) | (n
& 0xf);
60 PrintAndLog("Cloning tag with ID %08x %08x", hi
, lo
);
62 c
.cmd
= CMD_IO_CLONE_TAG
;
70 static command_t CommandTable
[] =
72 {"help", CmdHelp
, 1, "This help"},
73 {"demod", CmdIOProxDemod
, 1, "Demodulate Stream"},
74 {"fskdemod", CmdIODemodFSK
, 1, "Demodulate ioProx Tag"},
75 {"clone", CmdIOClone
, 1, "Clone ioProx Tag"},
79 int CmdLFIO(const char *Cmd
)
81 CmdsParse(CommandTable
, Cmd
);
85 int CmdHelp(const char *Cmd
)
87 CmdsHelp(CommandTable
);