This commit is contained in:
iceman1001 2020-06-30 18:50:38 +02:00
commit 1ec2a83e39

View file

@ -157,7 +157,6 @@ static void print_result(const em4x50_word_t *words, int fwr, int lwr, bool verb
strcat(string, pstring); strcat(string, pstring);
} }
} else { } else {
string[0] = '\0'; string[0] = '\0';
sprintf(pstring, "[" _GREEN_("+") "] word[%i]: " _YELLOW_("0x"), i); sprintf(pstring, "[" _GREEN_("+") "] word[%i]: " _YELLOW_("0x"), i);
strcat(string, pstring); strcat(string, pstring);
@ -167,7 +166,6 @@ static void print_result(const em4x50_word_t *words, int fwr, int lwr, bool verb
strcat(string, pstring); strcat(string, pstring);
} }
} }
PrintAndLogEx(INFO, string); PrintAndLogEx(INFO, string);
} }
} }
@ -188,7 +186,6 @@ static void print_info_result(uint8_t *data, bool verbose) {
int fwwi = reflect8(words[EM4X50_PROTECTION].byte[FIRST_WORD_WRITE_INHIBITED]); int fwwi = reflect8(words[EM4X50_PROTECTION].byte[FIRST_WORD_WRITE_INHIBITED]);
int lwwi = reflect8(words[EM4X50_PROTECTION].byte[LAST_WORD_WRITE_INHIBITED]); int lwwi = reflect8(words[EM4X50_PROTECTION].byte[LAST_WORD_WRITE_INHIBITED]);
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " ---------------------------"); PrintAndLogEx(INFO, "--- " _CYAN_("Tag Information") " ---------------------------");
PrintAndLogEx(INFO, "-------------------------------------------------------------"); PrintAndLogEx(INFO, "-------------------------------------------------------------");
@ -198,10 +195,7 @@ static void print_info_result(uint8_t *data, bool verbose) {
PrintAndLogEx(INFO, _YELLOW_("EM4x50 data:")); PrintAndLogEx(INFO, _YELLOW_("EM4x50 data:"));
if (verbose) { if (verbose) {
// detailed data section
print_result(words, 0, EM4X50_NO_WORDS - 1, true); print_result(words, 0, EM4X50_NO_WORDS - 1, true);
} else { } else {
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
@ -210,7 +204,6 @@ static void print_info_result(uint8_t *data, bool verbose) {
// condensed data section // condensed data section
for (int i = 0; i < EM4X50_NO_WORDS; i++) { for (int i = 0; i < EM4X50_NO_WORDS; i++) {
char s[50] = {0}; char s[50] = {0};
switch(i) { switch(i) {
case EM4X50_DEVICE_PASSWORD: case EM4X50_DEVICE_PASSWORD:
@ -237,7 +230,6 @@ static void print_info_result(uint8_t *data, bool verbose) {
} }
PrintAndLogEx(INFO, "----+-------------+----------------------------------"); PrintAndLogEx(INFO, "----+-------------+----------------------------------");
// configuration section // configuration section
PrintAndLogEx(NORMAL, ""); PrintAndLogEx(NORMAL, "");
PrintAndLogEx(INFO, "---- " _CYAN_("Configuration") " ----"); PrintAndLogEx(INFO, "---- " _CYAN_("Configuration") " ----");
@ -264,7 +256,7 @@ bool detect_4x50_block(void) {
.addr_given = true, .addr_given = true,
.address = EM4X50_DEVICE_ID, .address = EM4X50_DEVICE_ID,
}; };
em4x50_word_t words[EM4X50_NO_WORDS] = {0}; em4x50_word_t words[EM4X50_NO_WORDS];
return (em4x50_read(&etd, words, false) == PM3_SUCCESS); return (em4x50_read(&etd, words, false) == PM3_SUCCESS);
} }
@ -274,7 +266,7 @@ int read_em4x50_uid(void) {
.addr_given = true, .addr_given = true,
.address = EM4X50_DEVICE_SERIAL, .address = EM4X50_DEVICE_SERIAL,
}; };
em4x50_word_t words[EM4X50_NO_WORDS] = {0}; em4x50_word_t words[EM4X50_NO_WORDS];
int res = em4x50_read(&etd, words, false); int res = em4x50_read(&etd, words, false);
if (res == PM3_SUCCESS) if (res == PM3_SUCCESS)
PrintAndLogEx(INFO, " Serial: " _GREEN_("%s"), sprint_hex(words[EM4X50_DEVICE_SERIAL].byte, 4)); PrintAndLogEx(INFO, " Serial: " _GREEN_("%s"), sprint_hex(words[EM4X50_DEVICE_SERIAL].byte, 4));