]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
code cleaning (#445)
authorOleg Moiseenko <olegmsn@gmail.com>
Thu, 26 Oct 2017 17:09:53 +0000 (20:09 +0300)
committerpwpiwi <pwpiwi@users.noreply.github.com>
Thu, 26 Oct 2017 17:09:53 +0000 (19:09 +0200)
armsrc/mifarecmd.c
client/cmdhf14a.c
client/mifarehost.c

index 39029d4e3429dcc2e4202aaf80e21477a99d4c84..00fd638c4daf7743a0be32669426e77acec81923 100644 (file)
@@ -1514,8 +1514,6 @@ void MifareCIdent(){
        LED_A_ON();\r
        LED_B_OFF();\r
        LED_C_OFF();\r
-//     FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
-//     SpinDelay(100);\r
        iso14443a_setup(FPGA_HF_ISO14443A_READER_LISTEN);\r
 \r
        clear_trace();\r
index db9ce46e4b65bea1544dfbe8a1a3b54e71e7329b..e3f1a5f17cf7d4cf7a2546149f62507a289899b0 100644 (file)
@@ -405,27 +405,8 @@ int CmdHF14AReader(const char *Cmd)
 
        
        // try to see if card responses to "chinese magic backdoor" commands.
-       c.cmd = CMD_MIFARE_CIDENT;
-       c.arg[0] = 0;
-       c.arg[1] = 0;
-       c.arg[2] = 0;   
-       SendCommand(&c);
-       WaitForResponse(CMD_ACK,&resp);
-       
-       uint8_t isGeneration = resp.arg[0] & 0xff;
-       switch( isGeneration ){
-               case 1: PrintAndLog("Answers to chinese magic backdoor commands (GEN 1a): YES"); break;
-               case 2: PrintAndLog("Answers to chinese magic backdoor commands (GEN 1b): YES"); break;
-               default: PrintAndLog("Answers to chinese magic backdoor commands: NO"); break;
-       }
+       mfCIdentify();
        
-       // disconnect
-       c.cmd = CMD_READER_ISO_14443a;
-       c.arg[0] = 0;
-       c.arg[1] = 0;
-       c.arg[2] = 0;
-       SendCommand(&c);
-
        return select_status;
 }
 
index ca5d97e13ac1419cbfcac1598ab35d643a9166c7..fe1a8edbab7b15b360285cf2d2713ad39881ccad 100644 (file)
@@ -540,35 +540,10 @@ int mfCSetUID(uint8_t *uid, uint8_t *atqa, uint8_t *sak, uint8_t *oldUID) {
        return 0;\r
 }\r
 \r
-int mfCIdentify()\r
-{\r
-  UsbCommand c;\r
-//     UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_DISCONNECT, 0, 0}};\r
-//     SendCommand(&c);\r
-\r
-  UsbCommand resp;\r
-//     WaitForResponse(CMD_ACK,&resp);\r
-\r
-       // iso14a_card_select_t card;\r
-       // memcpy(&card, (iso14a_card_select_t *)resp.d.asBytes, sizeof(iso14a_card_select_t));\r
-\r
-       // uint64_t select_status = resp.arg[0];                // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision\r
-\r
-       // if(select_status != 0) {\r
-               // uint8_t rats[] = { 0xE0, 0x80 }; // FSDI=8 (FSD=256), CID=0\r
-               // c.arg[0] = ISO14A_RAW | ISO14A_APPEND_CRC | ISO14A_NO_DISCONNECT;\r
-               // c.arg[1] = 2;\r
-               // c.arg[2] = 0;\r
-               // memcpy(c.d.asBytes, rats, 2);\r
-               // SendCommand(&c);\r
-               // WaitForResponse(CMD_ACK,&resp);\r
-       // }\r
-\r
-       c.cmd = CMD_MIFARE_CIDENT;\r
-       c.arg[0] = 0;\r
-       c.arg[1] = 0;\r
-       c.arg[2] = 0;\r
+int mfCIdentify() {\r
+       UsbCommand c = {CMD_MIFARE_CIDENT, {0, 0, 0}};\r
        SendCommand(&c);\r
+       UsbCommand resp;\r
        WaitForResponse(CMD_ACK,&resp);\r
 \r
        uint8_t isGeneration = resp.arg[0] & 0xff;\r
@@ -578,13 +553,6 @@ int mfCIdentify()
                default: PrintAndLog("No chinese magic backdoor command detected"); break;\r
        }\r
 \r
-       // disconnect\r
-//     c.cmd = CMD_READER_ISO_14443a;\r
-//     c.arg[0] = 0;\r
-//     c.arg[1] = 0;\r
-//     c.arg[2] = 0;\r
-//     SendCommand(&c);\r
-\r
        return (int) isGeneration;\r
 }\r
 \r
Impressum, Datenschutz