X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/58e93ff593ee67e1c41fa790110dc60f09b91cc4..f2d46122d30004b152f9c581a438b9939707bab9:/client/cmddata.c diff --git a/client/cmddata.c b/client/cmddata.c index 95c7dc87..cea3bcfe 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -32,6 +32,12 @@ static int CmdHelp(const char *Cmd); //by marshmellow void setDemodBuf(uint8_t *buff, size_t size, size_t startIdx) { + if (buff == NULL) + return; + + if ( size >= MAX_DEMOD_BUF_LEN) + size = MAX_DEMOD_BUF_LEN; + size_t i = 0; for (; i < size; i++){ DemodBuffer[i]=buff[startIdx++]; @@ -1033,7 +1039,7 @@ int FSKrawDemod(const char *Cmd, bool verbose) if(size > (8*32)+2) size = (8*32)+2; //only output a max of 8 blocks of 32 bits most tags will have full bit stream inside that sample size if (verbose) { PrintAndLog("FSK decoded bitstream:"); - printBitStream(BitStream,size); + printBitStream(BitStream,size); } return 1; @@ -1780,7 +1786,8 @@ int NRZrawDemod(const char *Cmd, bool verbose) if (g_debugMode==1 && verbose) PrintAndLog("no data found, clk: %d, invert: %d, numbits: %d, errCnt: %d",clk,invert,BitLen,errCnt); return 0; } - PrintAndLog("Tried NRZ Demod using Clock: %d - invert: %d - Bits Found: %d",clk,invert,BitLen); + if (verbose) + PrintAndLog("Tried NRZ Demod using Clock: %d - invert: %d - Bits Found: %d",clk,invert,BitLen); //prime demod buffer for output setDemodBuf(BitStream,BitLen,0); @@ -1788,9 +1795,9 @@ int NRZrawDemod(const char *Cmd, bool verbose) PrintAndLog("# Errors during Demoding (shown as 77 in bit stream): %d",errCnt); } if (verbose) { - PrintAndLog("NRZ demoded bitstream:"); - // Now output the bitstream to the scrollback by line of 16 bits - printDemodBuff(); + PrintAndLog("NRZ demoded bitstream:"); + // Now output the bitstream to the scrollback by line of 16 bits + printDemodBuff(); } return 1; }