X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/a39944216dd5d765e16917c1092bacc6061b518f..c649c43389d23fef7d28541739c89d22ad1f5250:/client/cmdhflegic.c diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index f4d0827f..f0fb12be 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -390,8 +390,8 @@ int CmdLegicDecode(const char *Cmd) { int CmdLegicRFRead(const char *Cmd) { // params: - // offset in data - // number of bytes. + // offset in data memory + // number of bytes to read char cmdp = param_getchar(Cmd, 0); if ( cmdp == 'H' || cmdp == 'h' ) return usage_legic_read(); @@ -401,7 +401,7 @@ int CmdLegicRFRead(const char *Cmd) { // OUT-OF-BOUNDS check if ( len + offset > MAX_LENGTH ) { len = MAX_LENGTH - offset; - PrintAndLog("Out-of-bound, shorten len to %d",len); + PrintAndLog("Out-of-bound, shorten len to %d", len); } if ( (IV & 0x7F) != IV ){ @@ -414,7 +414,7 @@ int CmdLegicRFRead(const char *Cmd) { PrintAndLog("LSB of IV must be SET"); } - PrintAndLog("Using IV: 0x%02x", IV); + //PrintAndLog("Using IV: 0x%02x | Offset: 0x%02x | Len: 0x%02x ", IV, offset, len); UsbCommand c = {CMD_READER_LEGIC_RF, {offset, len, IV}}; clearCommandBuffer(); @@ -425,12 +425,14 @@ int CmdLegicRFRead(const char *Cmd) { uint16_t len = resp.arg[1] & 0x3FF; if ( isOK ) { PrintAndLog("use 'hf legic decode'"); - } + uint8_t *data = resp.d.asBytes; PrintAndLog("\nData |"); PrintAndLog("-----------------------------"); PrintAndLog(" %s|\n", sprint_hex(data, len)); - // } + } else { + PrintAndLog("failed reading tag"); + } } else { PrintAndLog("command execution time out"); return 1;