+ //unsigned long width = 0UL;
+ //int c, mode = 0, args, psets, pass;
+ //poly_t apoly, crc, qpoly = PZERO, *apolys, *pptr = NULL, *qptr = NULL;
+ //model_t pset = model, *candmods, *mptr;
+ //char *string;
+
+ //myname = argv[0];
+
+ /* stdin must be binary */
+ #ifdef _WIN32
+ _setmode(STDIN_FILENO, _O_BINARY);
+ #endif /* _WIN32 */
+
+ SETBMP();
+
+ //pos=0;
+ //optind=1;
+
+ if (*width == 0) { //reveng -D
+ *count = mcount();
+ //PrintAndLog("Count: %d",*count);
+ if(!*count){
+ PrintAndLog("no preset models available");
+ return 0;
+ }
+ for(int mode = 0; mode < *count; ++mode) {
+ mbynum(&model, mode);
+ mcanon(&model);
+ size_t size = (model.name && *model.name) ? strlen(model.name) : 6;
+ //PrintAndLog("Size: %d, %s",size,model.name);
+ char *tmp = calloc(size+1, sizeof(char));
+ if (tmp==NULL){
+ PrintAndLog("out of memory?");
+ return 0;
+ }
+ memcpy(tmp, model.name, size);
+ Models[mode] = tmp;
+ //ufound(&model);
+ }
+ } else { //reveng -s
+
+ }
+ //PrintAndLog("DONE");
+ return 1;