+
+ UsbCommand c = {CMD_MIFARE_DESFIRE, { 0x01, 0x01 }};
+ c.d.asBytes[0] = GET_APPLICATION_IDS;
+ SendCommand(&c);
+ UsbCommand resp;
+
+ if ( !WaitForResponseTimeout(CMD_ACK,&resp,1500) ) {
+ return 0;
+ }
+
+ uint8_t isOK = resp.arg[0] & 0xff;
+ if ( !isOK ){
+ PrintAndLog("Command unsuccessful");
+ return 0;
+ }
+
+ PrintAndLog("---Desfire Enum Applications --------------------------------");
+ PrintAndLog("-------------------------------------------------------------");
+
+ //UsbCommand respFiles;
+
+ uint8_t num = 0;
+ int max = resp.arg[1] -3 -2;
+
+ for(int i=3; i<=max; i+=3){
+ PrintAndLog(" Aid %d : %s ",num ,sprint_hex(resp.d.asBytes+i,3));
+ num++;
+
+ // UsbCommand cFiles = {CMD_MIFARE_DESFIRE, { 0x01, 0x04 }};
+ // cFiles.d.asBytes[0] = GET_FILE_IDS;
+ // cFiles.d.asBytes[1] = resp.d.asBytes+i;
+ // cFiles.d.asBytes[2] = resp.d.asBytes+i+1;
+ // cFiles.d.asBytes[3] = resp.d.asBytes+i+2;
+ // SendCommand(&cFiles);
+
+ // if ( !WaitForResponseTimeout(CMD_ACK,&respFiles,1500) ) {
+ // PrintAndLog(" No files found");
+ // break;
+ // }
+
+ }
+ PrintAndLog("-------------------------------------------------------------");
+
+