- UsbCommand c = {CMD_T55XX_READ_BLOCK, {0, block, password}};\r
-\r
- //Password mode\r
- if ( usepwd || wake ) {\r
- // try reading the config block and verify that PWD bit is set before doing this!\r
- if ( wake || override ) {\r
- c.arg[0] = (wake<<8) & usepwd;\r
- if ( !wake && override )\r
- PrintAndLog("Safety Check Overriden - proceeding despite risk");\r
- } else {\r
- AquireData( CONFIGURATION_BLOCK );\r
- if ( !tryDetectModulation() ) {\r
- PrintAndLog("Safety Check: Could not detect if PWD bit is set in config block. Exits.");\r
- return 1;\r
- } else {\r
- PrintAndLog("Safety Check: PWD bit is NOT set in config block. Reading without password..."); \r
- }\r
- }\r
- }\r
-\r
- clearCommandBuffer();\r
- SendCommand(&c);\r
- if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) {\r
- PrintAndLog("command execution time out");\r
- return 2;\r
- }\r
- \r
- uint8_t got[12000];\r
- GetFromBigBuf(got, sizeof(got), 0);\r
- WaitForResponse(CMD_ACK,NULL);\r
- setGraphBuf(got, sizeof(got));\r
- //DemodBufferLen=0;\r
- if (!DecodeT55xxBlock()) return 3;\r
- char blk[10]={0};\r
- if ( wake ) {\r
- sprintf(blk,"wake");\r
- } else {\r
- sprintf(blk,"%d", block);\r