X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/55acbb2a3903f7940d0db5fae2e8f4fdab51d1b8..71d90e54cdfbe625c70185b2db53e4d87d68ec14:/client/cmdhfmf.c diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 6abfdda2..9624ce9a 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -1558,6 +1558,7 @@ int CmdHF14AMfSniff(const char *Cmd){ uint8_t atqa[2]; uint8_t sak; bool isTag; + uint32_t parity; uint8_t buf[3000]; uint8_t * bufPtr = buf; memset(buf, 0x00, 3000); @@ -1568,7 +1569,7 @@ int CmdHF14AMfSniff(const char *Cmd){ PrintAndLog(" l - save encrypted sequence to logfile `uid.log`"); PrintAndLog(" d - decrypt sequence and put it to log file `uid.log`"); PrintAndLog(" n/a e - decrypt sequence, collect read and write commands and save the result of the sequence to emulator memory"); - PrintAndLog(" n/a r - decrypt sequence, collect read and write commands and save the result of the sequence to emulator dump file `uid.eml`"); + PrintAndLog(" r - decrypt sequence, collect read and write commands and save the result of the sequence to emulator dump file `uid.eml`"); PrintAndLog("Usage: hf mf sniff [l][d][e][r]"); PrintAndLog(" sample: hf mf sniff l d e"); return 0; @@ -1625,7 +1626,9 @@ int CmdHF14AMfSniff(const char *Cmd){ num = 0; while (bufPtr - buf + 9 < blockLen) { isTag = bufPtr[3] & 0x80 ? true:false; - bufPtr += 8; + bufPtr += 4; + parity = *((uint32_t *)(bufPtr)); + bufPtr += 4; len = bufPtr[0]; bufPtr++; if ((len == 14) && (bufPtr[0] = 0xff) && (bufPtr[1] = 0xff)) { @@ -1635,14 +1638,14 @@ int CmdHF14AMfSniff(const char *Cmd){ PrintAndLog("tag select uid:%s atqa:%02x %02x sak:0x%02x", sprint_hex(uid, 7), atqa[0], atqa[1], sak); if (wantLogToFile) { - FillFileNameByUID(logHexFileName, uid, ".log"); + FillFileNameByUID(logHexFileName, uid, ".log", 7); AddLogCurrentDT(logHexFileName); } - if (wantDecrypt) mfTraceInit(uid, atqa, sak); + if (wantDecrypt) mfTraceInit(uid, atqa, sak, wantSaveToEmlFile); } else { PrintAndLog("%s(%d):%s", isTag ? "TAG":"RDR", num, sprint_hex(bufPtr, len)); if (wantLogToFile) AddLogHex(logHexFileName, isTag ? "TAG: ":"RDR: ", bufPtr, len); - if (wantDecrypt) mfTraceDecode(bufPtr, len); + if (wantDecrypt) mfTraceDecode(bufPtr, len, parity, wantSaveToEmlFile); } bufPtr += len; num++;