mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-11-10 17:49:32 +08:00
style
This commit is contained in:
parent
c55b4d5aac
commit
64f9bb5e01
20 changed files with 135 additions and 135 deletions
|
@ -4529,11 +4529,11 @@ static void arg_cat_optionv(char *dest,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (datatype) {
|
if (datatype) {
|
||||||
/* if (longopts)
|
/* if (longopts)
|
||||||
arg_cat(&dest, "=", &ndest);
|
arg_cat(&dest, "=", &ndest);
|
||||||
else if (shortopts)
|
else if (shortopts)
|
||||||
arg_cat(&dest, " ", &ndest);
|
arg_cat(&dest, " ", &ndest);
|
||||||
*/
|
*/
|
||||||
if (longopts)
|
if (longopts)
|
||||||
arg_cat(&dest, " ", &ndest);
|
arg_cat(&dest, " ", &ndest);
|
||||||
else if (shortopts)
|
else if (shortopts)
|
||||||
|
|
|
@ -1924,7 +1924,7 @@ static int CmdTimeScale(const char *Cmd) {
|
||||||
}
|
}
|
||||||
int len = 0;
|
int len = 0;
|
||||||
CursorScaleFactorUnit[0] = '\x00';
|
CursorScaleFactorUnit[0] = '\x00';
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t*)CursorScaleFactorUnit, sizeof(CursorScaleFactorUnit), &len);
|
CLIParamStrToBuf(arg_get_str(ctx, 2), (uint8_t *)CursorScaleFactorUnit, sizeof(CursorScaleFactorUnit), &len);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
RepaintGraphWindow();
|
RepaintGraphWindow();
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
|
|
|
@ -91,7 +91,7 @@ static int CmdFlashMemLoad(const char *Cmd) {
|
||||||
bool is_t55xx = arg_get_lit(ctx, 4);
|
bool is_t55xx = arg_get_lit(ctx, 4);
|
||||||
int fnlen = 0;
|
int fnlen = 0;
|
||||||
char filename[FILE_PATH_SIZE] = {0};
|
char filename[FILE_PATH_SIZE] = {0};
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 5), (uint8_t*)filename, FILE_PATH_SIZE, &fnlen);
|
CLIParamStrToBuf(arg_get_str(ctx, 5), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
Dictionary_t d = DICTIONARY_NONE;
|
Dictionary_t d = DICTIONARY_NONE;
|
||||||
|
@ -244,7 +244,7 @@ static int CmdFlashMemDump(const char *Cmd) {
|
||||||
bool view = arg_get_lit(ctx, 3);
|
bool view = arg_get_lit(ctx, 3);
|
||||||
int fnlen = 0;
|
int fnlen = 0;
|
||||||
char filename[FILE_PATH_SIZE] = {0};
|
char filename[FILE_PATH_SIZE] = {0};
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 4), (uint8_t*)filename, FILE_PATH_SIZE, &fnlen);
|
CLIParamStrToBuf(arg_get_str(ctx, 4), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
uint8_t *dump = calloc(len, sizeof(uint8_t));
|
uint8_t *dump = calloc(len, sizeof(uint8_t));
|
||||||
|
@ -297,7 +297,7 @@ static int CmdFlashMemWipe(const char *Cmd) {
|
||||||
// initalwipe = arg_get_lit(ctx, 2);
|
// initalwipe = arg_get_lit(ctx, 2);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
if (page < 0 || page > 2 ) {
|
if (page < 0 || page > 2) {
|
||||||
PrintAndLogEx(WARNING, "page must be 0, 1 or 2");
|
PrintAndLogEx(WARNING, "page must be 0, 1 or 2");
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
}
|
}
|
||||||
|
@ -310,7 +310,7 @@ static int CmdFlashMemWipe(const char *Cmd) {
|
||||||
return PM3_ETIMEOUT;
|
return PM3_ETIMEOUT;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* msg = "Flash WIPE ";
|
const char *msg = "Flash WIPE ";
|
||||||
uint8_t isok = resp.oldarg[0] & 0xFF;
|
uint8_t isok = resp.oldarg[0] & 0xFF;
|
||||||
if (isok)
|
if (isok)
|
||||||
PrintAndLogEx(SUCCESS, "%s ( " _GREEN_("ok")" )", msg);
|
PrintAndLogEx(SUCCESS, "%s ( " _GREEN_("ok")" )", msg);
|
||||||
|
|
|
@ -2671,7 +2671,7 @@ static int CmdHFiClassView(const char *Cmd) {
|
||||||
|
|
||||||
int fnlen = 0;
|
int fnlen = 0;
|
||||||
char filename[FILE_PATH_SIZE];
|
char filename[FILE_PATH_SIZE];
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t*)filename, FILE_PATH_SIZE, &fnlen);
|
CLIParamStrToBuf(arg_get_str(ctx, 1), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||||
|
|
||||||
int startblock = arg_get_int_def(ctx, 2, 0);
|
int startblock = arg_get_int_def(ctx, 2, 0);
|
||||||
int endblock = arg_get_int_def(ctx, 3, 0);
|
int endblock = arg_get_int_def(ctx, 3, 0);
|
||||||
|
|
|
@ -995,7 +995,7 @@ static int CmdHF14AWSLoadBmp(const char *Cmd) {
|
||||||
|
|
||||||
int fnlen = 0;
|
int fnlen = 0;
|
||||||
char filename[FILE_PATH_SIZE] = {0};
|
char filename[FILE_PATH_SIZE] = {0};
|
||||||
CLIParamStrToBuf(arg_get_str(ctx, 3), (uint8_t*)filename, FILE_PATH_SIZE, &fnlen);
|
CLIParamStrToBuf(arg_get_str(ctx, 3), (uint8_t *)filename, FILE_PATH_SIZE, &fnlen);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
||||||
//Validations
|
//Validations
|
||||||
|
|
|
@ -957,7 +957,7 @@ static command_t setCommandTable[] = {
|
||||||
{"color", setCmdColor, AlwaysAvailable, "Set color support"},
|
{"color", setCmdColor, AlwaysAvailable, "Set color support"},
|
||||||
// {"defaultsavepaths", setCmdSavePaths, AlwaysAvailable, "... to be adjusted next ... "},
|
// {"defaultsavepaths", setCmdSavePaths, AlwaysAvailable, "... to be adjusted next ... "},
|
||||||
{"clientdebug", setCmdDebug, AlwaysAvailable, "Set client debug level"},
|
{"clientdebug", setCmdDebug, AlwaysAvailable, "Set client debug level"},
|
||||||
{"plotsliders",setCmdPlotSliders, AlwaysAvailable, "Set plot slider display"},
|
{"plotsliders", setCmdPlotSliders, AlwaysAvailable, "Set plot slider display"},
|
||||||
// {"devicedebug", setCmdDeviceDebug, AlwaysAvailable, "Set device debug level"},
|
// {"devicedebug", setCmdDeviceDebug, AlwaysAvailable, "Set device debug level"},
|
||||||
{NULL, NULL, NULL, NULL}
|
{NULL, NULL, NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
@ -820,13 +820,13 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
||||||
case Qt::Key_Up:
|
case Qt::Key_Up:
|
||||||
if (event->modifiers() & Qt::ShiftModifier) {
|
if (event->modifiers() & Qt::ShiftModifier) {
|
||||||
if (event->modifiers() & Qt::ControlModifier) {
|
if (event->modifiers() & Qt::ControlModifier) {
|
||||||
Zoom(1.0/zoom_offset, CursorBPos);
|
Zoom(1.0 / zoom_offset, CursorBPos);
|
||||||
} else {
|
} else {
|
||||||
Zoom(0.5, CursorBPos);
|
Zoom(0.5, CursorBPos);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (event->modifiers() & Qt::ControlModifier) {
|
if (event->modifiers() & Qt::ControlModifier) {
|
||||||
Zoom(1.0/zoom_offset, CursorAPos);
|
Zoom(1.0 / zoom_offset, CursorAPos);
|
||||||
} else {
|
} else {
|
||||||
Zoom(0.5, CursorAPos);
|
Zoom(0.5, CursorAPos);
|
||||||
}
|
}
|
||||||
|
@ -868,29 +868,29 @@ void Plot::keyPressEvent(QKeyEvent *event) {
|
||||||
g_printAndLog = PRINTANDLOG_PRINT;
|
g_printAndLog = PRINTANDLOG_PRINT;
|
||||||
PrintAndLogEx(NORMAL, "\n\n" _CYAN_("PLOT window keystrokes and mouse events"));
|
PrintAndLogEx(NORMAL, "\n\n" _CYAN_("PLOT window keystrokes and mouse events"));
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Move:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Move:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("Home") "/" _RED_("End"), "Move to the start/end of the graph");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Home") "/" _RED_("End"), "Move to the start/end of the graph");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _YELLOW_("Mouse wheel"), "Move left/right");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _YELLOW_("Mouse wheel"), "Move left/right");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("Left") "/" _RED_("Right"), "Move left/right");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Left") "/" _RED_("Right"), "Move left/right");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, " + " _RED_("Ctrl"), "... by 1 sample");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Ctrl"), "... by 1 sample");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, " + " _RED_("Shift"), "... by 1 window");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Shift"), "... by 1 window");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("PgUp") "/" _RED_("PgDown"), "Move left/right by 1 window");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("PgUp") "/" _RED_("PgDown"), "Move left/right by 1 window");
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Zoom:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Zoom:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("Shift") " + " _YELLOW_("Mouse wheel"), "Zoom in/out around mouse cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Shift") " + " _YELLOW_("Mouse wheel"), "Zoom in/out around mouse cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("Down") "/" _RED_("Up"), "Zoom in/out around yellow cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("Down") "/" _RED_("Up"), "Zoom in/out around yellow cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, " + " _RED_("Ctrl"), "... with smaller increment");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Ctrl"), "... with smaller increment");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, " + " _RED_("Shift"), "... around purple cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, " + " _RED_("Shift"), "... around purple cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("h"), "Show this help");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("h"), "Show this help");
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Trim:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Trim:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("t"), "Trim data on window or on cursors if defined");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("t"), "Trim data on window or on cursors if defined");
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Grid and demod:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Grid and demod:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("g"), "Toggle grid and demodulation plot display");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("g"), "Toggle grid and demodulation plot display");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("l"), "Toggle lock grid relative to samples");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("l"), "Toggle lock grid relative to samples");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9+9, _RED_("<") "/" _RED_(">"), "Move demodulation left/right relative to samples");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9 + 9, _RED_("<") "/" _RED_(">"), "Move demodulation left/right relative to samples");
|
||||||
PrintAndLogEx(NORMAL, "\n" _GREEN_("Misc:"));
|
PrintAndLogEx(NORMAL, "\n" _GREEN_("Misc:"));
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _YELLOW_("Left mouse click"), "Set yellow cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _YELLOW_("Left mouse click"), "Set yellow cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _YELLOW_("Right mouse click"), "Set purple cursor");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _YELLOW_("Right mouse click"), "Set purple cursor");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("h"), "Show this help");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("h"), "Show this help");
|
||||||
PrintAndLogEx(NORMAL, " %-*s%s", 25+9, _RED_("q"), "Close plot window");
|
PrintAndLogEx(NORMAL, " %-*s%s", 25 + 9, _RED_("q"), "Close plot window");
|
||||||
g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG;
|
g_printAndLog = PRINTANDLOG_PRINT | PRINTANDLOG_LOG;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -268,15 +268,13 @@ static void *brute_thread(void *arguments) {
|
||||||
printf("CMD enc(%08x)\n", cmd_enc);
|
printf("CMD enc(%08x)\n", cmd_enc);
|
||||||
printf(" dec(%08x)\t", decrypted);
|
printf(" dec(%08x)\t", decrypted);
|
||||||
|
|
||||||
uint8_t isOK = 0;
|
|
||||||
// check if cmd exists
|
// check if cmd exists
|
||||||
isOK = checkValidCmd(decrypted);
|
uint8_t isOK = checkValidCmd(decrypted);
|
||||||
(void)isOK;
|
(void)isOK;
|
||||||
|
|
||||||
// Add a crc-check.
|
// Add a crc-check.
|
||||||
isOK = checkCRC(decrypted);
|
isOK = checkCRC(decrypted);
|
||||||
|
if (isOK == false) {
|
||||||
if (!isOK) {
|
|
||||||
printf("<-- not a valid cmd\n");
|
printf("<-- not a valid cmd\n");
|
||||||
pthread_mutex_unlock(&print_lock);
|
pthread_mutex_unlock(&print_lock);
|
||||||
free(revstate);
|
free(revstate);
|
||||||
|
@ -305,6 +303,8 @@ static void *brute_thread(void *arguments) {
|
||||||
pthread_mutex_unlock(&print_lock);
|
pthread_mutex_unlock(&print_lock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (revstate)
|
||||||
|
free(revstate);
|
||||||
|
|
||||||
free(args);
|
free(args);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in a new issue