mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-02-24 15:44:47 +08:00
remove redundant llx prix64 defines
remove unused commented out #includes coverity indicates compressed_fpga_stream.opaque needs to be initialized to Z_NULL fgetc returns int define llu
This commit is contained in:
parent
d23411ef61
commit
38d618baa9
6 changed files with 10 additions and 14 deletions
|
@ -33,8 +33,6 @@
|
|||
#include "usb_cmd.h"
|
||||
#include "cmdhfmfu.h"
|
||||
|
||||
#define llX PRIx64
|
||||
|
||||
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';
|
||||
if (sscanf(temp,"%016"llX,&uint_key) < 1)
|
||||
if (sscanf(temp,"%016"llx,&uint_key) < 1)
|
||||
return 0;
|
||||
return uint_key;
|
||||
}
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
#include "cmdlfem4x.h"
|
||||
#include "lfdemod.h"
|
||||
|
||||
#define llx PRIx64
|
||||
|
||||
char *global_em410xId;
|
||||
|
||||
static int CmdHelp(const char *Cmd);
|
||||
|
@ -58,7 +56,7 @@ int CmdEM410xRead(const char *Cmd)
|
|||
return 0;
|
||||
}
|
||||
char id[12] = {0x00};
|
||||
sprintf(id, "%010llx",lo);
|
||||
sprintf(id, "%010"PRIx64,lo);
|
||||
|
||||
global_em410xId = id;
|
||||
return 1;
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <inttypes.h>
|
||||
//#include <time.h> //not used - marshmellow
|
||||
#include "proxmark3.h"
|
||||
#include "ui.h"
|
||||
#include "graph.h"
|
||||
|
@ -22,8 +21,6 @@
|
|||
#include "util.h"
|
||||
#include "data.h"
|
||||
#include "lfdemod.h"
|
||||
//#include "../common/crc.h" //not used - marshmellow
|
||||
//#include "../common/iso14443crc.h" //not used - marshmellow
|
||||
#include "cmdhf14a.h" //for getTagInfo
|
||||
|
||||
#define T55x7_CONFIGURATION_BLOCK 0x00
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
free(fpga_config);
|
||||
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.opaque = Z_NULL;
|
||||
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.opaque = Z_NULL;
|
||||
|
||||
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 {
|
||||
uint8_t c = fgetc(infile);
|
||||
int c = fgetc(infile);
|
||||
if (!feof(infile)) {
|
||||
inbuf[i++] = c;
|
||||
inbuf[i++] = c & 0xFF;
|
||||
compressed_fpga_stream.avail_in++;
|
||||
} else {
|
||||
break;
|
||||
|
|
|
@ -522,8 +522,8 @@ int bruteforceDump(uint8_t dump[], size_t dumpsize, uint16_t keytable[])
|
|||
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.
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#include <inttypes.h>
|
||||
#define llx PRIx64
|
||||
#define lli PRIi64
|
||||
#define llu PRIu64
|
||||
#define hhu PRIu8
|
||||
|
||||
#include "usb_cmd.h"
|
||||
|
|
Loading…
Reference in a new issue