mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
adapt hf mfu eview to take prefix header lenght in consideration
This commit is contained in:
parent
c5d12bba0f
commit
ad64fdfeb7
2 changed files with 4 additions and 2 deletions
|
@ -3890,6 +3890,7 @@ int CmdHF14AMfELoad(const char *Cmd) {
|
|||
|
||||
uint8_t block_width = 16;
|
||||
uint16_t block_cnt = MIFARE_1K_MAXBLOCK;
|
||||
uint8_t hdr_len = 0;
|
||||
|
||||
if (m0) {
|
||||
block_cnt = MIFARE_MINI_MAXBLOCK;
|
||||
|
@ -3902,6 +3903,7 @@ int CmdHF14AMfELoad(const char *Cmd) {
|
|||
} else if (mu) {
|
||||
block_cnt = MFU_MAX_BLOCKS;
|
||||
block_width = MFU_BLOCK_SIZE;
|
||||
hdr_len = MFU_DUMP_PREFIX_LENGTH;
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Please specify a MIFARE Type");
|
||||
return PM3_EINVARG;
|
||||
|
@ -3916,7 +3918,7 @@ int CmdHF14AMfELoad(const char *Cmd) {
|
|||
|
||||
uint8_t *data = NULL;
|
||||
size_t bytes_read = 0;
|
||||
int res = pm3_load_dump(filename, (void **)&data, &bytes_read, (MFBLOCK_SIZE * MIFARE_4K_MAXBLOCK));
|
||||
int res = pm3_load_dump(filename, (void **)&data, &bytes_read, (block_width * block_cnt + hdr_len));
|
||||
if (res != PM3_SUCCESS) {
|
||||
return res;
|
||||
}
|
||||
|
|
|
@ -4106,7 +4106,7 @@ static int CmdHF14AMfuEView(const char *Cmd) {
|
|||
CLIParserFree(ctx);
|
||||
|
||||
uint16_t blocks = MFU_MAX_BLOCKS;
|
||||
uint16_t bytes = MFU_MAX_BYTES;
|
||||
uint16_t bytes = MFU_MAX_BYTES + MFU_DUMP_PREFIX_LENGTH;
|
||||
|
||||
uint8_t *dump = calloc(bytes, sizeof(uint8_t));
|
||||
if (dump == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue