X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/545a1f385c4e9f3fc28729e3a4c6a50e080c72f9..ec56429002dbccf8af357253a758ec88f359a21e:/client/cmdhfmf.c diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 4da6067a..8dc59f49 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1,5 +1,5 @@ //----------------------------------------------------------------------------- -// Copyright (C) 2011 Merlok +// Copyright (C) 2011,2012 Merlok // // This code is licensed to you under the terms of the GNU GPL, version 2 or, // at your option, any later version. See the LICENSE.txt file for the text of @@ -19,7 +19,7 @@ int CmdHF14AMifare(const char *Cmd) uint32_t nt = 0; uint64_t par_list = 0, ks_list = 0, r_key = 0; uint8_t isOK = 0; - uint8_t keyBlock[6] = {0,0,0,0,0,0}; + uint8_t keyBlock[8] = {0}; if (param_getchar(Cmd, 0) && param_gethex(Cmd, 0, keyBlock, 8)) { PrintAndLog("Nt must include 8 HEX symbols"); @@ -83,7 +83,7 @@ start: else { PrintAndLog("Found invalid key. ( Nt=%08x ,Trying use it to run again...", nt); - c.d.asDwords[0] = nt; + c.arg[0] = nt; goto start; } @@ -1542,6 +1542,20 @@ int CmdHF14AMfCSave(const char *Cmd) { } } +int CmdHF14AMfSniff(const char *Cmd){ + + if (param_getchar(Cmd, 0) == 'h') { + PrintAndLog("Usage: hf mf sniff "); + PrintAndLog(" sample: hf mf sniff "); + return 0; + } + + UsbCommand c = {CMD_MIFARE_SNIFFER, {0, 0, 0}}; + SendCommand(&c); + + return 0; +} + static command_t CommandTable[] = { {"help", CmdHelp, 1, "This help"}, @@ -1554,6 +1568,7 @@ static command_t CommandTable[] = {"chk", CmdHF14AMfChk, 0, "Test block keys"}, {"mifare", CmdHF14AMifare, 0, "Read parity error messages. param - "}, {"nested", CmdHF14AMfNested, 0, "Test nested authentication"}, + {"sniff", CmdHF14AMfSniff, 0, "Sniff card-reader communication"}, {"sim", CmdHF14AMf1kSim, 0, "Simulate MIFARE card"}, {"eclr", CmdHF14AMfEClear, 0, "Clear simulator memory block"}, {"eget", CmdHF14AMfEGet, 0, "Get simulator memory block"},