-int main(int argc, char **argv) {
- if(argc < 2) {
- usage(argv);
- exit(-1);
- }
-
- /* Count area arguments */
- int areas = 0, offset=-1, length=0;
- while(find_next_area(argv[1], &offset, &length)) areas++;
-
- if(areas != argc - 2) {
- usage(argv);
- exit(-1);
- }
-
- usb_init();
+int main(int argc, char **argv)
+{
+ if (argc < 2) {
+ usage(argv);
+ exit(-1);
+ }
+
+ /* Count area arguments */
+ int areas = 0, offset=-1, length=0;
+ while (find_next_area(argv[1], &offset, &length)) areas++;
+
+ if (areas != argc - 2) {
+ usage(argv);
+ exit(-1);
+ }
+
+ usb_init();
+
+ fprintf(stderr,"Waiting for Proxmark to appear on USB... ");
+ while (!OpenProxmark(0)) { sleep(1); }
+ fprintf(stderr,"Found.\n");
+
+ do_flash(argv);