static char* serial_port_name;
void cmd_debug(UsbCommand* UC) {
- // Debug
- printf("UsbCommand length[len=%zd]\n",sizeof(UsbCommand));
- printf(" cmd[len=%zd]: %016"llx"\n",sizeof(UC->cmd),UC->cmd);
- printf(" arg0[len=%zd]: %016"llx"\n",sizeof(UC->arg[0]),UC->arg[0]);
- printf(" arg1[len=%zd]: %016"llx"\n",sizeof(UC->arg[1]),UC->arg[1]);
- printf(" arg2[len=%zd]: %016"llx"\n",sizeof(UC->arg[2]),UC->arg[2]);
- printf(" data[len=%zd]: ",sizeof(UC->d.asBytes));
- for (size_t i=0; i<16; i++) {
- printf("%02x",UC->d.asBytes[i]);
- }
- printf("...\n");
+ // Debug
+ printf("UsbCommand length[len=%zd]\n",sizeof(UsbCommand));
+ printf(" cmd[len=%zd]: %016"llx"\n",sizeof(UC->cmd),UC->cmd);
+ printf(" arg0[len=%zd]: %016"llx"\n",sizeof(UC->arg[0]),UC->arg[0]);
+ printf(" arg1[len=%zd]: %016"llx"\n",sizeof(UC->arg[1]),UC->arg[1]);
+ printf(" arg2[len=%zd]: %016"llx"\n",sizeof(UC->arg[2]),UC->arg[2]);
+ printf(" data[len=%zd]: ",sizeof(UC->d.asBytes));
+
+ for (size_t i=0; i<16; i++)
+ printf("%02x",UC->d.asBytes[i]);
+
+ printf("...\n");
}
void SendCommand(UsbCommand* txcmd) {
-// printf("send: ");
-// cmd_debug(txcmd);
- if (!uart_send(sp,(byte_t*)txcmd,sizeof(UsbCommand))) {
- printf("Sending bytes to proxmark failed\n");
- exit(1);
- }
+ // printf("send: ");
+ // cmd_debug(txcmd);
+ if (!uart_send(sp,(byte_t*)txcmd,sizeof(UsbCommand))) {
+ printf("Sending bytes to proxmark failed\n");
+ exit(1);
+ }
}
void ReceiveCommand(UsbCommand* rxcmd) {
- byte_t* prxcmd = (byte_t*)rxcmd;
- byte_t* prx = prxcmd;
- size_t rxlen;
- while (true) {
- rxlen = sizeof(UsbCommand) - (prx-prxcmd);
- if (uart_receive(sp,prx,&rxlen)) {
- prx += rxlen;
- if ((prx-prxcmd) >= sizeof(UsbCommand)) {
- return;
- }
- }
- }
+ byte_t* prxcmd = (byte_t*)rxcmd;
+ byte_t* prx = prxcmd;
+ size_t rxlen;
+ while (true) {
+ rxlen = sizeof(UsbCommand) - (prx-prxcmd);
+ if (uart_receive(sp,prx,&rxlen)) {
+ prx += rxlen;
+ if ((prx-prxcmd) >= sizeof(UsbCommand)) {
+ return;
+ }
+ }
+ }
}
void CloseProxmark() {
- // Clean up the port
- uart_close(sp);
- // Fix for linux, it seems that it is extremely slow to release the serial port file descriptor /dev/*
- unlink(serial_port_name);
+ // Clean up the port
+ uart_close(sp);
+ // Fix for linux, it seems that it is extremely slow to release the serial port file descriptor /dev/*
+ unlink(serial_port_name);
}
int OpenProxmark(size_t i) {
- sp = uart_open(serial_port_name);
- if (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT) {
- //poll once a second
- return 0;
- }
- return 1;
+ sp = uart_open(serial_port_name);
+
+ //poll once a second
+ if (sp == INVALID_SERIAL_PORT || sp == CLAIMED_SERIAL_PORT)
+ return 0;
+
+ return 1;
}
static void usage(char *argv0)
//Is the example below really true? /Martin
fprintf(stderr, "Example:\n\n\t %s path/to/osimage.elf path/to/fpgaimage.elf\n", argv0);
fprintf(stderr, "\nExample (Linux):\n\n\t %s /dev/ttyACM0 armsrc/obj/fullimage.elf\n", argv0);
+ fprintf(stderr, "\nExample (OS) :\n\n\t %s /dev/cu.usbmodem1451 armsrc/obj/fullimage.elf\n", argv0);
fprintf(stderr, "\nNote (Linux): if the flasher gets stuck in 'Waiting for Proxmark to reappear on <DEVICE>',\n");
fprintf(stderr, " you need to blacklist proxmark for modem-manager - see wiki for more details:\n");
- fprintf(stderr, " http://code.google.com/p/proxmark3/wiki/Linux\n\n");
+ fprintf(stderr, " old ref --> http://code.google.com/p/proxmark3/wiki/Linux\n\n");
+ fprintf(stderr, " new refs --> ");
+ fprintf(stderr, " https://github.com/Proxmark/proxmark3/wiki/Gentoo Linux\n\n");
+ fprintf(stderr, " https://github.com/Proxmark/proxmark3/wiki/Ubuntu Linux\n\n");
+ fprintf(stderr, " https://github.com/Proxmark/proxmark3/wiki/OSX\n\n");
}
#define MAX_FILES 4
}
}
- serial_port_name = argv[1];
+ serial_port_name = argv[1];
- fprintf(stderr,"Waiting for Proxmark to appear on %s",serial_port_name);
- do {
- sleep(1);
- fprintf(stderr, ".");
- } while (!OpenProxmark(0));
- fprintf(stderr," Found.\n");
-
- res = flash_start_flashing(can_write_bl,serial_port_name);
+ fprintf(stderr, "Waiting for Proxmark to appear on %s", serial_port_name);
+ do {
+ sleep(1);
+ fprintf(stderr, ".");
+ } while (!OpenProxmark(0));
+
+ fprintf(stderr," Found.\n");
+
+ res = flash_start_flashing(can_write_bl, serial_port_name);
if (res < 0)
return -1;
fprintf(stderr, "All done.\n\n");
fprintf(stderr, "Have a nice day!\n");
-
return 0;
}
{"3014", "c60b", "0030", "water", "SWAPFORCE", "Rip Tide"},
{"3015", "c70b", "0030", "water", "SWAPFORCE", "Punk Shock"},
+--All 16 Swap Force Characters
+{"2000", "d007", "0020", "air", "SWAPFORCE", "Boom"},
+{"1000", "e803", "0020", "air", "SWAPFORCE", "Jet (Rocket)"},
+{"2001", "d107", "0020", "air", "SWAPFORCE", "Free"},
+{"1001", "e903", "0020", "air", "SWAPFORCE", "Ranger (Spin)"},
+{"2002", "d207", "0020", "earth", "SWAPFORCE", "Rubble"},
+{"1002", "ea03", "0020", "earth", "SWAPFORCE", "Rouser (Dig)"},
+{"2003", "d307", "0020", "earth", "SWAPFORCE", "Doom"},
+{"1003", "eb03", "0020", "earth", "SWAPFORCE", "Stone (Spin)"},
+{"2004", "d407", "0020", "fire", "SWAPFORCE", "Blast"},
+{"1004", "ec03", "0020", "fire", "SWAPFORCE", "Zone (Rocket)"},
+{"2005", "d507", "0020", "fire", "SWAPFORCE", "Fire"},
+{"1005", "ed03", "0020", "fire", "SWAPFORCE", "Kraken (Bounce)"},
+{"2006", "d607", "0020", "life", "SWAPFORCE", "Stink"},
+{"1006", "ee03", "0020", "life", "SWAPFORCE", "Bomb (Sneak)"},
+{"2007", "d707", "0020", "life", "SWAPFORCE", "Grilla"},
+{"1007", "ef03", "0020", "life", "SWAPFORCE", "Drilla (Dig)"},
+{"2008", "d807", "0020", "magic", "SWAPFORCE", "Hoot"},
+{"1008", "f003", "0020", "magic", "SWAPFORCE", "Loop (Teleport)"},
+{"2009", "d907", "0020", "magic", "SWAPFORCE", "Trap"},
+{"1009", "f103", "0020", "magic", "SWAPFORCE", "Shadow (Sneak)"},
+{"2010", "da07", "0020", "tech", "SWAPFORCE", "Magna"},
+{"1010", "f203", "0020", "tech", "SWAPFORCE", "Charge (Speed)"},
+{"2011", "db07", "0020", "tech", "SWAPFORCE", "Spy"},
+{"1011", "f303", "0020", "tech", "SWAPFORCE", "Rise (Climb)"},
+{"2012", "dc07", "0020", "undead", "SWAPFORCE", "Night"},
+{"1012", "f403", "0020", "undead", "SWAPFORCE", "Shift (Teleport)"},
+{"2013", "dd07", "0020", "undead", "SWAPFORCE", "Rattle"},
+{"1013", "f503", "0020", "undead", "SWAPFORCE", "Shake (Bounce)"},
+{"2014", "de07", "0020", "water", "SWAPFORCE", "Freeze"},
+{"1014", "f603", "0020", "water", "SWAPFORCE", "Blade (Speed)"},
+{"2015", "df07", "0020", "water", "SWAPFORCE", "Wash"},
+{"1015", "f703", "0020", "water", "SWAPFORCE", "Buckler (Climb)"},
--{"", "", "0030", "water", "SWAPFORCE", "Hoot Loop"},
--{"", "", "0030", "water", "SWAPFORCE", "Trap Shadow"},
--{"", "", "0030", "water", "SWAPFORCE", "Wash Buckler"},