]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - winsrc/prox.cpp
[ryan] fix declarations for windows compiler
[proxmark3-svn] / winsrc / prox.cpp
index e95a4aff64b3d180cd0195a09941a328db083720..e2c0a79cb38ce8cb7ef0a6fe8993d53f5cc893af 100644 (file)
@@ -13,6 +13,7 @@ extern "C" {
 #define OUR_VID 0x9ac4\r
 #define OUR_PID 0x4b8f\r
 \r
+int offline = 0;\r
 HANDLE UsbHandle;\r
 \r
 static void ShowError(void)\r
@@ -326,30 +327,35 @@ static void LoadFlashFromSRecords(char *file, int addr)
 int main(int argc, char **argv)\r
 {\r
        int i = 0;\r
-\r
+       \r
        if(argc < 2) {\r
                printf("Usage: %s bootrom file.s19\n", argv[0]);\r
                printf("       %s load osimage.s19\n", argv[0]);\r
                printf("       %s fpga fpgaimg.s19\n", argv[0]);\r
                printf("       %s gui\n", argv[0]);\r
+               printf("       %s offline\n", argv[0]);\r
                return -1;\r
        }\r
-\r
-       for(;;) {\r
-               if(UsbConnect()) {\r
-                       break;\r
-               }\r
-               if(i == 0) {\r
-                       printf("...no device connected, polling for it now\n");\r
-               }\r
-               if(i > 50000) {\r
-                       printf("Could not connect to USB device; exiting.\n");\r
-                       return -1;\r
+       \r
+       // Only do this if NOT in offline mode\r
+       if (strcmp(argv[1], "offline"))\r
+       {\r
+               for(;;) {\r
+                       if(UsbConnect()) {\r
+                               break;\r
+                       }\r
+                       if(i == 0) {\r
+                               printf("...no device connected, polling for it now\n");\r
+                       }\r
+                       if(i > 50000) {\r
+                               printf("Could not connect to USB device; exiting.\n");\r
+                               return -1;\r
+                       }\r
+                       i++;\r
+                       Sleep(5);\r
                }\r
-               i++;\r
-               Sleep(5);\r
        }\r
-\r
+       \r
        if(strcmp(argv[1], "bootrom")==0 || strcmp(argv[1], "load")==0 || strcmp(argv[1], "fpga")==0) {\r
                if(argc != 3) {\r
                        printf("Need filename.\n");\r
@@ -364,6 +370,9 @@ int main(int argc, char **argv)
                }\r
        } else if(strcmp(argv[1], "gui")==0) {\r
                ShowGui();\r
+       } else if(strcmp(argv[1], "offline")==0) {\r
+               offline = 1;\r
+               ShowGui();\r
        } else if(strcmp(argv[1], "cmd")==0) {\r
                if(argc != 3) {\r
                        printf("Need command.\n");\r
Impressum, Datenschutz