]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: changed output for the "hf mf nested" to show KEY: A or B instead of 0/1
authoriceman1001 <iceman@iuse.se>
Sat, 16 Jan 2016 22:02:54 +0000 (23:02 +0100)
committericeman1001 <iceman@iuse.se>
Sat, 16 Jan 2016 22:02:54 +0000 (23:02 +0100)
client/mifarehost.c

index 1cb228bb68881c9be22c9ae7478b317cff6b0455..5870803b535f144eafd7d002f648890f67c781ba 100644 (file)
@@ -79,23 +79,19 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo
        struct Crypto1State *p1, *p2, *p3, *p4;\r
        \r
        // flush queue\r
-       clearCommandBuffer();\r
-       //WaitForResponseTimeout(CMD_ACK,NULL,100);\r
        \r
        UsbCommand c = {CMD_MIFARE_NESTED, {blockNo + keyType * 0x100, trgBlockNo + trgKeyType * 0x100, calibrate}};\r
        memcpy(c.d.asBytes, key, 6);\r
+       clearCommandBuffer();\r
        SendCommand(&c);\r
 \r
-       if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) {\r
-               return -1;\r
-       }\r
+       if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return -1;\r
 \r
-       if (resp.arg[0]) {\r
-               return resp.arg[0];  // error during nested\r
-       }\r
-               \r
+       // error during nested\r
+       if (resp.arg[0]) return resp.arg[0];\r
+       \r
        memcpy(&uid, resp.d.asBytes, 4);\r
-       PrintAndLog("uid:%08x trgbl=%d trgkey=%x", uid, (uint16_t)resp.arg[2] & 0xff, (uint16_t)resp.arg[2] >> 8);\r
+       PrintAndLog("UID: %08x Block:%d Key: %c", uid, (uint16_t)resp.arg[2] & 0xff, (resp.arg[2] >> 8) ?'A':'B' );\r
                        \r
        for (i = 0; i < 2; i++) {\r
                statelists[i].blockNo = resp.arg[2] & 0xff;\r
Impressum, Datenschutz