X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/2d1885f1d15a55d0c6607ec8ad9cceab8f110480..8cdf15c2b3b83ef3f6bbb11f5921b69efce69fe9:/client/cmdlfnedap.c?ds=inline diff --git a/client/cmdlfnedap.c b/client/cmdlfnedap.c index 2aaae5db..61dab8a4 100644 --- a/client/cmdlfnedap.c +++ b/client/cmdlfnedap.c @@ -14,12 +14,13 @@ static int CmdHelp(const char *Cmd); int usage_lf_nedap_clone(void){ PrintAndLog("clone a NEDAP tag to a T55x7 tag."); PrintAndLog(""); - PrintAndLog("Usage: lf nedap clone "); - PrintAndLog("Options :"); - PrintAndLog(" : 24-bit value card number"); -// PrintAndLog(" Q5 : optional - clone to Q5 (T5555) instead of T55x7 chip"); + PrintAndLog("Usage: lf nedap clone [h] "); + PrintAndLog("Options:"); + PrintAndLog(" h : This help"); + PrintAndLog(" : 24-bit value card number"); +// PrintAndLog(" Q5 : optional - clone to Q5 (T5555) instead of T55x7 chip"); PrintAndLog(""); - PrintAndLog("Sample : lf nedap clone 112233"); + PrintAndLog("Sample: lf nedap clone 112233"); return 0; } @@ -27,11 +28,12 @@ int usage_lf_nedap_sim(void) { PrintAndLog("Enables simulation of NEDAP card with specified card number."); PrintAndLog("Simulation runs until the button is pressed or another USB command is issued."); PrintAndLog(""); - PrintAndLog("Usage: lf nedap sim "); - PrintAndLog("Options :"); - PrintAndLog(" : 24-bit value card number"); + PrintAndLog("Usage: lf nedap sim [h] "); + PrintAndLog("Options:"); + PrintAndLog(" h : This help"); + PrintAndLog(" : 24-bit value card number"); PrintAndLog(""); - PrintAndLog("Sample : lf nedap sim 112233"); + PrintAndLog("Sample: lf nedap sim 112233"); return 0; } @@ -82,16 +84,11 @@ 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 - uint8_t BitStream[MAX_GRAPH_TRACE_LEN]={0}; - size_t size = getFromGraphBuf(BitStream); - if (size==0) return 0; - - //get binary from ask wave if (!ASKbiphaseDemod("0 64 0 0", FALSE)) { if (g_debugMode) PrintAndLog("Error NEDAP: ASKbiphaseDemod failed"); return 0; } - size = DemodBufferLen; + size_t size = DemodBufferLen; int idx = NedapDemod(DemodBuffer, &size); if (idx < 0){ if (g_debugMode){ @@ -143,13 +140,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); - //return 0; + 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); - //return 0; + return 0; } // ok valid card found! @@ -205,7 +202,7 @@ lf t55xx wr b 4 d 4c0003ff int CmdLFNedapRead(const char *Cmd) { CmdLFRead("s"); - getSamples("30000",false); + getSamples("20000", TRUE); return CmdLFNedapDemod(""); } /* @@ -229,13 +226,14 @@ int CmdLFNedapClone(const char *Cmd) { return 1; } - ((ASK/biphase data rawdemod ab 0 64 1 0 - //NEDAP - compat mode, ASK/Biphase, data rate 64, 4 data blocks - blocks[0] = T55x7_MODULATION_BIPHASE | T55x7_BITRATE_RF_64 | 4<=0; --i){ al = data[i]; for (int j = 8; j > 0; --j) {