mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
style
This commit is contained in:
parent
555fe1566f
commit
59bc927698
4 changed files with 40 additions and 38 deletions
|
@ -1237,10 +1237,10 @@ static int CmdEM4x70AutoRecover(const char *Cmd) {
|
||||||
return result;
|
return result;
|
||||||
} else if (memcmp(&opts.grn, &tag_grn, sizeof(ID48LIB_GRN)) != 0) {
|
} else if (memcmp(&opts.grn, &tag_grn, sizeof(ID48LIB_GRN)) != 0) {
|
||||||
PrintAndLogEx(FAILED, "Authenticating with new key returned %02x %02x %02x"
|
PrintAndLogEx(FAILED, "Authenticating with new key returned %02x %02x %02x"
|
||||||
, tag_grn.grn.grn[0]
|
, tag_grn.grn.grn[0]
|
||||||
, tag_grn.grn.grn[1]
|
, tag_grn.grn.grn[1]
|
||||||
, tag_grn.grn.grn[2]
|
, tag_grn.grn.grn[2]
|
||||||
);
|
);
|
||||||
PrintAndLogEx(FAILED, "Expected %s [maybe 5 lsb of key wrong?] ( " _RED_("fail") " )", grn_string);
|
PrintAndLogEx(FAILED, "Expected %s [maybe 5 lsb of key wrong?] ( " _RED_("fail") " )", grn_string);
|
||||||
result = PM3_EWRONGANSWER;
|
result = PM3_EWRONGANSWER;
|
||||||
return result;
|
return result;
|
||||||
|
@ -1308,10 +1308,10 @@ static int CmdEM4x70AutoRecover(const char *Cmd) {
|
||||||
return result;
|
return result;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(INFO, " Found: Partial key in block %d is " _GREEN_("%02X%02X")
|
PrintAndLogEx(INFO, " Found: Partial key in block %d is " _GREEN_("%02X%02X")
|
||||||
, block
|
, block
|
||||||
, brute.partial_key[0]
|
, brute.partial_key[0]
|
||||||
, brute.partial_key[1]
|
, brute.partial_key[1]
|
||||||
);
|
);
|
||||||
// Save the partial key...
|
// Save the partial key...
|
||||||
if (block == 9) {
|
if (block == 9) {
|
||||||
opts.key.k[0] = brute.partial_key[0];
|
opts.key.k[0] = brute.partial_key[0];
|
||||||
|
@ -1376,15 +1376,15 @@ static int CmdEM4x70AutoRecover(const char *Cmd) {
|
||||||
for (uint8_t idx = 0; idx < data.potential_key_count; ++idx) {
|
for (uint8_t idx = 0; idx < data.potential_key_count; ++idx) {
|
||||||
ID48LIB_KEY q = data.potential_keys[idx];
|
ID48LIB_KEY q = data.potential_keys[idx];
|
||||||
PrintAndLogEx(DEBUG, " Potential Key %d: %s %02X%02X%02X%02X%02X%02X"
|
PrintAndLogEx(DEBUG, " Potential Key %d: %s %02X%02X%02X%02X%02X%02X"
|
||||||
, idx
|
, idx
|
||||||
, key_string
|
, key_string
|
||||||
, q.k[ 6]
|
, q.k[ 6]
|
||||||
, q.k[ 7]
|
, q.k[ 7]
|
||||||
, q.k[ 8]
|
, q.k[ 8]
|
||||||
, q.k[ 9]
|
, q.k[ 9]
|
||||||
, q.k[10]
|
, q.k[10]
|
||||||
, q.k[11]
|
, q.k[11]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
last_successful_step = 5;
|
last_successful_step = 5;
|
||||||
}
|
}
|
||||||
|
|
|
@ -106,22 +106,22 @@ static void showBanner_logo(LogoMode mode) {
|
||||||
}
|
}
|
||||||
|
|
||||||
static uint8_t detect_current_lang(void) {
|
static uint8_t detect_current_lang(void) {
|
||||||
#ifndef _WIN32
|
#ifndef _WIN32
|
||||||
const char* lang = setlocale(LC_ALL, "");
|
const char *lang = setlocale(LC_ALL, "");
|
||||||
if (lang == NULL) {
|
if (lang == NULL) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (memcmp(lang, "fr", 2) == 0) {
|
if (memcmp(lang, "fr", 2) == 0) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
if (memcmp(lang, "es", 2) == 0) {
|
if (memcmp(lang, "es", 2) == 0) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const char* get_quote(void) {
|
static const char *get_quote(void) {
|
||||||
|
|
||||||
const char *quotes_en[] = {
|
const char *quotes_en[] = {
|
||||||
"Fund creativity, empower dreams",
|
"Fund creativity, empower dreams",
|
||||||
|
@ -193,9 +193,11 @@ static const char* get_quote(void) {
|
||||||
int r = rand() % ARRAYLEN(quotes_en);
|
int r = rand() % ARRAYLEN(quotes_en);
|
||||||
|
|
||||||
uint8_t lang = detect_current_lang();
|
uint8_t lang = detect_current_lang();
|
||||||
switch(lang) {
|
switch (lang) {
|
||||||
case 2: return quotes_fr[r];
|
case 2:
|
||||||
case 3: return quotes_es[r];
|
return quotes_fr[r];
|
||||||
|
case 3:
|
||||||
|
return quotes_es[r];
|
||||||
case 1:
|
case 1:
|
||||||
default:
|
default:
|
||||||
return quotes_en[r];
|
return quotes_en[r];
|
||||||
|
|
|
@ -12568,6 +12568,6 @@
|
||||||
"metadata": {
|
"metadata": {
|
||||||
"commands_extracted": 725,
|
"commands_extracted": 725,
|
||||||
"extracted_by": "PM3Help2JSON v1.00",
|
"extracted_by": "PM3Help2JSON v1.00",
|
||||||
"extracted_on": "2024-03-14T10:14:29"
|
"extracted_on": "2024-03-16T18:47:48"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue