]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/mifarehost.c
FIX: lf hitag : Mea culpa, simulation should not have reader_field on. thanks to...
[proxmark3-svn] / client / mifarehost.c
index b7cd3b590cea356100bfdc8f7be793f91e388f00..5d39221f161f423ee6bd39cfb96f836d7ab69df0 100644 (file)
@@ -170,7 +170,7 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo
                free(statelists[1].head.slhead);\r
                num_to_bytes(key64, 6, resultKey);\r
 \r
-               PrintAndLog("UID: %08x target block:%3u key type: %c  -- Found key [%012"llx"]",\r
+               PrintAndLog("UID: %08x target block:%3u key type: %c  -- Found key [%012" PRIx64 "]",\r
                        uid,\r
                        (uint16_t)resp.arg[2] & 0xff,\r
                        (resp.arg[2] >> 8) ? 'B' : 'A',\r
@@ -192,8 +192,10 @@ out:
 }\r
 \r
 int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){\r
-       *key = 0;\r
-       UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType<<8)), clear_trace, keycnt}};\r
+#define STD_SEARCH 1\r
+#define EXT_SEARCH 2\r
+       *key = 0;       \r
+       UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType << 8)), ((EXT_SEARCH << 8) | clear_trace), keycnt}};\r
        memcpy(c.d.asBytes, keyBlock, 6 * keycnt);\r
        clearCommandBuffer();\r
        SendCommand(&c);\r
@@ -250,15 +252,13 @@ int mfKeyBrute(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint64_t *resultk
        return found;\r
 }\r
 \r
-\r
 // EMULATOR\r
-\r
 int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) {\r
        UsbCommand c = {CMD_MIFARE_EML_MEMGET, {blockNum, blocksCount, 0}};\r
        clearCommandBuffer();\r
        SendCommand(&c);\r
        UsbCommand resp;\r
-       if (!WaitForResponseTimeout(CMD_ACK,&resp,1500)) return 1;\r
+       if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return 1;\r
        memcpy(data, resp.d.asBytes, blocksCount * 16);\r
        return 0;\r
 }\r
@@ -629,7 +629,7 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) {
                        lfsr_rollback_word(revstate, nr_enc, 1);\r
                        lfsr_rollback_word(revstate, cuid ^ nt, 0);\r
                        crypto1_get_lfsr(revstate, &key);\r
-                       PrintAndLog("Found Key: [%012"llx"]", key);\r
+                       PrintAndLog("Found Key: [%012" PRIx64 "]", key);\r
                        \r
                        //if ( tryMfk64(cuid, nt, nr_enc, ar_enc, at_enc, &key) )\r
                        AddLogUint64(logHexFileName, "Found Key: ", key); \r
Impressum, Datenschutz