mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-20 21:33:19 -07:00
MFU info adjustments
This commit is contained in:
parent
75377d29d6
commit
abab60ae21
1 changed files with 16 additions and 15 deletions
|
@ -107,12 +107,11 @@ static int ul_send_cmd_raw( uint8_t *cmd, uint8_t cmdlen, uint8_t *response, uin
|
||||||
SendCommand(&c);
|
SendCommand(&c);
|
||||||
UsbCommand resp;
|
UsbCommand resp;
|
||||||
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return -1;
|
if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)) return -1;
|
||||||
|
if (resp.arg[0] < 1) return -1;
|
||||||
|
|
||||||
uint16_t resplen = (resp.arg[0] < responseLength) ? resp.arg[0] : responseLength;
|
uint16_t resplen = (resp.arg[0] < responseLength) ? resp.arg[0] : responseLength;
|
||||||
if (resp.arg[0] > 0) {
|
memcpy(response, resp.d.asBytes, resplen);
|
||||||
memcpy(response, resp.d.asBytes, resplen);
|
return resplen;
|
||||||
return resplen;
|
|
||||||
} else return -1;
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
static int ul_send_cmd_raw_crc( uint8_t *cmd, uint8_t cmdlen, uint8_t *response, uint16_t responseLength, bool append_crc ) {
|
static int ul_send_cmd_raw_crc( uint8_t *cmd, uint8_t cmdlen, uint8_t *response, uint16_t responseLength, bool append_crc ) {
|
||||||
|
@ -370,9 +369,9 @@ uint16_t GetHF14AMfU_Type(void){
|
||||||
ul_switch_off_field();
|
ul_switch_off_field();
|
||||||
return UL_ERROR;
|
return UL_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ultralight - ATQA / SAK
|
// Ultralight - ATQA / SAK
|
||||||
if ( card.atqa[1] != 0x00 && card.atqa[0] != 0x44 && card.sak != 0x00 ) {
|
if ( card.atqa[1] != 0x00 || card.atqa[0] != 0x44 || card.sak != 0x00 ) {
|
||||||
|
PrintAndLog ("Tag is not UL or NTAG, ATQA1: %x, ATQA0: %x, SAK: %d", card.atqa[1],card.atqa[0],card.sak);
|
||||||
ul_switch_off_field();
|
ul_switch_off_field();
|
||||||
return UL_ERROR;
|
return UL_ERROR;
|
||||||
}
|
}
|
||||||
|
@ -419,13 +418,15 @@ uint16_t GetHF14AMfU_Type(void){
|
||||||
// Magic UL-C, by observation,
|
// Magic UL-C, by observation,
|
||||||
// it seems to have a static nonce response to 0x1A command.
|
// it seems to have a static nonce response to 0x1A command.
|
||||||
status = ul_select(&card);
|
status = ul_select(&card);
|
||||||
|
if ( status < 1 ){
|
||||||
|
PrintAndLog("Error: couldn't select B");
|
||||||
|
ul_switch_off_field();
|
||||||
|
return UL_ERROR;
|
||||||
|
}
|
||||||
status = ulc_requestAuthentication(0, nonce1, sizeof(nonce1));
|
status = ulc_requestAuthentication(0, nonce1, sizeof(nonce1));
|
||||||
if ( status > 0 ) {
|
if ( status > 0 ) {
|
||||||
|
|
||||||
status = ulc_requestAuthentication(0, nonce2, sizeof(nonce2));
|
status = ulc_requestAuthentication(0, nonce2, sizeof(nonce2));
|
||||||
|
|
||||||
tagtype =( !memcmp(nonce1, nonce2, 11) ) ? UL_C_MAGIC : UL_C;
|
tagtype =( !memcmp(nonce1, nonce2, 11) ) ? UL_C_MAGIC : UL_C;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
tagtype = UL;
|
tagtype = UL;
|
||||||
}
|
}
|
||||||
|
@ -451,12 +452,12 @@ int CmdHF14AMfUInfo(const char *Cmd){
|
||||||
uint8_t *key;
|
uint8_t *key;
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
PrintAndLog("\n--- Tag Information ---------");
|
|
||||||
PrintAndLog("-------------------------------------------------------------");
|
|
||||||
|
|
||||||
TagTypeUL_t tagtype = GetHF14AMfU_Type();
|
TagTypeUL_t tagtype = GetHF14AMfU_Type();
|
||||||
if (tagtype == UL_ERROR) return -1;
|
if (tagtype == UL_ERROR) return -1;
|
||||||
|
|
||||||
|
PrintAndLog("\n--- Tag Information ---------");
|
||||||
|
PrintAndLog("-------------------------------------------------------------");
|
||||||
ul_print_type(tagtype);
|
ul_print_type(tagtype);
|
||||||
|
|
||||||
status = ul_select(&card);
|
status = ul_select(&card);
|
||||||
|
@ -483,11 +484,11 @@ int CmdHF14AMfUInfo(const char *Cmd){
|
||||||
status = ul_read(0x28, ulc_conf, sizeof(ulc_conf));
|
status = ul_read(0x28, ulc_conf, sizeof(ulc_conf));
|
||||||
if ( status == -1 ){
|
if ( status == -1 ){
|
||||||
PrintAndLog("Error: tag didn't answer to READ - possibly locked");
|
PrintAndLog("Error: tag didn't answer to READ - possibly locked");
|
||||||
//ul_switch_off_field();
|
ul_switch_off_field();
|
||||||
//return status;
|
return status;
|
||||||
|
}
|
||||||
|
|
||||||
//tag may be locked
|
ulc_print_configuration(ulc_conf);
|
||||||
} else ulc_print_configuration(ulc_conf);
|
|
||||||
|
|
||||||
if ((tagtype & MAGIC)){
|
if ((tagtype & MAGIC)){
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue