]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/appmain.c
lf hid improvements - encoding and long tag simulation
[proxmark3-svn] / armsrc / appmain.c
index 27f43b3fae505453b51ff5f5de721c2e3de51af2..48620d71368259578e8820c43a18678c6fda42b0 100644 (file)
 #ifdef WITH_LCD
  #include "LCD.h"
 #endif
+#ifdef WITH_SMARTCARD
+ #include "i2c.h"
+#endif
+
 
 // Craig Young - 14a stand-alone code
 #ifdef WITH_ISO14443a
@@ -357,12 +361,15 @@ void SendStatus(void)
 {
        BigBuf_print_status();
        Fpga_print_status();
+#ifdef WITH_SMARTCARD
+       I2C_print_status();
+#endif
        printConfig(); //LF Sampling config
        printUSBSpeed();
        Dbprintf("Various");
-       Dbprintf("  MF_DBGLEVEL......%d", MF_DBGLEVEL);
-       Dbprintf("  ToSendMax........%d",ToSendMax);
-       Dbprintf("  ToSendBit........%d",ToSendBit);
+       Dbprintf("  MF_DBGLEVEL........%d", MF_DBGLEVEL);
+       Dbprintf("  ToSendMax..........%d", ToSendMax);
+       Dbprintf("  ToSendBit..........%d", ToSendBit);
 
        cmd_send(CMD_ACK,1,0,0,0,0);
 }
@@ -940,10 +947,10 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        cmd_send(CMD_ACK,SnoopLF(),0,0,0,0);
                        break;
                case CMD_HID_DEMOD_FSK:
-                       CmdHIDdemodFSK(c->arg[0], 0, 0, 1);
+                       CmdHIDdemodFSK(c->arg[0], 0, 0, 0, 1);
                        break;
                case CMD_HID_SIM_TAG:
-                       CmdHIDsimTAG(c->arg[0], c->arg[1], 1);
+                       CmdHIDsimTAG(c->arg[0], c->arg[1], c->arg[2], 1);
                        break;
                case CMD_FSK_SIM_TAG:
                        CmdFSKsimTAG(c->arg[0], c->arg[1], c->arg[2], c->d.asBytes);
@@ -1253,6 +1260,31 @@ void UsbPacketReceived(uint8_t *packet, int len)
                        HfSnoop(c->arg[0], c->arg[1]);
                        break;
 #endif
+#ifdef WITH_SMARTCARD
+               case CMD_SMART_ATR: {
+                       SmartCardAtr();
+                       break;
+               }
+               case CMD_SMART_SETCLOCK:{
+                       SmartCardSetClock(c->arg[0]);
+                       break;
+               }
+               case CMD_SMART_RAW: {
+                       SmartCardRaw(c->arg[0], c->arg[1], c->d.asBytes);
+                       break;
+               }
+               case CMD_SMART_UPLOAD: {
+                       // upload file from client
+                       uint8_t *mem = BigBuf_get_addr();
+                       memcpy( mem + c->arg[0], c->d.asBytes, USB_CMD_DATA_SIZE);
+                       cmd_send(CMD_ACK,1,0,0,0,0);
+                       break;
+               }
+               case CMD_SMART_UPGRADE: {
+                       SmartCardUpgrade(c->arg[0]);
+                       break;
+               }
+#endif
 
                case CMD_BUFF_CLEAR:
                        BigBuf_Clear();
Impressum, Datenschutz