]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdcrc.c
added some info from @peterfillmore fork
[proxmark3-svn] / client / cmdcrc.c
index 6cfc7ac1e47ea0d9ad08dbe8a8f502bb17e4f60c..01f65f553930c2a0a5859c69e6fadfd627ea7a3f 100644 (file)
@@ -8,7 +8,6 @@
 // CRC Calculations from the software reveng commands
 //-----------------------------------------------------------------------------
 
 // CRC Calculations from the software reveng commands
 //-----------------------------------------------------------------------------
 
-#include <stdlib.h>
 #ifdef _WIN32
 #  include <io.h>
 #  include <fcntl.h>
 #ifdef _WIN32
 #  include <io.h>
 #  include <fcntl.h>
@@ -19,8 +18,8 @@
 
 #include <stdio.h>
 #include <string.h>
 
 #include <stdio.h>
 #include <string.h>
-//#include <stdlib.h>
-//#include <ctype.h>
+#include <stdlib.h>
+#include <ctype.h>
 #include "cmdmain.h"
 #include "cmdcrc.h"
 #include "reveng/reveng.h"
 #include "cmdmain.h"
 #include "cmdcrc.h"
 #include "reveng/reveng.h"
@@ -44,9 +43,10 @@ int split(char *str, char *arr[MAX_ARGS]){
                while(isspace(str[beginIndex])){
                        ++beginIndex;
                }
                while(isspace(str[beginIndex])){
                        ++beginIndex;
                }
-               if(str[beginIndex] == '\0')
+               if(str[beginIndex] == '\0') {
                        break;
                        break;
-                       endIndex = beginIndex;
+               }
+               endIndex = beginIndex;
                while (str[endIndex] && !isspace(str[endIndex])){
                        ++endIndex;
                }
                while (str[endIndex] && !isspace(str[endIndex])){
                        ++endIndex;
                }
@@ -311,7 +311,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;
        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;
        poly_t apoly, crc;
 
        char *string;
@@ -331,7 +331,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 
                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
        rflags |= R_HAVEP | R_HAVEI | R_HAVERI | R_HAVERO | R_HAVEX;
        
        //set flags
Impressum, Datenschutz