X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/eb191de615e499035904263bcbdbff21539dd103..2df8c07907a07068d717d9b4ddcc2848f4efd608:/client/cmddata.c diff --git a/client/cmddata.c b/client/cmddata.c index 607121f0..6416ebbc 100644 --- a/client/cmddata.c +++ b/client/cmddata.c @@ -21,7 +21,7 @@ #include "util.h" #include "cmdmain.h" #include "cmddata.h" -#include "../common/lfdemod.h" +#include "lfdemod.h" static int CmdHelp(const char *Cmd); @@ -132,7 +132,7 @@ void printBitStream(uint8_t BitStream[], uint32_t bitLen){ return; } if (bitLen>512) bitLen=512; - for (i = 0; i < (bitLen-16); i+=16) { + for (i = 0; i <= (bitLen-16); i+=16) { PrintAndLog("%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i%i", BitStream[i], BitStream[i+1], @@ -272,6 +272,10 @@ int Cmdmandecoderaw(const char *Cmd) } bitnum=i; errCnt=manrawdemod(BitStream,&bitnum); + if (errCnt>=20){ + PrintAndLog("Too many errors: %d",errCnt); + return 0; + } PrintAndLog("Manchester Decoded - # errors:%d - data:",errCnt); printBitStream(BitStream,bitnum); if (errCnt==0){ @@ -442,10 +446,10 @@ int CmdBitstream(const char *Cmd) bit ^= 1; AppendGraph(0, clock, bit); -// for (j = 0; j < (int)(clock/2); j++) -// GraphBuffer[(i * clock) + j] = bit ^ 1; -// for (j = (int)(clock/2); j < clock; j++) -// GraphBuffer[(i * clock) + j] = bit; + // for (j = 0; j < (int)(clock/2); j++) + // GraphBuffer[(i * clock) + j] = bit ^ 1; + // for (j = (int)(clock/2); j < clock; j++) + // GraphBuffer[(i * clock) + j] = bit; } RepaintGraphWindow(); @@ -477,18 +481,7 @@ int CmdDetectClockRate(const char *Cmd) PrintAndLog("Auto-detected clock rate: %d", clock); return 0; } -/* -uint32_t bytebits_to_byte(uint8_t *src, int numbits) -{ - uint32_t num = 0; - for(int i = 0 ; i < numbits ; i++) - { - num = (num << 1) | (*src); - src++; - } - return num; -} -*/ + //by marshmellow //fsk raw demod and print binary //takes 2 arguments - Clock and invert @@ -526,7 +519,7 @@ int CmdFSKrawdemod(const char *Cmd) RepaintGraphWindow(); // Now output the bitstream to the scrollback by line of 16 bits - if(size > (7*32)+2) size = (7*32)+2; //only output a max of 7 blocks of 32 bits most tags will have full bit stream inside that sample size + 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 printBitStream(BitStream,size); return 0; }