make style

This commit is contained in:
Philippe Teuwen 2019-03-15 00:20:42 +01:00
commit b538a67ba3
2 changed files with 27 additions and 27 deletions

View file

@ -348,17 +348,17 @@ static void printHitagConfiguration(uint8_t config) {
memset(msg, 0, sizeof(msg));
// encoding
if (config & 0x1) {
strcat(msg, "Biphase encoding");
strcat(msg, "Biphase encoding");
} else {
strcat(msg, "Manchester encoding");
}
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
// version
strcat(msg, "Coding in HITAG 2 operation: %s");
uint8_t foo = (config & 0x6) >> 1;
switch ( foo ) {
switch (foo) {
case 0:
PrintAndLogEx(SUCCESS, "Version: public mode B, Coding: biphase");
PrintAndLogEx(SUCCESS, msg, (config & 0x1) ? "biphase" : "manchester");
@ -366,60 +366,60 @@ static void printHitagConfiguration(uint8_t config) {
case 1:
PrintAndLogEx(SUCCESS, "Version: public mode A, Coding: manchester");
PrintAndLogEx(SUCCESS, msg, (config & 0x1) ? "biphase" : "manchester");
break;
break;
case 2:
PrintAndLogEx(SUCCESS, "Version: public mode C, Coding: biphase");
PrintAndLogEx(SUCCESS, msg, (config & 0x1) ? "biphase" : "manchester");
break;
break;
case 3:
PrintAndLogEx(SUCCESS, "Version: Hitag2");
PrintAndLogEx(SUCCESS, msg, (config & 0x1) ? "biphase" : "manchester");
break;
}
memset(msg, 0, sizeof(msg));
// mode
if (config & 0x8) {
strcat(msg, "Tag is in : " _YELLOW_("Crypto mode") );
strcat(msg, "Tag is in : " _YELLOW_("Crypto mode"));
} else {
strcat(msg, "Tag is in : " _YELLOW_("Password mode") );
strcat(msg, "Tag is in : " _YELLOW_("Password mode"));
}
PrintAndLogEx(SUCCESS, "%s", msg);
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
// page access
if (config & 0x10) {
strcat(msg, "Page 6,7 : read only");
} else {
strcat(msg, "Page 6,7 : " _GREEN_("read write"));
}
PrintAndLogEx(SUCCESS, "%s", msg);
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
// page access
if (config & 0x20) {
strcat(msg, "Page 4,5 : read only");
} else {
strcat(msg, "Page 4,5 : " _GREEN_("read write"));
}
PrintAndLogEx(SUCCESS, "%s", msg);
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
// OTP
if (config & 0x40) {
strcat(msg, "Page 3 : read only. Configuration byte and password tag " _RED_("FIXED / IRREVERSIBLE") );
strcat(msg, "Page 3 : read only. Configuration byte and password tag " _RED_("FIXED / IRREVERSIBLE"));
} else {
strcat(msg, "Page 3 : " _GREEN_("read write"));
}
PrintAndLogEx(SUCCESS, "%s", msg);
}
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
// OTP
if (config & 0x80) {
strcat(msg, "Page 1 " _RED_("locked") "\n");
if (config & 0x8) {
strcat(msg + strlen(msg), "Page 2 : " _RED_("locked") );
strcat(msg + strlen(msg), "Page 2 : " _RED_("locked"));
} else {
strcat(msg + strlen(msg), "Page 2 : read only");
}
@ -434,14 +434,14 @@ int CmdLFHitagInfo(const char *Cmd) {
PrintAndLogEx(INFO, "Hitag2 tag information ");
PrintAndLogEx(INFO, "To be done!");
PrintAndLogEx(INFO, "------------------------------------");
char ctmp = tolower(param_getchar(Cmd, 0));
if (ctmp == 'h') return usage_hitag_info();
// read block3, get configuration byte.
// common configurations.
printHitagConfiguration( 0x06 );
printHitagConfiguration(0x06);
//printHitagConfiguration( 0x0E );
//printHitagConfiguration( 0x02 );
//printHitagConfiguration( 0x00 );