]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhf14a.c
added util.h include to avoid implicit function declaration
[proxmark3-svn] / client / cmdhf14a.c
index cf7570dd41e76a6c641f7d3726a5adc0e481ca4a..5937fcad9adf1fb0c3ce18f42783ac22c6f33114 100644 (file)
@@ -284,9 +284,26 @@ int CmdHF14ASim(const char *Cmd)
   return 0;
 }
 
-int CmdHF14ASnoop(const char *Cmd)
-{
-  UsbCommand c = {CMD_SNOOP_ISO_14443a};
+int CmdHF14ASnoop(const char *Cmd) {
+       int param = 0;
+       
+       if (param_getchar(Cmd, 0) == 'h') {
+               PrintAndLog("It get data from the field and saves it into command buffer.");
+               PrintAndLog("Buffer accessible from command hf 14a list.");
+               PrintAndLog("Usage:  hf 14a snoop [c][r]");
+               PrintAndLog("c - triggered by first data from card");
+               PrintAndLog("r - triggered by first 7-bit request from reader (REQ,WUP,...)");
+               PrintAndLog("sample: hf 14a snoop c r");
+               return 0;
+       }       
+       
+       for (int i = 0; i < 2; i++) {
+               char ctmp = param_getchar(Cmd, i);
+               if (ctmp == 'c' || ctmp == 'C') param |= 0x01;
+               if (ctmp == 'r' || ctmp == 'R') param |= 0x02;
+       }
+
+  UsbCommand c = {CMD_SNOOP_ISO_14443a, {param, 0, 0}};
   SendCommand(&c);
   return 0;
 }
Impressum, Datenschutz