]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - armsrc/mifarecmd.c
fix command-line issue generating core dump on OSX
[proxmark3-svn] / armsrc / mifarecmd.c
index fca4f69b6dac9bc5afb58a4c3c94ccb213ab8d7b..d2795b1a2c2ca2e5a810c4ea90629a1d51b254a9 100644 (file)
@@ -636,6 +636,7 @@ void MifareECardLoad(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
 \r
        // variables\r
        byte_t dataoutbuf[16];\r
+       byte_t dataoutbuf2[16];\r
        uint8_t uid[8];\r
 \r
        // clear trace\r
@@ -687,6 +688,15 @@ void MifareECardLoad(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
                                break;\r
                        };\r
                        emlSetMem(dataoutbuf, sectorNo * 4 + 2, 1);\r
+\r
+                       // get block 3 bytes 6-9\r
+                       if(mifare_classic_readblock(pcs, cuid, sectorNo * 4 + 3, dataoutbuf)) {\r
+                               if (MF_DBGLEVEL >= 1)   Dbprintf("Read block 3 error");\r
+                               break;\r
+                       };\r
+                       emlGetMem(dataoutbuf2, sectorNo * 4 + 3, 1);\r
+                       memcpy(&dataoutbuf2[6], &dataoutbuf[6], 4);\r
+                       emlSetMem(dataoutbuf2,  sectorNo * 4 + 3, 1);\r
                }\r
 \r
                if(mifare_classic_halt(pcs, cuid)) {\r
@@ -699,14 +709,15 @@ void MifareECardLoad(uint32_t arg0, uint32_t arg1, uint32_t arg2, uint8_t *datai
 \r
        //  ----------------------------- crypto1 destroy\r
        crypto1_destroy(pcs);\r
+\r
+       FpgaWriteConfWord(FPGA_MAJOR_MODE_OFF);\r
+       LEDsoff();\r
        \r
        if (MF_DBGLEVEL >= 2) DbpString("EMUL FILL SECTORS FINISHED");\r
 \r
        // add trace trailer\r
        memset(uid, 0x44, 4);\r
        LogTrace(uid, 4, 0, 0, TRUE);\r
-       \r
-       Dbprintf("Loaded.");\r
 }\r
 \r
 //-----------------------------------------------------------------------------\r
Impressum, Datenschutz