]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
remove redundant llx prix64 defines
authormarshmellow42 <marshmellowrf@gmail.com>
Sun, 14 Feb 2016 19:43:19 +0000 (14:43 -0500)
committermarshmellow42 <marshmellowrf@gmail.com>
Sun, 14 Feb 2016 19:43:19 +0000 (14:43 -0500)
remove unused commented out #includes
coverity indicates compressed_fpga_stream.opaque needs to be initialized
to Z_NULL
fgetc returns int
define llu

client/cmdhficlass.c
client/cmdlfem4x.c
client/cmdlft55xx.c
client/fpga_compress.c
client/loclass/elite_crack.c
client/proxmark3.h

index 4cf9d3ead9b0d5e6cc638f05e4ed2aa8f9bebccb..134ca21e07d8424130f5ef5ee6ea1a592a08527f 100644 (file)
@@ -33,8 +33,6 @@
 #include "usb_cmd.h"
 #include "cmdhfmfu.h"
 
 #include "usb_cmd.h"
 #include "cmdhfmfu.h"
 
-#define llX PRIx64
-
 static int CmdHelp(const char *Cmd);
 
 #define ICLASS_KEYS_MAX 8
 static int CmdHelp(const char *Cmd);
 
 #define ICLASS_KEYS_MAX 8
@@ -1350,7 +1348,7 @@ uint64_t hexarray_to_uint64(uint8_t *key) {
        for (int i = 0;i < 8;i++)
                sprintf(&temp[(i *2)],"%02X",key[i]);
        temp[16] = '\0';
        for (int i = 0;i < 8;i++)
                sprintf(&temp[(i *2)],"%02X",key[i]);
        temp[16] = '\0';
-       if (sscanf(temp,"%016"llX,&uint_key) < 1)
+       if (sscanf(temp,"%016"llx,&uint_key) < 1)
                return 0;
        return uint_key;
 }
                return 0;
        return uint_key;
 }
index 7ff8037b5763d3ce6c1aeec2cf4e7fdf1bcebc59..aa0fc856e002b20e2c3e882341bff765b1d74416 100644 (file)
@@ -21,8 +21,6 @@
 #include "cmdlfem4x.h"
 #include "lfdemod.h"
 
 #include "cmdlfem4x.h"
 #include "lfdemod.h"
 
-#define llx PRIx64
-
 char *global_em410xId;
 
 static int CmdHelp(const char *Cmd);
 char *global_em410xId;
 
 static int CmdHelp(const char *Cmd);
@@ -58,7 +56,7 @@ int CmdEM410xRead(const char *Cmd)
                return 0;
        }
        char id[12] = {0x00};
                return 0;
        }
        char id[12] = {0x00};
-       sprintf(id, "%010llx",lo);
+       sprintf(id, "%010"PRIx64,lo);
        
        global_em410xId = id;
        return 1;
        
        global_em410xId = id;
        return 1;
index 5d797edc58ff15f6954c8bd2471f1114b6f516f1..dfee9aa6dc46abc80889193c0e334143b5b224db 100644 (file)
@@ -10,7 +10,6 @@
 #include <stdio.h>\r
 #include <string.h>\r
 #include <inttypes.h>\r
 #include <stdio.h>\r
 #include <string.h>\r
 #include <inttypes.h>\r
-//#include <time.h>  //not used - marshmellow\r
 #include "proxmark3.h"\r
 #include "ui.h"\r
 #include "graph.h"\r
 #include "proxmark3.h"\r
 #include "ui.h"\r
 #include "graph.h"\r
@@ -22,8 +21,6 @@
 #include "util.h"\r
 #include "data.h"\r
 #include "lfdemod.h"\r
 #include "util.h"\r
 #include "data.h"\r
 #include "lfdemod.h"\r
-//#include "../common/crc.h"  //not used - marshmellow\r
-//#include "../common/iso14443crc.h" //not used - marshmellow\r
 #include "cmdhf14a.h" //for getTagInfo\r
 \r
 #define T55x7_CONFIGURATION_BLOCK 0x00\r
 #include "cmdhf14a.h" //for getTagInfo\r
 \r
 #define T55x7_CONFIGURATION_BLOCK 0x00\r
