X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/2dcf60f3df145625781982040ae9c80d30e40482..be67483e63430608982f1c92e02b59d7b4dc65b3:/client/mifarehost.c diff --git a/client/mifarehost.c b/client/mifarehost.c index b7cd3b59..5d39221f 100644 --- a/client/mifarehost.c +++ b/client/mifarehost.c @@ -170,7 +170,7 @@ int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t * key, uint8_t trgBlockNo free(statelists[1].head.slhead); num_to_bytes(key64, 6, resultKey); - PrintAndLog("UID: %08x target block:%3u key type: %c -- Found key [%012"llx"]", + PrintAndLog("UID: %08x target block:%3u key type: %c -- Found key [%012" PRIx64 "]", uid, (uint16_t)resp.arg[2] & 0xff, (resp.arg[2] >> 8) ? 'B' : 'A', @@ -192,8 +192,10 @@ out: } int mfCheckKeys (uint8_t blockNo, uint8_t keyType, bool clear_trace, uint8_t keycnt, uint8_t * keyBlock, uint64_t * key){ - *key = 0; - UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType<<8)), clear_trace, keycnt}}; +#define STD_SEARCH 1 +#define EXT_SEARCH 2 + *key = 0; + UsbCommand c = {CMD_MIFARE_CHKKEYS, { (blockNo | (keyType << 8)), ((EXT_SEARCH << 8) | clear_trace), keycnt}}; memcpy(c.d.asBytes, keyBlock, 6 * keycnt); clearCommandBuffer(); SendCommand(&c); @@ -250,15 +252,13 @@ int mfKeyBrute(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint64_t *resultk return found; } - // EMULATOR - int mfEmlGetMem(uint8_t *data, int blockNum, int blocksCount) { UsbCommand c = {CMD_MIFARE_EML_MEMGET, {blockNum, blocksCount, 0}}; clearCommandBuffer(); SendCommand(&c); UsbCommand resp; - if (!WaitForResponseTimeout(CMD_ACK,&resp,1500)) return 1; + if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return 1; memcpy(data, resp.d.asBytes, blocksCount * 16); return 0; } @@ -629,7 +629,7 @@ int mfTraceDecode(uint8_t *data_src, int len, bool wantSaveToEmlFile) { lfsr_rollback_word(revstate, nr_enc, 1); lfsr_rollback_word(revstate, cuid ^ nt, 0); crypto1_get_lfsr(revstate, &key); - PrintAndLog("Found Key: [%012"llx"]", key); + PrintAndLog("Found Key: [%012" PRIx64 "]", key); //if ( tryMfk64(cuid, nt, nr_enc, ar_enc, at_enc, &key) ) AddLogUint64(logHexFileName, "Found Key: ", key);