X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/6d7234cd43b2f40b3bce56055d9727f9cdbc29ee..05151b6fe876c8c5630f9c5160f79353c91ac49b:/client/cmdhf15.c diff --git a/client/cmdhf15.c b/client/cmdhf15.c index 0b8680c0..4a781121 100644 --- a/client/cmdhf15.c +++ b/client/cmdhf15.c @@ -445,6 +445,7 @@ int CmdHF15CmdRaw (const char *cmd) { int i=0; uint8_t data[100]; unsigned int datalen=0, temp; + char *hexout; if (strlen(cmd)<3) { @@ -514,7 +515,14 @@ int CmdHF15CmdRaw (const char *cmd) { if (r!=NULL) { recv = r->d.asBytes; PrintAndLog("received %i octets",r->arg[0]); - // TODO: output + hexout = (char *)malloc(r->arg[0] * 3 + 1); + if (hexout != NULL) { + for (int i = 0; i < r->arg[0]; i++) { // data in hex + sprintf(&hexout[i * 3], "%02hX ", recv[i]); + } + PrintAndLog("%s", hexout); + free(hexout); + } } else { PrintAndLog("timeout while waiting for reply."); } @@ -697,7 +705,7 @@ int CmdHF15CmdSysinfo(const char *Cmd) { PrintAndLog("CRC failed"); } } else { - PrintAndLog("no answer"); + PrintAndLog("timeout: no answer"); } return 0; @@ -705,6 +713,10 @@ int CmdHF15CmdSysinfo(const char *Cmd) { +/** + * Commandline handling: HF15 CMD READ + * Reads a single Block + */ int CmdHF15CmdRead(const char *Cmd) { UsbCommand *r; uint8_t *recv; @@ -778,6 +790,10 @@ int CmdHF15CmdRead(const char *Cmd) { } +/** + * Commandline handling: HF15 CMD WRITE + * Writes a single Block - might run into timeout, even when successful + */ int CmdHF15CmdWrite(const char *Cmd) { UsbCommand *r; uint8_t *recv;