index 2779e8350ec90870ed8a6d779b43cda09ce2aa79..0c40f22f15a1e7cff37259a2eaa2fff18963d929 100644 (file)
@@ -91,6 +91,7 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile)
                        for(uint16_t j = 0; j < num_infiles; j++) {
                                fclose(infile[j]);
                        }
                        for(uint16_t j = 0; j < num_infiles; j++) {
                                fclose(infile[j]);
                        }
+                       free(fpga_config);
                        return(EXIT_FAILURE);
                }
 
                        return(EXIT_FAILURE);
                }
 
@@ -112,7 +113,7 @@ int zlib_compress(FILE *infile[], uint8_t num_infiles, FILE *outfile)
        compressed_fpga_stream.avail_in = i;
        compressed_fpga_stream.zalloc = fpga_deflate_malloc;
        compressed_fpga_stream.zfree = fpga_deflate_free;
        compressed_fpga_stream.avail_in = i;
        compressed_fpga_stream.zalloc = fpga_deflate_malloc;
        compressed_fpga_stream.zfree = fpga_deflate_free;
-       
+       compressed_fpga_stream.opaque = Z_NULL;
        ret = deflateInit2(&compressed_fpga_stream, 
                                                COMPRESS_LEVEL,
                                                Z_DEFLATED,
        ret = deflateInit2(&compressed_fpga_stream, 
                                                COMPRESS_LEVEL,
                                                Z_DEFLATED,
@@ -187,6 +188,7 @@ int zlib_decompress(FILE *infile, FILE *outfile)
        compressed_fpga_stream.avail_out = DECOMPRESS_BUF_SIZE;
        compressed_fpga_stream.zalloc = fpga_deflate_malloc;
        compressed_fpga_stream.zfree = fpga_deflate_free;
        compressed_fpga_stream.avail_out = DECOMPRESS_BUF_SIZE;
        compressed_fpga_stream.zalloc = fpga_deflate_malloc;
        compressed_fpga_stream.zfree = fpga_deflate_free;
+       compressed_fpga_stream.opaque = Z_NULL;
        
        ret = inflateInit2(&compressed_fpga_stream, 0);
        
        
        ret = inflateInit2(&compressed_fpga_stream, 0);
        
@@ -195,9 +197,9 @@ int zlib_decompress(FILE *infile, FILE *outfile)
                        compressed_fpga_stream.next_in = inbuf;
                        uint16_t i = 0;
                        do {
                        compressed_fpga_stream.next_in = inbuf;
                        uint16_t i = 0;
                        do {
-                               uint8_t c = fgetc(infile);
+                               int c = fgetc(infile);
                                if (!feof(infile)) {
                                if (!feof(infile)) {
-                                       inbuf[i++] = c;
+                                       inbuf[i++] = c & 0xFF;
                                        compressed_fpga_stream.avail_in++;
                                } else {
                                        break;
                                        compressed_fpga_stream.avail_in++;
                                } else {
                                        break;
index 5dd8bf6dff0eb4d24d8009a749c5ca6842acb0ac..e9814e95e6d13604b98931f5e7aae6638addad17 100644 (file)
@@ -522,8 +522,8 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[])
                errors += bruteforceItem(*attack, keytable);
        }
        free(attack);
                errors += bruteforceItem(*attack, keytable);
        }
        free(attack);
-       clock_t t2 = clock();
-       float diff = (((float)t2 - (float)t1) / CLOCKS_PER_SEC );
+       t1 = clock() - t1;
+       float diff = ((float)t1 / CLOCKS_PER_SEC );
        prnlog("\nPerformed full crack in %f seconds",diff);
 
        // Pick out the first 16 bytes of the keytable.
        prnlog("\nPerformed full crack in %f seconds",diff);
 
        // Pick out the first 16 bytes of the keytable.
index 8236bfe71fb345cbd5c3b3066cc40f779cae8277..616d9c70aebfd1373262fb689938fcadfe741b0a 100644 (file)
@@ -16,6 +16,7 @@
 #include <inttypes.h>
 #define llx PRIx64
 #define lli PRIi64
 #include <inttypes.h>
 #define llx PRIx64
 #define lli PRIi64
+#define llu PRIu64
 #define hhu PRIu8
 
 #include "usb_cmd.h"
 #define hhu PRIu8
 
 #include "usb_cmd.h"
Impressum, Datenschutz