mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
hf mfp info: fix support for real 4b cards
This commit is contained in:
parent
e9d55ec26c
commit
09b31b5978
1 changed files with 22 additions and 5 deletions
|
@ -262,9 +262,15 @@ static int get_plus_signature(uint8_t *signature, int *signature_len) {
|
||||||
|
|
||||||
// GET VERSION
|
// GET VERSION
|
||||||
static int plus_print_version(uint8_t *version) {
|
static int plus_print_version(uint8_t *version) {
|
||||||
PrintAndLogEx(SUCCESS, "UID: " _GREEN_("%s"), sprint_hex(version + 14, 7));
|
if ((version[14] == 0x00) && (version[15] == 0x04)) {
|
||||||
PrintAndLogEx(SUCCESS, "Batch number: " _GREEN_("%s"), sprint_hex(version + 21, 5));
|
PrintAndLogEx(SUCCESS, "UID: " _GREEN_("%s"), sprint_hex(version + 16, 4));
|
||||||
PrintAndLogEx(SUCCESS, "Production date: week " _GREEN_("%02x") " / " _GREEN_("20%02x"), version[7 + 7 + 7 + 5], version[7 + 7 + 7 + 5 + 1]);
|
PrintAndLogEx(SUCCESS, "Batch number: " _GREEN_("%s"), sprint_hex(version + 20, 5));
|
||||||
|
PrintAndLogEx(SUCCESS, "Production date: week " _GREEN_("%02x") " / " _GREEN_("20%02x"), version[7 + 7 + 6 + 5], version[7 + 7 + 7 + 4 + 1]);
|
||||||
|
} else {
|
||||||
|
PrintAndLogEx(SUCCESS, "UID: " _GREEN_("%s"), sprint_hex(version + 14, 7));
|
||||||
|
PrintAndLogEx(SUCCESS, "Batch number: " _GREEN_("%s"), sprint_hex(version + 21, 5));
|
||||||
|
PrintAndLogEx(SUCCESS, "Production date: week " _GREEN_("%02x") " / " _GREEN_("20%02x"), version[7 + 7 + 7 + 5], version[7 + 7 + 7 + 5 + 1]);
|
||||||
|
}
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(INFO, "--- " _CYAN_("Hardware Information"));
|
PrintAndLogEx(INFO, "--- " _CYAN_("Hardware Information"));
|
||||||
PrintAndLogEx(INFO, " Raw : %s", sprint_hex(version, 7));
|
PrintAndLogEx(INFO, " Raw : %s", sprint_hex(version, 7));
|
||||||
|
@ -328,17 +334,24 @@ static int CmdHFMFPInfo(const char *Cmd) {
|
||||||
|
|
||||||
uint64_t select_status = resp.oldarg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
uint64_t select_status = resp.oldarg[0]; // 0: couldn't read, 1: OK, with ATS, 2: OK, no ATS, 3: proprietary Anticollision
|
||||||
|
|
||||||
|
bool Version4BUID = false;
|
||||||
bool supportVersion = false;
|
bool supportVersion = false;
|
||||||
bool supportSignature = false;
|
bool supportSignature = false;
|
||||||
|
|
||||||
// version check
|
// version check
|
||||||
uint8_t version[30] = {0};
|
uint8_t version[30] = {0};
|
||||||
|
uint8_t uid4b[4] = {0};
|
||||||
uint8_t uid7b[7] = {0};
|
uint8_t uid7b[7] = {0};
|
||||||
int version_len = sizeof(version);
|
int version_len = sizeof(version);
|
||||||
if (get_plus_version(version, &version_len) == PM3_SUCCESS) {
|
if (get_plus_version(version, &version_len) == PM3_SUCCESS) {
|
||||||
plus_print_version(version);
|
plus_print_version(version);
|
||||||
supportVersion = true;
|
supportVersion = true;
|
||||||
memcpy(uid7b, version + 14, 7);
|
if ((version[14] == 0x00) && (version[15] == 0x04)) {
|
||||||
|
Version4BUID = true;
|
||||||
|
memcpy(uid4b, version + 16, 4);
|
||||||
|
} else {
|
||||||
|
memcpy(uid7b, version + 14, 7);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
// info about 14a part, historical bytes.
|
// info about 14a part, historical bytes.
|
||||||
infoHF14A(false, false, false);
|
infoHF14A(false, false, false);
|
||||||
|
@ -349,7 +362,11 @@ static int CmdHFMFPInfo(const char *Cmd) {
|
||||||
int signature_len = sizeof(signature);
|
int signature_len = sizeof(signature);
|
||||||
if (get_plus_signature(signature, &signature_len) == PM3_SUCCESS) {
|
if (get_plus_signature(signature, &signature_len) == PM3_SUCCESS) {
|
||||||
if (supportVersion) {
|
if (supportVersion) {
|
||||||
plus_print_signature(uid7b, 7, signature, signature_len);
|
if (Version4BUID) {
|
||||||
|
plus_print_signature(uid4b, 4, signature, signature_len);
|
||||||
|
} else {
|
||||||
|
plus_print_signature(uid7b, 7, signature, signature_len);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
plus_print_signature(card.uid, card.uidlen, signature, signature_len);
|
plus_print_signature(card.uid, card.uidlen, signature, signature_len);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue