From 3de045905f901cc0d1ea49738c7d290a3acda541 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Thu, 8 Jan 2015 00:16:33 +0100 Subject: [PATCH 1/1] ADD: a CmdEM410xWatchnSpoof in cmdlfem4x.c , looks for a tag, then replays it. minor code clean up. --- armsrc/mifarecmd.c | 2 +- armsrc/mifareutil.c | 2 +- client/cmdhfmf.c | 7 ------- client/cmdlfem4x.h | 1 + 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/armsrc/mifarecmd.c b/armsrc/mifarecmd.c index 1948848e..7a33afbb 100644 --- a/armsrc/mifarecmd.c +++ b/armsrc/mifarecmd.c @@ -587,7 +587,7 @@ void MifareNested(uint32_t arg0, uint32_t arg1, uint32_t calibrate, uint8_t *dat }; nttmp = prng_successor(nt1, 100); //NXP Mifare is typical around 840,but for some unlicensed/compatible mifare card this can be 160 - for (i = 141; i < 1200; i++) { + for (i = 101; i < 1200; i++) { nttmp = prng_successor(nttmp, 1); if (nttmp == nt2) break; } diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index e91a87c1..18598191 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -19,7 +19,7 @@ #include "crapto1.h" #include "mifareutil.h" -int MF_DBGLEVEL = MF_DBG_ERROR; +int MF_DBGLEVEL = MF_DBG_ALL; // memory management uint8_t* get_bigbufptr_recvrespbuf(void) { diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 703e4c8b..cbe94efe 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -278,14 +278,7 @@ int CmdHF14AMfDump(const char *Cmd) UsbCommand resp; - int size = GetCardSize(); char cmdp = param_getchar(Cmd, 0); - - if ( size > -1) - cmdp = (char)(48+size); - - PrintAndLog("Got %d",cmdp); - switch (cmdp) { case '0' : numSectors = 5; break; case '1' : diff --git a/client/cmdlfem4x.h b/client/cmdlfem4x.h index 2282f64e..38f9aab9 100644 --- a/client/cmdlfem4x.h +++ b/client/cmdlfem4x.h @@ -16,6 +16,7 @@ int CmdEMdemodASK(const char *Cmd); int CmdEM410xRead(const char *Cmd); int CmdEM410xSim(const char *Cmd); int CmdEM410xWatch(const char *Cmd); +int CmdEM410xWatchnSpoof(const char *Cmd); int CmdEM410xWrite(const char *Cmd); int CmdEM4x50Read(const char *Cmd); int CmdReadWord(const char *Cmd); -- 2.39.5