From 7484a0dd1e14b28d07f62cd738e5f89f835dbf0a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Mon, 28 Aug 2017 21:25:29 +0200 Subject: [PATCH] fix: 'hf mf cgetsc' - a missing array and some new output layout. --- client/cmdhfmf.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/client/cmdhfmf.c b/client/cmdhfmf.c index 3687222ae..39e6bcf7d 100644 --- a/client/cmdhfmf.c +++ b/client/cmdhfmf.c @@ -2236,7 +2236,7 @@ int CmdHF14AMfCLoad(const char *Cmd) { } int CmdHF14AMfCGetBlk(const char *Cmd) { - uint8_t data[16]; + uint8_t data[16] = {0}; uint8_t blockNo = 0; int res; memset(data, 0x00, sizeof(data)); @@ -2259,7 +2259,7 @@ int CmdHF14AMfCGetBlk(const char *Cmd) { } int CmdHF14AMfCGetSc(const char *Cmd) { - uint8_t *data = NULL; + uint8_t data[16] = {0}; uint8_t sector = 0; int i, res, flags; @@ -2272,9 +2272,8 @@ int CmdHF14AMfCGetSc(const char *Cmd) { return 1; } - PrintAndLog("Sector : %02d/0x%02X ", sector, sector); - PrintAndLog("block | data"); - + PrintAndLog("\n # | data | Sector | %02d/ 0x%02X ", sector, sector); + PrintAndLog("----+------------------------------------------------"); uint8_t blocks = 4; uint8_t start = sector * 4; if ( sector > 32 ) { @@ -2293,7 +2292,7 @@ int CmdHF14AMfCGetSc(const char *Cmd) { PrintAndLog("Can't read block. %d error=%d", start + i, res); return 1; } - PrintAndLog(" %3d | %s", start + i, sprint_hex(data, sizeof(data))); + PrintAndLog("%3d | %s", start + i, sprint_hex(data, 16)); } return 0; }