X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/21e06301b9fe782fcfb7a250c2a42dbfc1a369f0..3f3fdce685983b58c2975f06783226f93160dafa:/client/ui.c diff --git a/client/ui.c b/client/ui.c index b31f1ead..770c9191 100644 --- a/client/ui.c +++ b/client/ui.c @@ -108,7 +108,7 @@ int manchester_decode( int * data, const size_t len, uint8_t * dataout, size_t DetectHighLowInGraph(&high, &low, TRUE); /* get clock */ - clock = GetClock("",0, 0); + clock = GetAskClock("",false, false); startindex = DetectFirstTransition(data, len, high); @@ -143,7 +143,7 @@ int manchester_decode( int * data, const size_t len, uint8_t * dataout, size_t bitIndex = 0; int isDamp = 0; - int damplimit = (int)((high / 2) * 0.3); + int damplimit = (int)( (int)(high / 2) * 0.3); int dampHi = (high/2)+damplimit; int dampLow = (high/2)-damplimit; int firstST = 0; @@ -213,15 +213,13 @@ int manchester_decode( int * data, const size_t len, uint8_t * dataout, size_t int ManchesterConvertFrom1(const int * data, const size_t len, uint8_t * dataout,int dataoutlen, int clock, int startIndex){ - PrintAndLog(" Path B"); - int i,j, bitindex, lc, tolerance, warnings; warnings = 0; int upperlimit = len*2/clock+8; i = startIndex; j = 0; tolerance = clock/4; - uint8_t decodedArr[len]; + uint8_t decodedArr[len] = {0x00}; /* Detect duration between 2 successive transitions */ for (bitindex = 1; i < len; i++) { @@ -289,7 +287,7 @@ int manchester_decode( int * data, const size_t len, uint8_t * dataout, size_t * parse it into final decoded bitstream */ int i, j, warnings; - uint8_t decodedArr[(len/2)+1]; + uint8_t decodedArr[(len/2)+1] = {0x00}; j = warnings = 0; @@ -435,6 +433,7 @@ void iceFsk3(int * data, const size_t len){ if ( fieldlen != 40 && fieldlen != 50){ printf("Detected field Length: %d \n", fieldlen); printf("Can only handle 40 or 50. Aborting...\n"); + free(output); return; }