mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
1. updated usb commands
2. added abilities to: clear, get, set, load from card, load from nested card emulator dump 3. tried to fix proxmark promt have seen everywhere (not so good) 4. reorganized arm code
This commit is contained in:
parent
8f51ddb0bd
commit
8556b852ed
15 changed files with 1060 additions and 631 deletions
|
@ -13,6 +13,7 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <pthread.h>
|
||||
#include <unistd.h>
|
||||
#include <readline/readline.h>
|
||||
#include <readline/history.h>
|
||||
#include "proxusb.h"
|
||||
|
@ -40,7 +41,11 @@ static void *usb_receiver(void *targ)
|
|||
for (int i = 0; i < strlen(PROXPROMPT); i++)
|
||||
putchar(0x08);
|
||||
UsbCommandReceived(&cmdbuf);
|
||||
printf(PROXPROMPT);
|
||||
// there is a big bug )
|
||||
if (cmdbuf.cmd > 0x0100 && cmdbuf.cmd < 0x0110) { // debug commands
|
||||
rl_on_new_line_with_prompt();
|
||||
rl_forced_update_display();
|
||||
}
|
||||
fflush(NULL);
|
||||
}
|
||||
}
|
||||
|
@ -61,21 +66,28 @@ static void *main_loop(void *targ)
|
|||
pthread_create(&reader_thread, NULL, &usb_receiver, &rarg);
|
||||
}
|
||||
|
||||
while(1) {
|
||||
cmd = readline(PROXPROMPT);
|
||||
if (cmd) {
|
||||
while(cmd[strlen(cmd) - 1] == ' ')
|
||||
cmd[strlen(cmd) - 1] = 0x00;
|
||||
if (cmd[0] != 0x00) {
|
||||
CommandReceived(cmd);
|
||||
add_history(cmd);
|
||||
}
|
||||
free(cmd);
|
||||
} else {
|
||||
printf("\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
read_history(".history");
|
||||
while(1) {
|
||||
cmd = readline(PROXPROMPT);
|
||||
if (cmd) {
|
||||
while(cmd[strlen(cmd) - 1] == ' ')
|
||||
cmd[strlen(cmd) - 1] = 0x00;
|
||||
|
||||
if (cmd[0] != 0x00) {
|
||||
if (strncmp(cmd, "quit", 4) == 0) {
|
||||
write_history(".history");
|
||||
break;
|
||||
}
|
||||
|
||||
CommandReceived(cmd);
|
||||
add_history(cmd);
|
||||
}
|
||||
free(cmd);
|
||||
} else {
|
||||
printf("\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (arg->usb_present == 1) {
|
||||
rarg.run = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue