X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/d2219cae51009d36a8cf4f70c0dbe2d534877535..43534cbad22da2db2e1b59f9e08f0cadfe0d8d54:/client/cmdcrc.c diff --git a/client/cmdcrc.c b/client/cmdcrc.c index 006804ee..fddf0ac4 100644 --- a/client/cmdcrc.c +++ b/client/cmdcrc.c @@ -44,9 +44,10 @@ int split(char *str, char *arr[MAX_ARGS]){ while(isspace(str[beginIndex])){ ++beginIndex; } - if(str[beginIndex] == '\0') + if(str[beginIndex] == '\0') { break; - endIndex = beginIndex; + } + endIndex = beginIndex; while (str[endIndex] && !isspace(str[endIndex])){ ++endIndex; } @@ -311,7 +312,7 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res int ibperhx = 8, obperhx = 8; int rflags = 0; // search flags int c; - unsigned long width = 0UL; + //unsigned long width; poly_t apoly, crc; char *string; @@ -331,7 +332,7 @@ int RunModel(char *inModel, char *inHexStr, bool reverse, char endian, char *res return uerr("no preset models available"); // must set width so that parameter to -ipx is not zeroed - width = plen(model.spoly); + //width = plen(model.spoly); rflags |= R_HAVEP | R_HAVEI | R_HAVERI | R_HAVERO | R_HAVEX; //set flags @@ -501,14 +502,14 @@ int CmdrevengSearch(const char *Cmd){ if (ans) { //test for match if (memcmp(result, inCRC, crcChars)==0){ - PrintAndLog("\nFound a match!\nModel: %s\nValue: %s\n",Models[i], result); + PrintAndLog("\nFound a possible match!\nModel: %s\nValue: %s\n",Models[i], result); //optional - stop searching if found... found = true; } else { if (crcChars > 2){ char *swapEndian = SwapEndianStr(result, crcChars, crcChars); if (memcmp(swapEndian, inCRC, crcChars)==0){ - PrintAndLog("\nFound a match!\nModel: %s\nValue EndianSwapped: %s\n",Models[i], swapEndian); + PrintAndLog("\nFound a possible match!\nModel: %s\nValue EndianSwapped: %s\n",Models[i], swapEndian); //optional - stop searching if found... found = true; } @@ -522,14 +523,14 @@ int CmdrevengSearch(const char *Cmd){ if (ans) { //test for match if (memcmp(revResult, inCRC, crcChars)==0){ - PrintAndLog("\nFound a match!\nModel Reversed: %s\nValue: %s\n",Models[i], revResult); + PrintAndLog("\nFound a possible match!\nModel Reversed: %s\nValue: %s\n",Models[i], revResult); //optional - stop searching if found... found = true; } else { if (crcChars > 2){ char *swapEndian = SwapEndianStr(revResult, crcChars, crcChars); if (memcmp(swapEndian, inCRC, crcChars)==0){ - PrintAndLog("\nFound a match!\nModel Reversed: %s\nValue EndianSwapped: %s\n",Models[i], swapEndian); + PrintAndLog("\nFound a possible match!\nModel Reversed: %s\nValue EndianSwapped: %s\n",Models[i], swapEndian); //optional - stop searching if found... found = true; }