]>
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
)
20 if(Cmd
[0]=='1') findone
=1;
22 UsbCommand c
={CMD_IO_DEMOD_FSK
};
28 int CmdIOProxDemod(const char *Cmd){
29 if (GraphTraceLen < 4800) {
30 PrintAndLog("too short; need at least 4800 samples");
34 for (int i = 0; i < GraphTraceLen; ++i) {
35 GraphBuffer[i] = (GraphBuffer[i] < 0) ? 0 : 1;
41 int CmdIOClone(const char *Cmd
)
43 unsigned int hi
= 0, lo
= 0;
48 //if (1 == sscanf(str, "0x%"SCNx32, &hi)) {
49 // value now contains the value in the string--decimal 255, in this case.
52 while (sscanf(&Cmd
[i
++], "%1x", &n
) == 1) {
53 hi
= (hi
<< 4) | (lo
>> 28);
54 lo
= (lo
<< 4) | (n
& 0xf);
57 PrintAndLog("Cloning tag with ID %08x %08x", hi
, lo
);
58 PrintAndLog("Press pm3-button to abort simulation");
59 c
.cmd
= CMD_IO_CLONE_TAG
;
67 static command_t CommandTable
[] =
69 {"help", CmdHelp
, 1, "This help"},
70 //{"demod", CmdIOProxDemod, 1, "Demodulate Stream"},
71 {"fskdemod", CmdIODemodFSK
, 0, "['1'] Realtime IO FSK demodulator (option '1' for one tag only)"},
72 {"clone", CmdIOClone
, 0, "Clone ioProx Tag"},
76 int CmdLFIO(const char *Cmd
)
78 CmdsParse(CommandTable
, Cmd
);
82 int CmdHelp(const char *Cmd
)
84 CmdsHelp(CommandTable
);