rework some defines

This commit is contained in:
iceman1001 2021-05-16 23:03:13 +02:00
commit 16783000f0
4 changed files with 14 additions and 9 deletions

View file

@ -18,8 +18,7 @@
#include "commonutil.h"
#include "pmflash.h"
#include "cmdflashmemspiffs.h"
#define BYTES2UINT32(x) ((x[0] << 24) | (x[1] << 16) | (x[2] << 8) | (x[3]))
#include "em4x50.h"
static int CmdHelp(const char *Cmd);
@ -465,12 +464,12 @@ int CmdEM4x50Chk(const char *Cmd) {
}
size_t datalen = 0;
uint8_t data[FLASH_MEM_MAX_SIZE] = {0x0};
uint8_t data[100000] = {0x0};
uint8_t *keys = data;
uint32_t key_count = 0;
int res = loadFileDICTIONARY(filename, data, &datalen, 4, &key_count);
if (res || !key_count)
if ((res != PM3_SUCCESS) || (key_count == 0))
return PM3_EFILE;
PrintAndLogEx(INFO, "You can cancel this operation by pressing the pm3 button");

View file

@ -19,9 +19,6 @@
#define LOCKBIT_0 BITMASK(6)
#define LOCKBIT_1 BITMASK(7)
#define BYTES2UINT16(x) ((x[1] << 8) | (x[0]))
#define BYTES2UINT32(x) ((x[3] << 24) | (x[2] << 16) | (x[1] << 8) | (x[0]))
#define INDEX_TO_BLOCK(x) (((32-x)/2)-1)
static int CmdHelp(const char *Cmd);