CHG: "hf mfu info" now always tries to read the NDEF CC. (was restricted to only NTAG213,215,216 before)

This commit is contained in:
iceman1001 2015-05-20 10:36:55 +02:00
commit e9bb4f47ee

View file

@ -292,9 +292,9 @@ static int ul_print_default( uint8_t *data){
return 0; return 0;
} }
static int ntag_print_CC(uint8_t *data) { static int ndef_print_CC(uint8_t *data) {
PrintAndLog("\n--- NTAG NDEF Message"); PrintAndLog("\n--- NDEF Message");
if(data[0] != 0xe1) { if(data[0] != 0xe1) {
PrintAndLog("no NDEF message"); PrintAndLog("no NDEF message");
@ -760,16 +760,12 @@ int CmdHF14AMfUInfo(const char *Cmd){
} }
ulev1_print_version(version); ulev1_print_version(version);
// if we called info with key, just return
if ( hasAuthKey ) {
ul_switch_off_field();
return 1;
}
// AUTHLIMIT, (number of failed authentications) // AUTHLIMIT, (number of failed authentications)
// 0 = limitless. // 0 = limitless.
// 1-7 = ... should we even try then? // 1-7 = limit. No automatic tries then.
if ( authlim == 0 ){ // hasAuthKey, if we was called with key, skip test.
if ( authlim == 0 && !hasAuthKey ){
PrintAndLog("\n--- Known EV1/NTAG passwords."); PrintAndLog("\n--- Known EV1/NTAG passwords.");
len = 0; len = 0;
for (uint8_t i = 0; i < KEYS_PWD_COUNT; ++i ){ for (uint8_t i = 0; i < KEYS_PWD_COUNT; ++i ){
@ -790,17 +786,16 @@ int CmdHF14AMfUInfo(const char *Cmd){
} }
} }
if ((tagtype & (NTAG_213 | NTAG_215 | NTAG_216))){ // NDEF Message
uint8_t cc[16] = {0x00}; uint8_t cc[16] = {0x00};
status = ul_read(3, cc, sizeof(cc)); status = ul_read(3, cc, sizeof(cc));
if ( status == -1 ){ if ( status == -1 ){
PrintAndLog("Error: tag didn't answer to READ ntag"); PrintAndLog("Error: tag didn't answer to READ NDEF");
ul_switch_off_field(); ul_switch_off_field();
return status; return status;
} }
ntag_print_CC(cc); ndef_print_CC(cc);
}
ul_switch_off_field(); ul_switch_off_field();
PrintAndLog(""); PrintAndLog("");