This commit is contained in:
iceman1001 2024-01-28 11:16:45 +01:00
parent 6104086374
commit 5028d6f664
8 changed files with 50 additions and 35 deletions

View file

@ -1519,7 +1519,7 @@ static void CodeIso14443bAsReader(const uint8_t *cmd, int len, bool framing) {
int i;
tosend_reset();
// add framing enable flag.
// add framing enable flag.
// xerox chips use unframed commands during anticollision
if (framing) {
// Send SOF

View file

@ -732,7 +732,7 @@ static int NxpTestEAS(uint8_t *uid) {
PrintAndLogEx(DEBUG, "iso15693 timeout");
return PM3_ETIMEOUT;
}
if (resp.length < 2) {
if (resp.length < 2) {
return PM3_EWRONGANSWER;
}
@ -861,43 +861,43 @@ static int NxpSysInfo(uint8_t *uid) {
PrintAndLogEx(INFO, _CYAN_(" Password protection configuration"));
PrintAndLogEx(INFO, " Page L read.... %s"
, (d[2] & 0x01) ? _RED_("password") : _GREEN_("no password")
);
, (d[2] & 0x01) ? _RED_("password") : _GREEN_("no password")
);
PrintAndLogEx(INFO, " Page L write... %s"
, (d[2] & 0x02) ? _RED_("password") : _GREEN_("no password")
);
, (d[2] & 0x02) ? _RED_("password") : _GREEN_("no password")
);
PrintAndLogEx(INFO, " Page H read.... %s"
, (d[2] & 0x10) ? _RED_("password") : _GREEN_("no password")
);
, (d[2] & 0x10) ? _RED_("password") : _GREEN_("no password")
);
PrintAndLogEx(INFO, " Page H write... %s"
, (d[2] & 0x20) ? _RED_("password") : _GREEN_("no password")
);
, (d[2] & 0x20) ? _RED_("password") : _GREEN_("no password")
);
PrintAndLogEx(INFO, "");
PrintAndLogEx(INFO, _CYAN_(" Lock bits"));
// AFI lock bit
PrintAndLogEx(INFO, " AFI............ %s"
, (d[3] & 0x01) ? _RED_("locked") : _GREEN_("unlocked")
);
, (d[3] & 0x01) ? _RED_("locked") : _GREEN_("unlocked")
);
// EAS lock bit
PrintAndLogEx(INFO, " EAS............ %s"
,(d[3] & 0x02) ? _RED_("locked") : _GREEN_("unlocked")
);
, (d[3] & 0x02) ? _RED_("locked") : _GREEN_("unlocked")
);
// DSFID lock bit
PrintAndLogEx(INFO, " DSFID.......... %s"
, (d[3] & 0x03) ? _RED_("locked") : _GREEN_("unlocked")
);
, (d[3] & 0x03) ? _RED_("locked") : _GREEN_("unlocked")
);
// Password protection pointer address and access conditions lock bit
PrintAndLogEx(INFO, " Password protection configuration... %s"
, (d[3] & 0x04) ? _RED_("locked") : _GREEN_("unlocked")
);
, (d[3] & 0x04) ? _RED_("locked") : _GREEN_("unlocked")
);
PrintAndLogEx(INFO, "");
PrintAndLogEx(INFO, _CYAN_(" Features"));
@ -1353,9 +1353,9 @@ static void print_blocks_15693(iso15_tag_t *tag, bool dense_output) {
PrintAndLogEx(INFO, "%4d | %s| %s | %s"
, i
, sprint_hex(&tag->data[i * tag->bytesPerPage], tag->bytesPerPage)
, lck
, sprint_ascii(&tag->data[i * tag->bytesPerPage], tag->bytesPerPage)
, sprint_hex(&tag->data[i * tag->bytesPerPage], tag->bytesPerPage)
, lck
, sprint_ascii(&tag->data[i * tag->bytesPerPage], tag->bytesPerPage)
);
}
}
@ -1382,7 +1382,7 @@ static void print_tag_15693(iso15_tag_t *tag, bool dense_output, bool verbose) {
return;
}
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Memory") " -------%.*s", (tag->bytesPerPage *3), dashes);
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Memory") " -------%.*s", (tag->bytesPerPage * 3), dashes);
PrintAndLogEx(NORMAL, "");
print_blocks_15693(tag, dense_output);
print_hrule(tag->bytesPerPage);

View file

@ -1574,14 +1574,14 @@ void annotateMfPlus(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
void annotateIso14443b(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
// xerox anti collison loop / slot select for uid bytes...
if (cmdsize == 1) {
if (cmdsize == 1) {
switch (cmd[0]) {
case 0xB1:
snprintf(exp, size, "Slot 0 ACK");
return;
return;
case 0xB3:
snprintf(exp, size, "Slot 1 ACK");
return;
return;
case 0xB5:
snprintf(exp, size, "Slot 2 ACK");
return;
@ -1675,11 +1675,11 @@ void annotateIso14443b(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
break;
}
if (cmdsize == 13 && cmd[1] == ISO14443B_XEROX_READ_BLK) {
snprintf(exp, size, "XEROX READ_BLK(%u)", cmd[2+8]);
snprintf(exp, size, "XEROX READ_BLK(%u)", cmd[2 + 8]);
break;
}
if (cmdsize == 13 && cmd[1] == ISO14443B_XEROX_EXT_READ_BLK) {
snprintf(exp, size, "XEROX EXT_READ_BLK(%u)", cmd[2+8]);
snprintf(exp, size, "XEROX EXT_READ_BLK(%u)", cmd[2 + 8]);
break;
}
@ -1693,7 +1693,7 @@ void annotateIso14443b(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize) {
snprintf(exp, size, "XEROX WUP1");
break;
}
default:
default:
snprintf(exp, size, "?");
break;
}

View file

@ -395,7 +395,7 @@ static int xerox_select_card(iso14b_card_select_t *card, bool disconnect) {
while (retry--) {
iso14b_raw_cmd_t packet = {
.flags = (ISO14B_CONNECT | ISO14B_SELECT_XRX ),
.flags = (ISO14B_CONNECT | ISO14B_SELECT_XRX),
.timeout = 0,
.rawlen = 0,
};

View file

@ -1391,7 +1391,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
char *path;
int res = searchFile(&path, RESOURCES_SUBDIR, preferredName, ".json", false);
if (res != PM3_SUCCESS) {
if (res != PM3_SUCCESS) {
return PM3_EFILE;
}
@ -1618,7 +1618,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
*datalen = sptr;
goto out;
}
if (!strcmp(ctype, "EM4205/EM4305")) {
size_t sptr = 0;
for (int i = 0; i < (maxdatalen / 4); i++) {
@ -1639,7 +1639,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
*datalen = sptr;
goto out;
}
if (!strcmp(ctype, "EM4469/EM4569")) {
size_t sptr = 0;
for (int i = 0; i < (maxdatalen / 4); i++) {
@ -1660,7 +1660,7 @@ int loadFileJSONex(const char *preferredName, void *data, size_t maxdatalen, siz
*datalen = sptr;
goto out;
}
if (!strcmp(ctype, "EM4X50")) {
size_t sptr = 0;
for (int i = 0; i < (maxdatalen / 4); i++) {

View file

@ -515,6 +515,7 @@ const static vocabulary_t vocabulary[] = {
{ 0, "hf xerox dump" },
{ 0, "hf xerox reader" },
{ 1, "hf xerox view" },
{ 0, "hf xerox rdbl" },
{ 1, "hw help" },
{ 0, "hw break" },
{ 0, "hw bootloader" },

View file

@ -7729,6 +7729,19 @@
],
"usage": "hf xerox info [-hv]"
},
"hf xerox rdbl": {
"command": "hf xerox rdbl",
"description": "Read a Fuji/Xerox tag block",
"notes": [
"hf xerox rdbl -b 1"
],
"offline": false,
"options": [
"-h, --help This help",
"-b, --blk <dec> page number (0-255)"
],
"usage": "hf xerox rdbl [-h] -b <dec>"
},
"hf xerox reader": {
"command": "hf xerox reader",
"description": "Act as a 14443B reader to identify a Fuji Xerox based tag ISO/IEC 14443 type B based communications",
@ -12373,8 +12386,8 @@
}
},
"metadata": {
"commands_extracted": 713,
"commands_extracted": 714,
"extracted_by": "PM3Help2JSON v1.00",
"extracted_on": "2024-01-26T11:38:54"
"extracted_on": "2024-01-28T10:16:20"
}
}

View file

@ -782,6 +782,7 @@ Check column "offline" for their availability.
|`hf xerox dump `|N |`Read all memory pages of an Fuji/Xerox tag, save to file`
|`hf xerox reader `|N |`Act like a Fuji/Xerox reader`
|`hf xerox view `|Y |`Display content from tag dump file`
|`hf xerox rdbl `|N |`Read Fuji/Xerox block`
### hw