mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
cleaning out the helptext
mingw got some bad asciiarts
This commit is contained in:
parent
4ab2212346
commit
4572acc1eb
1 changed files with 55 additions and 35 deletions
|
@ -28,21 +28,28 @@
|
||||||
#include "whereami.h"
|
#include "whereami.h"
|
||||||
#include "comms.h"
|
#include "comms.h"
|
||||||
|
|
||||||
#if defined(__linux__) || (__APPLE__)
|
|
||||||
static void showBanner(void) {
|
static void showBanner(void) {
|
||||||
printf("\n\n");
|
printf("\n\n");
|
||||||
|
#if defined(__linux__) || (__APPLE__)
|
||||||
printf("\e[34m██████╗ ███╗ ███╗ ████╗\e[0m ...iceman fork\n");
|
printf("\e[34m██████╗ ███╗ ███╗ ████╗\e[0m ...iceman fork\n");
|
||||||
printf("\e[34m██╔══██╗████╗ ████║ ══█║\e[0m ...dedicated to \e[34mRDV40\e[0m\n");
|
printf("\e[34m██╔══██╗████╗ ████║ ══█║\e[0m ...dedicated to \e[34mRDV40\e[0m\n");
|
||||||
printf("\e[34m██████╔╝██╔████╔██║ ████╔╝\e[0m\n");
|
printf("\e[34m██████╔╝██╔████╔██║ ████╔╝\e[0m\n");
|
||||||
printf("\e[34m██╔═══╝ ██║╚██╔╝██║ ══█║\e[0m iceman@icesql.net\n");
|
printf("\e[34m██╔═══╝ ██║╚██╔╝██║ ══█║\e[0m iceman@icesql.net\n");
|
||||||
printf("\e[34m██║ ██║ ╚═╝ ██║ ████╔╝\e[0m https://github.com/iceman1001/proxmark3\n");
|
printf("\e[34m██║ ██║ ╚═╝ ██║ ████╔╝\e[0m https://github.com/rfidresearchgroup/proxmark3/\n");
|
||||||
printf("\e[34m╚═╝ ╚═╝ ╚═╝ ╚═══╝\e[0m pre v4.0\n");
|
printf("\e[34m╚═╝ ╚═╝ ╚═╝ ╚═══╝\e[0m pre-release v4.0\n");
|
||||||
printf("\nKeep iceman fork alive with a donation! https://paypal.me/iceman1001/");
|
#else
|
||||||
printf("\nMONERO: 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
printf("======. ===. ===. ====. ...iceman fork\n");
|
||||||
|
printf("==...==.====. ====. ..=. ...dedicated to RDV40\n");
|
||||||
|
printf("======..==.====.==. ====..\n");
|
||||||
|
printf("==..... ==..==..==. ..=. iceman@icesql.net\n");
|
||||||
|
printf("==. ==. ... ==. ====.. https://github.com/rfidresearchgroup/proxmark3/\n");
|
||||||
|
printf("... ... ... ..... pre-release v4.0\n");
|
||||||
|
#endif
|
||||||
|
printf("\nSupport iceman on patreon, https://www.patreon.com/iceman1001/");
|
||||||
|
// printf("\nMonero: 43mNJLpgBVaTvyZmX9ajcohpvVkaRy1kbZPm8tqAb7itZgfuYecgkRF36rXrKFUkwEGeZedPsASRxgv4HPBHvJwyJdyvQuP");
|
||||||
printf("\n\n\n");
|
printf("\n\n\n");
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
#ifdef __has_attribute
|
#ifdef __has_attribute
|
||||||
|
@ -216,7 +223,9 @@ const char *get_my_executable_directory(void) {
|
||||||
|
|
||||||
static void set_my_executable_path(void) {
|
static void set_my_executable_path(void) {
|
||||||
int path_length = wai_getExecutablePath(NULL, 0, NULL);
|
int path_length = wai_getExecutablePath(NULL, 0, NULL);
|
||||||
if (path_length != -1) {
|
if (path_length == -1)
|
||||||
|
return;
|
||||||
|
|
||||||
my_executable_path = (char *)calloc(path_length + 1, sizeof(uint8_t));
|
my_executable_path = (char *)calloc(path_length + 1, sizeof(uint8_t));
|
||||||
int dirname_length = 0;
|
int dirname_length = 0;
|
||||||
if (wai_getExecutablePath(my_executable_path, path_length, &dirname_length) != -1) {
|
if (wai_getExecutablePath(my_executable_path, path_length, &dirname_length) != -1) {
|
||||||
|
@ -225,28 +234,32 @@ static void set_my_executable_path(void) {
|
||||||
strncpy(my_executable_directory, my_executable_path, dirname_length + 1);
|
strncpy(my_executable_directory, my_executable_path, dirname_length + 1);
|
||||||
my_executable_directory[dirname_length + 1] = '\0';
|
my_executable_directory[dirname_length + 1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void show_help(bool showFullHelp, char *command_line) {
|
static void show_help(bool showFullHelp, char *command_line) {
|
||||||
PrintAndLogEx(NORMAL, "syntax: %s <port> [-h | -help | -m | -f | -flush | -w | -wait | -c | -command | -l | -lua] [cmd_script_file_name] [command][lua_script_name]\n", command_line);
|
PrintAndLogEx(NORMAL, "");
|
||||||
PrintAndLogEx(NORMAL, "\texample:'%s "SERIAL_PORT_H"'\n\n", command_line);
|
PrintAndLogEx(NORMAL, "syntax: %s <port> [ -h -m -f -w ] [-c <command>] [-l <lua_script_file>] [<cmd_script_file_name]\n", command_line);
|
||||||
|
|
||||||
if (showFullHelp) {
|
if (showFullHelp) {
|
||||||
PrintAndLogEx(NORMAL, "help: <-h|-help> Dump all interactive command's help at once.\n");
|
PrintAndLogEx(NORMAL, "options:");
|
||||||
PrintAndLogEx(NORMAL, "\t%s -h\n\n", command_line);
|
PrintAndLogEx(NORMAL, " -h dump all interactive command's help at once");
|
||||||
PrintAndLogEx(NORMAL, "markdown: <-m> Dump all interactive help at once in markdown syntax\n");
|
PrintAndLogEx(NORMAL, " -m dump all interactive help at once in markdown syntax");
|
||||||
PrintAndLogEx(NORMAL, "\t%s -m\n\n", command_line);
|
PrintAndLogEx(NORMAL, " -f output will be flushed after every print");
|
||||||
PrintAndLogEx(NORMAL, "flush: <-f|-flush> Output will be flushed after every print.\n");
|
PrintAndLogEx(NORMAL, " -w 20sec waiting the serial port to appear in the OS");
|
||||||
PrintAndLogEx(NORMAL, "\t%s -f\n\n", command_line);
|
PrintAndLogEx(NORMAL, " -c <command> execute one proxmark3 command.");
|
||||||
PrintAndLogEx(NORMAL, "wait: <-w|-wait> 20sec waiting the serial port to appear in the OS\n");
|
PrintAndLogEx(NORMAL, " -l <lua script file> execute lua script.");
|
||||||
PrintAndLogEx(NORMAL, "\t%s "SERIAL_PORT_H" -w\n\n", command_line);
|
PrintAndLogEx(NORMAL, " <cmd_script_file> script file with one proxmark3 command per line");
|
||||||
PrintAndLogEx(NORMAL, "script: A script file with one proxmark3 command per line.\n\n");
|
PrintAndLogEx(NORMAL, "\nsamples:");
|
||||||
PrintAndLogEx(NORMAL, "command: <-c|-command> Execute one proxmark3 command.\n");
|
PrintAndLogEx(NORMAL, " %s -h\n", command_line);
|
||||||
PrintAndLogEx(NORMAL, "\t%s "SERIAL_PORT_H" -c \"hf mf chk 1* ?\"\n", command_line);
|
PrintAndLogEx(NORMAL, " %s -m\n", command_line);
|
||||||
PrintAndLogEx(NORMAL, "\t%s "SERIAL_PORT_H" -command \"hf mf nested 1 *\"\n\n", command_line);
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" -f -- flush output everytime\n", command_line);
|
||||||
PrintAndLogEx(NORMAL, "lua: <-l|-lua> Execute lua script.\n");
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" -w -- wait for serial port\n", command_line);
|
||||||
PrintAndLogEx(NORMAL, "\t%s "SERIAL_PORT_H" -l hf_read\n\n", command_line);
|
PrintAndLogEx(NORMAL, "\n how to run proxmark3 client\n");
|
||||||
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" -- runs the pm3 client\n", command_line);
|
||||||
|
PrintAndLogEx(NORMAL, "\n how to execute different commands from terminal\n");
|
||||||
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" -c \"hf mf chk 1* ?\" -- execute cmd and quit client\n", command_line);
|
||||||
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" -l hf_read -- execute lua script " _YELLOW_("`hf_read`")"and quit client\n", command_line);
|
||||||
|
PrintAndLogEx(NORMAL, " %s "SERIAL_PORT_H" mycmds.txt -- execute each pm3 cmd in file and quit client\n", command_line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -271,7 +284,17 @@ int main(int argc, char *argv[]) {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
|
|
||||||
|
#if defined(_WIN32)
|
||||||
|
for (int m = strlen(argv[0]); m > 0; m--) {
|
||||||
|
if ( argv[0][m] == '\\' ) {
|
||||||
|
show_help(true, argv[0] + (++m) );
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
show_help(true, argv[0]);
|
show_help(true, argv[0]);
|
||||||
|
#endif
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -380,13 +403,10 @@ int main(int argc, char *argv[]) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__linux__) || (__APPLE__)
|
// ascii art
|
||||||
// ascii art doesn't work well on mingw :(
|
|
||||||
|
|
||||||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||||
if (!executeCommand && !script_cmds_file && !stdinOnPipe)
|
if (!executeCommand && !script_cmds_file && !stdinOnPipe)
|
||||||
showBanner();
|
showBanner();
|
||||||
#endif
|
|
||||||
|
|
||||||
// set global variables
|
// set global variables
|
||||||
set_my_executable_path();
|
set_my_executable_path();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue