X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/593fc3c9a334aec3a21d289cec9c8f760239c058..b61e397962e6acd472b490218162f10584880ade:/client/cmdhfmfu.c diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index 69f2fe44..dc246de5 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -17,9 +17,12 @@ #include "data.h" #define MAX_UL_BLOCKS 0x0f -#define MAX_ULC_BLOCKS 0x2b +#define MAX_ULC_BLOCKS 0x2b #define MAX_ULEV1a_BLOCKS 0x12 #define MAX_ULEV1b_BLOCKS 0x20 +#define MAX_NTAG_203 0x2c +#define MAX_NTAG_210 0x13 +#define MAX_NTAG_212 0x28 #define MAX_NTAG_213 0x2c #define MAX_NTAG_215 0x86 #define MAX_NTAG_216 0xe6 @@ -51,12 +54,15 @@ uint8_t default_pwd_pack[KEYS_PWD_COUNT][4] = { {0x32,0x0C,0x16,0x17}, // PACK 0x80,0x80 -- AMiiboo (sniffed) }; -#define MAX_UL_TYPES 13 +#define MAX_UL_TYPES 16 uint16_t UL_TYPES_ARRAY[MAX_UL_TYPES] = {UNKNOWN, UL, UL_C, UL_EV1_48, UL_EV1_128, - NTAG, NTAG_213, NTAG_215, NTAG_216, MY_D, MY_D_NFC, MY_D_MOVE, MY_D_MOVE_NFC}; -uint8_t UL_MEMORY_ARRAY[MAX_UL_TYPES] = {MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_ULC_BLOCKS, - MAX_ULEV1a_BLOCKS, MAX_ULEV1b_BLOCKS, MAX_NTAG_213, MAX_NTAG_213, MAX_NTAG_215, - MAX_NTAG_216, MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_UL_BLOCKS}; + NTAG, NTAG_203, NTAG_210, NTAG_212, NTAG_213, NTAG_215, NTAG_216, + MY_D, MY_D_NFC, MY_D_MOVE, MY_D_MOVE_NFC}; +uint8_t UL_MEMORY_ARRAY[MAX_UL_TYPES] = { + MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_ULC_BLOCKS, + MAX_ULEV1a_BLOCKS, MAX_ULEV1b_BLOCKS, + MAX_NTAG_213, MAX_NTAG_203, MAX_NTAG_210, MAX_NTAG_212, MAX_NTAG_213, MAX_NTAG_215, MAX_NTAG_216, + MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_UL_BLOCKS, MAX_UL_BLOCKS}; static int CmdHelp(const char *Cmd); @@ -292,9 +298,9 @@ static int ul_print_default( uint8_t *data){ 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) { PrintAndLog("no NDEF message"); @@ -333,6 +339,10 @@ int ul_print_type(uint16_t tagtype, uint8_t spaces){ PrintAndLog("%sTYPE : MIFARE Ultralight EV1 128bytes (MF0UL2101)", spacer); else if ( tagtype & NTAG_203 ) PrintAndLog("%sTYPE : NTAG 203 144bytes (NT2H0301G0DU)", spacer); + else if ( tagtype & NTAG_210 ) + PrintAndLog("%sTYPE : NTAG 210 48bytes (NT2L1011G0DU)", spacer); + else if ( tagtype & NTAG_212 ) + PrintAndLog("%sTYPE : NTAG 212 1284bytes (NT2L1011G0DU)", spacer); else if ( tagtype & NTAG_213 ) PrintAndLog("%sTYPE : NTAG 213 144bytes (NT2H1311G0DU)", spacer); else if ( tagtype & NTAG_215 ) @@ -531,6 +541,10 @@ uint16_t GetHF14AMfU_Type(void){ tagtype = UL_EV1_48; else if ( version[2] == 0x03 && version[6] != 0x0B ) tagtype = UL_EV1_128; + else if ( version[2] == 0x04 && version[6] == 0x0B ) + tagtype = NTAG_210; + else if ( version[2] == 0x04 && version[6] == 0x0E ) + tagtype = NTAG_212; else if ( version[2] == 0x04 && version[6] == 0x0F ) tagtype = NTAG_213; else if ( version[2] == 0x04 && version[6] == 0x11 ) @@ -749,7 +763,7 @@ int CmdHF14AMfUInfo(const char *Cmd){ ulev1_print_configuration(ulev1_conf); } - if ((tagtype & (UL_EV1_48 | UL_EV1_128 | NTAG_213 | NTAG_215 | NTAG_216))) { + if ((tagtype & (UL_EV1_48 | UL_EV1_128 | NTAG_210 | NTAG_212 | NTAG_213 | NTAG_215 | NTAG_216))) { uint8_t version[10] = {0x00}; status = ulev1_getVersion(version, sizeof(version)); @@ -760,16 +774,12 @@ int CmdHF14AMfUInfo(const char *Cmd){ } 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) // 0 = limitless. - // 1-7 = ... should we even try then? - if ( authlim == 0 ){ + // 1-7 = limit. No automatic tries then. + // hasAuthKey, if we was called with key, skip test. + if ( authlim == 0 && !hasAuthKey ){ PrintAndLog("\n--- Known EV1/NTAG passwords."); len = 0; for (uint8_t i = 0; i < KEYS_PWD_COUNT; ++i ){ @@ -790,17 +800,16 @@ int CmdHF14AMfUInfo(const char *Cmd){ } } - if ((tagtype & (NTAG_213 | NTAG_215 | NTAG_216))){ - - uint8_t cc[16] = {0x00}; - status = ul_read(3, cc, sizeof(cc)); - if ( status == -1 ){ - PrintAndLog("Error: tag didn't answer to READ ntag"); - ul_switch_off_field(); - return status; - } - ntag_print_CC(cc); + // NDEF Message + uint8_t cc[16] = {0x00}; + status = ul_read(3, cc, sizeof(cc)); + if ( status == -1 ){ + PrintAndLog("Error: tag didn't answer to READ NDEF"); + ul_switch_off_field(); + return status; } + ndef_print_CC(cc); + ul_switch_off_field(); PrintAndLog("");