]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
CHG: 'lf t55xx' the no-time limit waiting for the device to ACK when transfering...
authoriceman1001 <iceman@iuse.se>
Mon, 16 Jan 2017 13:46:42 +0000 (14:46 +0100)
committericeman1001 <iceman@iuse.se>
Mon, 16 Jan 2017 13:46:42 +0000 (14:46 +0100)
CHG: 'lf t55xx dump' - added ASCII printing of dumped data blocks.

client/cmdlft55xx.c

index 25b9ba279905d6944aa3391d292940ffe81f9769..ec8c9de994a8b3d1292d6e231e40ead6bffdfe5a 100644 (file)
@@ -195,8 +195,8 @@ static int CmdHelp(const char *Cmd);
 \r
 void printT5xxHeader(uint8_t page){\r
        PrintAndLog("Reading Page %d:", page);  \r
-       PrintAndLog("blk | hex data | binary");\r
-       PrintAndLog("----+----------+---------------------------------");       \r
+       PrintAndLog("blk | hex data | binary                          | ascii");\r
+       PrintAndLog("----+----------+---------------------------------+-------");       \r
 }\r
 \r
 int CmdT55xxSetConfig(const char *Cmd) {\r
@@ -864,16 +864,18 @@ void printT55xxBlock(const char *blockNum){
                bits[i - config.offset] = DemodBuffer[i];\r
 \r
        blockData = PackBits(0, 32, bits);\r
+       uint8_t bytes[4] = {0};\r
+       num_to_bytes(blockData, 4, bytes);\r
 \r
-       PrintAndLog(" %s | %08X | %s", blockNum, blockData, sprint_bin(bits,32));\r
+       PrintAndLog(" %s | %08X | %s | %s", blockNum, blockData, sprint_bin(bits,32), sprint_ascii(bytes,4));\r
 }\r
 \r
 int special(const char *Cmd) {\r
        uint32_t blockData = 0;\r
        uint8_t bits[32] = {0x00};\r
 \r
-       PrintAndLog("OFFSET | DATA  | BINARY");\r
-       PrintAndLog("----------------------------------------------------");\r
+       PrintAndLog("OFFSET | DATA  | BINARY                             | ASCII");\r
+       PrintAndLog("-------+-------+------------------------------------+------");\r
        int i,j = 0;\r
        for (; j < 64; ++j){\r
                \r
@@ -1263,20 +1265,21 @@ int AquireData( uint8_t page, uint8_t block, bool pwdmode, uint32_t password ){
        //      bit1 = page to read from\r
        // arg1: which block to read\r
        // arg2: password\r
-       \r
        uint8_t arg0 = (page<<1) | pwdmode;\r
        UsbCommand c = {CMD_T55XX_READ_BLOCK, {arg0, block, password}};\r
-       \r
        clearCommandBuffer();\r
        SendCommand(&c);\r
-       if ( !WaitForResponseTimeout(CMD_ACK,NULL,2500) ) {\r
+       if ( !WaitForResponseTimeout(CMD_ACK, NULL, 2500) ) {\r
                PrintAndLog("command execution time out");\r
                return 0;\r
        }\r
 \r
-       uint8_t got[12000];\r
-       GetFromBigBuf(got,sizeof(got),0);\r
-       WaitForResponse(CMD_ACK,NULL);\r
+       uint8_t got[12288];\r
+       GetFromBigBuf(got, sizeof(got), 0);\r
+       if ( !WaitForResponseTimeout(CMD_ACK, NULL, 8000) ) {\r
+               PrintAndLog("command execution time out");\r
+               return 0;\r
+       }\r
        setGraphBuf(got, sizeof(got));\r
        return 1;\r
 }\r
Impressum, Datenschutz