expanded from u16 -> u32 for keys to be loaded

This commit is contained in:
iceman1001
2020-05-20 08:58:28 +02:00
parent 3dd55e2c04
commit 8c22ef076b
9 changed files with 76 additions and 54 deletions

View File

@@ -168,7 +168,7 @@ static int CmdFlashMemLoad(const char *Cmd) {
return PM3_EINVARG;
}
size_t datalen = 0;
uint16_t keycount = 0;
uint32_t keycount = 0;
int res = 0;
uint8_t *data = calloc(FLASH_MEM_MAX_SIZE, sizeof(uint8_t));
@@ -180,6 +180,10 @@ static int CmdFlashMemLoad(const char *Cmd) {
free(data);
return PM3_EFILE;
}
// limited space on flash mem
if (keycount > 0xFFFF)
keycount &= 0xFFFF;
data[0] = (keycount >> 0) & 0xFF;
data[1] = (keycount >> 8) & 0xFF;
datalen += 2;
@@ -191,6 +195,10 @@ static int CmdFlashMemLoad(const char *Cmd) {
free(data);
return PM3_EFILE;
}
// limited space on flash mem
if (keycount > 0xFFFF)
keycount &= 0xFFFF;
data[0] = (keycount >> 0) & 0xFF;
data[1] = (keycount >> 8) & 0xFF;
datalen += 2;
@@ -202,6 +210,10 @@ static int CmdFlashMemLoad(const char *Cmd) {
free(data);
return PM3_EFILE;
}
// limited space on flash mem
if (keycount > 0xFFFF)
keycount &= 0xFFFF;
data[0] = (keycount >> 0) & 0xFF;
data[1] = (keycount >> 8) & 0xFF;
datalen += 2;