X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/8cdf15c2b3b83ef3f6bbb11f5921b69efce69fe9..516dbac2105d8195ba52f46f4d5d75d598868f45:/client/cmdlfnedap.c diff --git a/client/cmdlfnedap.c b/client/cmdlfnedap.c index 61dab8a4..8f5832ad 100644 --- a/client/cmdlfnedap.c +++ b/client/cmdlfnedap.c @@ -85,7 +85,7 @@ int GetNedapBits(uint32_t cn, uint8_t *nedapBits) { int CmdLFNedapDemod(const char *Cmd) { //raw ask demod no start bit finding just get binary from wave if (!ASKbiphaseDemod("0 64 0 0", FALSE)) { - if (g_debugMode) PrintAndLog("Error NEDAP: ASKbiphaseDemod failed"); + if (g_debugMode) PrintAndLog("DEBUG: Error - Nedap ASKbiphaseDemod failed"); return 0; } size_t size = DemodBufferLen; @@ -99,11 +99,11 @@ int CmdLFNedapDemod(const char *Cmd) { // else if (idx == -2) // PrintAndLog("DEBUG: Error - problem during ASK/Biphase demod"); if (idx == -3) - PrintAndLog("DEBUG: Error - Size not correct: %d", size); + PrintAndLog("DEBUG: Error - Nedap Size not correct: %d", size); else if (idx == -4) - PrintAndLog("DEBUG: Error - NEDAP preamble not found"); + PrintAndLog("DEBUG: Error - Nedap preamble not found"); else - PrintAndLog("DEBUG: Error - idx: %d",idx); + PrintAndLog("DEBUG: Error - Nedap idx: %d",idx); } return 0; } @@ -139,13 +139,13 @@ int CmdLFNedapDemod(const char *Cmd) { uint8_t firstParity = GetParity( DemodBuffer, EVEN, 63); if ( firstParity != DemodBuffer[63] ) { - PrintAndLog("1st 64bit parity check failed: %d|%d ", DemodBuffer[63], firstParity); + PrintAndLog("DEBUG: Error - Nedap 1st 64bit parity check failed: %d|%d ", DemodBuffer[63], firstParity); return 0; } uint8_t secondParity = GetParity( DemodBuffer+64, EVEN, 63); if ( secondParity != DemodBuffer[127] ) { - PrintAndLog("2st 64bit parity check failed: %d|%d ", DemodBuffer[127], secondParity); + PrintAndLog("DEBUG: Error - Nedap 2st 64bit parity check failed: %d|%d ", DemodBuffer[127], secondParity); return 0; } @@ -202,7 +202,7 @@ lf t55xx wr b 4 d 4c0003ff int CmdLFNedapRead(const char *Cmd) { CmdLFRead("s"); - getSamples("20000", TRUE); + getSamples("12000", TRUE); return CmdLFNedapDemod(""); } /* @@ -229,11 +229,11 @@ int CmdLFNedapClone(const char *Cmd) { ((ASK/DIphase data rawdemod ab 0 64 1 0 //NEDAP - compat mode, ASK/DIphase, data rate 64, 4 data blocks // DI-pahse (CDP) T55x7_MODULATION_DIPHASE - blocks[0] = T55x7_MODULATION_DIPHASE | T55x7_BITRATE_RF_64 | 7<>1) << T5555_BITRATE_SHIFT | 7 <=0; --i){ + for (int i =len; i >= 0; --i){ al = data[i]; for (int j = 8; j > 0; --j) { @@ -340,7 +340,7 @@ int CmdLFNedapChk(const char *Cmd){ } } - PrintAndLog("Nedap checksum: [ 0x21, 0xBE ] %x", ((ch << 8) | cl) ); + PrintAndLog("Nedap checksum: 0x%X", ((ch << 8) | cl) ); return 0; }