less global vars

This commit is contained in:
Philippe Teuwen
2020-06-01 20:10:45 +02:00
parent b9b230bb99
commit b6077df68e
5 changed files with 13 additions and 15 deletions

View File

@@ -3394,6 +3394,7 @@ static int CmdHF14AMfSniff(const char *Cmd) {
SendCommandNG(CMD_HF_MIFARE_SNIFF, NULL, 0);
PacketResponseNG resp;
struct Crypto1State *traceCrypto1 = NULL;
// wait cycle
while (true) {
@@ -3490,13 +3491,13 @@ static int CmdHF14AMfSniff(const char *Cmd) {
PrintAndLogEx(SUCCESS, "Trace saved to %s", logHexFileName);
}
if (wantDecrypt)
mfTraceInit(uid, uid_len, atqa, sak, wantSaveToEmlFile);
mfTraceInit(&traceCrypto1, uid, uid_len, atqa, sak, wantSaveToEmlFile);
} else {
PrintAndLogEx(NORMAL, "%03d| %s |%s", num, isTag ? "TAG" : "RDR", sprint_hex(bufPtr, len));
if (wantLogToFile)
AddLogHex(logHexFileName, isTag ? "TAG| " : "RDR| ", bufPtr, len);
if (wantDecrypt)
mfTraceDecode(bufPtr, len, wantSaveToEmlFile);
mfTraceDecode(traceCrypto1, bufPtr, len, wantSaveToEmlFile);
num++;
}
bufPtr += len;