]>
cvs.zerfleddert.de Git - proxmark3-svn/blob - client/flasher.c
1 //-----------------------------------------------------------------------------
2 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
3 // at your option, any later version. See the LICENSE.txt file for the text of
5 //-----------------------------------------------------------------------------
7 //-----------------------------------------------------------------------------
15 unsigned int current_command
= CMD_UNKNOWN
;
17 extern struct partition partitions
[];
19 static void usage(char **argv
)
21 fprintf(stderr
, "Usage: %s areas image [image [image]]\n", argv
[0]);
22 fprintf(stderr
, " areas is a comma-separated list of areas to flash, with no spaces\n");
23 fprintf(stderr
, " Known areas are:");
25 for (int i
= 0; partitions
[i
].name
!= NULL
; ++i
) {
26 fprintf(stderr
, " %s", partitions
[i
].name
);
29 fprintf(stderr
, "\n");
30 fprintf(stderr
, " image is the path to the corresponding image\n\n");
31 fprintf(stderr
, "Example: %s os,fpga path/to/osimage.elf path/to/fpgaimage.elf\n", argv
[0]);
34 int main(int argc
, char **argv
)
41 /* Count area arguments */
42 int areas
= 0, offset
=-1, length
=0;
43 while (find_next_area(argv
[1], &offset
, &length
)) areas
++;
45 if (areas
!= argc
- 2) {
52 fprintf(stderr
,"Waiting for Proxmark to appear on USB... ");
53 while (!OpenProxmark(0)) { sleep(1); }
54 fprintf(stderr
,"Found.\n");
58 UsbCommand c
= {CMD_HARDWARE_RESET
};
63 fprintf(stderr
,"Have a nice day!\n");