mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-25 07:25:27 -07:00
Merge branch 'master' into cleanup
This commit is contained in:
commit
31e4ba9219
4 changed files with 21 additions and 3 deletions
|
@ -1235,6 +1235,7 @@ int CmdHF14AMfUDump(const char *Cmd){
|
|||
bool manualPages = false;
|
||||
uint8_t startPage = 0;
|
||||
char tempStr[50];
|
||||
unsigned char cleanASCII[4];
|
||||
|
||||
while(param_getchar(Cmd, cmdp) != 0x00)
|
||||
{
|
||||
|
@ -1377,7 +1378,7 @@ int CmdHF14AMfUDump(const char *Cmd){
|
|||
PrintAndLog("---------------------------------");
|
||||
for (i = 0; i < Pages; ++i) {
|
||||
if ( i < 3 ) {
|
||||
PrintAndLog("%02d/0x%02X | %s| | ", i+startPage, i+startPage, sprint_hex(data + i * 4, 4));
|
||||
PrintAndLog("%3d/0x%02X | %s| | ", i+startPage, i+startPage, sprint_hex(data + i * 4, 4));
|
||||
continue;
|
||||
}
|
||||
switch(i){
|
||||
|
@ -1424,7 +1425,12 @@ int CmdHF14AMfUDump(const char *Cmd){
|
|||
case 43: tmplockbit = bit2[9]; break; //auth1
|
||||
default: break;
|
||||
}
|
||||
PrintAndLog("%02d/0x%02X | %s| %d | %.4s", i+startPage, i+startPage, sprint_hex(data + i * 4, 4), tmplockbit, data+i*4);
|
||||
|
||||
// convert unprintable characters and line breaks to dots
|
||||
memcpy(cleanASCII, data+i*4, 4);
|
||||
clean_ascii(cleanASCII, 4);
|
||||
|
||||
PrintAndLog("%3d/0x%02X | %s| %d | %.4s", i+startPage, i+startPage, sprint_hex(data + i * 4, 4), tmplockbit, cleanASCII);
|
||||
}
|
||||
PrintAndLog("---------------------------------");
|
||||
|
||||
|
|
|
@ -449,7 +449,7 @@ int CmdPing(const char *Cmd)
|
|||
UsbCommand c = {CMD_PING};
|
||||
SendCommand(&c);
|
||||
if (WaitForResponseTimeout(CMD_ACK,&resp,1000)) {
|
||||
PrintAndLog("Ping successfull");
|
||||
PrintAndLog("Ping successful");
|
||||
}else{
|
||||
PrintAndLog("Ping failed");
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
// utilities
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <ctype.h>
|
||||
#include "util.h"
|
||||
#define MAX_BIN_BREAK_LENGTH (3072+384+1)
|
||||
|
||||
|
@ -581,3 +582,12 @@ void rol(uint8_t *data, const size_t len){
|
|||
}
|
||||
data[len-1] = first;
|
||||
}
|
||||
|
||||
|
||||
// Replace unprintable characters with a dot in char buffer
|
||||
void clean_ascii(unsigned char *buf, size_t len) {
|
||||
for (size_t i = 0; i < len; i++) {
|
||||
if (!isprint(buf[i]))
|
||||
buf[i] = '.';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -76,3 +76,5 @@ void xor(unsigned char *dst, unsigned char *src, size_t len);
|
|||
int32_t le24toh(uint8_t data[3]);
|
||||
uint32_t le32toh (uint8_t *data);
|
||||
void rol(uint8_t *data, const size_t len);
|
||||
|
||||
void clean_ascii(unsigned char *buf, size_t len);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue