move print buffer to util

This commit is contained in:
merlokk 2021-07-27 17:51:27 +03:00
commit 7d8009a32b

View file

@ -6343,14 +6343,8 @@ static int CmdHF14ADesReadData(const char *Cmd) {
} }
if (resplen > 0) { if (resplen > 0) {
PrintAndLogEx(SUCCESS, "Read %u bytes from file 0x%02x", resplen, fnum); PrintAndLogEx(SUCCESS, "Read %u bytes from file 0x%02x offset %u", resplen, fnum, offset);
PrintAndLogEx(INFO, "Offset | Data | Ascii"); print_buffer_with_offset(resp, resplen, offset);
PrintAndLogEx(INFO, "----------------------------------------------------------------------------");
for (uint32_t i = 0; i < resplen; i += 16) {
uint32_t l = resplen - i;
PrintAndLogEx(INFO, "%3d/0x%02X | %s| %s", i, i, sprint_hex(&resp[i], l > 16 ? 16 : l), sprint_ascii(&resp[i], l > 16 ? 16 : l));
}
} else { } else {
PrintAndLogEx(SUCCESS, "Read operation returned no data from file %d", fnum); PrintAndLogEx(SUCCESS, "Read operation returned no data from file %d", fnum);
} }