mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-24 00:50:27 +08:00
Add support for: proxmark3 -c "hw ping;hw version;hw ping"
This commit is contained in:
parent
a60b2f24a8
commit
d3cc0bb71c
1 changed files with 8 additions and 3 deletions
|
@ -62,6 +62,9 @@ main_loop(char *script_cmds_file, char *script_cmd, bool pm3_present) {
|
||||||
|
|
||||||
char *cmd = NULL;
|
char *cmd = NULL;
|
||||||
bool execCommand = (script_cmd != NULL);
|
bool execCommand = (script_cmd != NULL);
|
||||||
|
uint16_t script_cmd_len = strlen(script_cmd);
|
||||||
|
if (execCommand)
|
||||||
|
strcreplace(script_cmd, script_cmd_len, ';', '\0');
|
||||||
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
bool stdinOnPipe = !isatty(STDIN_FILENO);
|
||||||
FILE *sf = NULL;
|
FILE *sf = NULL;
|
||||||
char script_cmd_buf[256] = {0x00}; // iceman, needs lua script the same file_path_buffer as the rest
|
char script_cmd_buf[256] = {0x00}; // iceman, needs lua script the same file_path_buffer as the rest
|
||||||
|
@ -134,11 +137,13 @@ main_loop(char *script_cmds_file, char *script_cmd, bool pm3_present) {
|
||||||
} else {
|
} else {
|
||||||
// If there is a script command
|
// If there is a script command
|
||||||
if (execCommand) {
|
if (execCommand) {
|
||||||
|
|
||||||
if ((cmd = strmcopy(script_cmd)) != NULL)
|
if ((cmd = strmcopy(script_cmd)) != NULL)
|
||||||
PrintAndLogEx(NORMAL, PROXPROMPT"%s", cmd);
|
PrintAndLogEx(NORMAL, PROXPROMPT"%s", cmd);
|
||||||
|
uint16_t len = strlen(script_cmd) + 1;
|
||||||
|
script_cmd += len;
|
||||||
|
if (script_cmd_len == len - 1)
|
||||||
execCommand = false;
|
execCommand = false;
|
||||||
|
script_cmd_len -= len;
|
||||||
} else {
|
} else {
|
||||||
// exit after exec command
|
// exit after exec command
|
||||||
if (script_cmd)
|
if (script_cmd)
|
||||||
|
|
Loading…
Reference in a new issue