]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
ADD: T55XX_WRITE_TIMEOUT to make sure all WaitForResponseTimeout for t55xx behaves...
authoriceman1001 <iceman@iuse.se>
Wed, 18 Jan 2017 21:54:27 +0000 (22:54 +0100)
committericeman1001 <iceman@iuse.se>
Wed, 18 Jan 2017 21:54:27 +0000 (22:54 +0100)
CHG:  removed some "DONE!" device prints..
CHG:  unified some "clone" commands output.

13 files changed:
armsrc/lfops.c
client/cmdlf.h
client/cmdlfawid.c
client/cmdlffdx.c
client/cmdlfguard.c
client/cmdlfguard.h
client/cmdlfjablotron.c
client/cmdlfnedap.c
client/cmdlfnoralsy.c
client/cmdlfpresco.c
client/cmdlfpyramid.c
client/cmdlft55xx.c
client/cmdlfvisa2000.c

index 1b922ca006d28725fafa4506a001eb0786d3d6c1..71d9ba95db49488dabf1c6c13f7ef0f6a6edc4ce 100644 (file)
@@ -1369,7 +1369,7 @@ void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT) {
                data[4] = manchesterEncode2Bytes(hi & 0xFFFF);
                data[5] = manchesterEncode2Bytes(lo >> 16);
                data[6] = manchesterEncode2Bytes(lo & 0xFFFF);
                data[4] = manchesterEncode2Bytes(hi & 0xFFFF);
                data[5] = manchesterEncode2Bytes(lo >> 16);
                data[6] = manchesterEncode2Bytes(lo & 0xFFFF);
-       }       else {
+       } else {
                // Ensure no more than 44 bits supplied
                if (hi > 0xFFF) {
                        DbpString("Tags can only have 44 bits.");
                // Ensure no more than 44 bits supplied
                if (hi > 0xFFF) {
                        DbpString("Tags can only have 44 bits.");
@@ -1389,13 +1389,8 @@ void CopyHIDtoT55x7(uint32_t hi2, uint32_t hi, uint32_t lo, uint8_t longFMT) {
        // data[0] = (((50-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | last_block << T5555_MAXBLOCK_SHIFT;
 
        LED_D_ON();
        // data[0] = (((50-2)/2)<<T5555_BITRATE_SHIFT) | T5555_MODULATION_FSK2 | T5555_INVERT_OUTPUT | last_block << T5555_MAXBLOCK_SHIFT;
 
        LED_D_ON();
-       // Program the data blocks for supplied ID
-       // and the block 0 for HID format
        WriteT55xx(data, 0, last_block+1);
        WriteT55xx(data, 0, last_block+1);
-
        LED_D_OFF();
        LED_D_OFF();
-
-       DbpString("DONE!");
 }
 
 void CopyIOtoT55x7(uint32_t hi, uint32_t lo) {
 }
 
 void CopyIOtoT55x7(uint32_t hi, uint32_t lo) {
@@ -1409,7 +1404,6 @@ void CopyIOtoT55x7(uint32_t hi, uint32_t lo) {
        // and the block 0 config
        WriteT55xx(data, 0, 3);
        LED_D_OFF();
        // and the block 0 config
        WriteT55xx(data, 0, 3);
        LED_D_OFF();
-       DbpString("DONE!");
 }
 
 // Clone Indala 64-bit tag by UID to T55x7
 }
 
 // Clone Indala 64-bit tag by UID to T55x7
@@ -1423,7 +1417,6 @@ void CopyIndala64toT55x7(uint32_t hi, uint32_t lo) {
        WriteT55xx(data, 0, 3);
        //Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=2;Inverse data)
        //      T5567WriteBlock(0x603E1042,0);
        WriteT55xx(data, 0, 3);
        //Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=2;Inverse data)
        //      T5567WriteBlock(0x603E1042,0);
-       DbpString("DONE!");
 }
 // Clone Indala 224-bit tag by UID to T55x7
 void CopyIndala224toT55x7(uint32_t uid1, uint32_t uid2, uint32_t uid3, uint32_t uid4, uint32_t uid5, uint32_t uid6, uint32_t uid7) {
 }
 // Clone Indala 224-bit tag by UID to T55x7
 void CopyIndala224toT55x7(uint32_t uid1, uint32_t uid2, uint32_t uid3, uint32_t uid4, uint32_t uid5, uint32_t uid6, uint32_t uid7) {
@@ -1437,7 +1430,6 @@ void CopyIndala224toT55x7(uint32_t uid1, uint32_t uid2, uint32_t uid3, uint32_t
        WriteT55xx(data, 0, 8);
        //Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=7;Inverse data)
        //      T5567WriteBlock(0x603E10E2,0);
        WriteT55xx(data, 0, 8);
        //Alternative config for Indala (Extended mode;RF/32;PSK1 with RF/2;Maxblock=7;Inverse data)
        //      T5567WriteBlock(0x603E10E2,0);
-       DbpString("DONE!");
 }
 // clone viking tag to T55xx
 void CopyVikingtoT55xx(uint32_t block1, uint32_t block2, uint8_t Q5) {
 }
 // clone viking tag to T55xx
 void CopyVikingtoT55xx(uint32_t block1, uint32_t block2, uint8_t Q5) {
index 8415616ebc96113359345a1102114eef3e4d371d..f8f048a13e52e73b661bc82adc9679632a821a0a 100644 (file)
@@ -15,8 +15,7 @@
 #include <string.h>
 #include <limits.h>
 #include "proxmark3.h"
 #include <string.h>
 #include <limits.h>
 #include "proxmark3.h"
-#include "lfdemod.h"
-                       
+#include "lfdemod.h"           // device/client demods of LF signals           
 #include "util.h"                      // for parsing cli command utils
 #include "ui.h"                                // for show graph controls
 #include "graph.h"                     // for graph data
 #include "util.h"                      // for parsing cli command utils
 #include "ui.h"                                // for show graph controls
 #include "graph.h"                     // for graph data
@@ -41,6 +40,9 @@
 #include "cmdlfvisa2000.h"  // for VISA2000 menu
 #include "cmdlfnoralsy.h"      // for NORALSY meny
 #include "cmdlffdx.h"          // for FDX-B meny
 #include "cmdlfvisa2000.h"  // for VISA2000 menu
 #include "cmdlfnoralsy.h"      // for NORALSY meny
 #include "cmdlffdx.h"          // for FDX-B meny
+
+#define T55XX_WRITE_TIMEOUT    1500
+
 int CmdLF(const char *Cmd);
 
 int CmdLFCommandRead(const char *Cmd);
 int CmdLF(const char *Cmd);
 
 int CmdLFCommandRead(const char *Cmd);
index 8b04a3d6b109ace53e016a6a8ad530f57367916a..a323f52b098b5e7f46c5d505fcca43f05c97a106 100644 (file)
@@ -313,7 +313,7 @@ int CmdAWIDClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1500)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index 511806ddb64eca8b221574378bc8861019aff0a3..0e6b43f48d2dfb95ca5fe542568ef3470ea0a2f3 100644 (file)
@@ -250,7 +250,7 @@ int CmdFdxClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index 43492678ccb233b19e74f742267d663c24c5efa9..d9010a19a2209e99045f4dab5ba84a3092500e04 100644 (file)
@@ -6,8 +6,7 @@
 //-----------------------------------------------------------------------------
 // Low frequency Farpoint / Pyramid tag commands
 //-----------------------------------------------------------------------------
 //-----------------------------------------------------------------------------
 // Low frequency Farpoint / Pyramid tag commands
 //-----------------------------------------------------------------------------
-#include <string.h>
-#include <inttypes.h>
+
 #include "cmdlfguard.h"
 static int CmdHelp(const char *Cmd);
 
 #include "cmdlfguard.h"
 static int CmdHelp(const char *Cmd);
 
@@ -40,7 +39,6 @@ int usage_lf_guard_sim(void) {
        return 0;
 }
 
        return 0;
 }
 
-
 // Works for 26bits.
 int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) {
   
 // Works for 26bits.
 int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) {
   
@@ -50,8 +48,6 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) {
        //uint8_t xorKey = rand() % 0xFF;
        uint8_t xorKey = 0x66;
        uint8_t i;
        //uint8_t xorKey = rand() % 0xFF;
        uint8_t xorKey = 0x66;
        uint8_t i;
-       
-       
        uint8_t pre[96];
        memset(pre, 0x00, sizeof(pre));
 
        uint8_t pre[96];
        memset(pre, 0x00, sizeof(pre));
 
@@ -122,7 +118,7 @@ int GetGuardBits(uint32_t fc, uint32_t cn, uint8_t *guardBits) {
 
 int CmdGuardRead(const char *Cmd) {
        CmdLFRead("s");
 
 int CmdGuardRead(const char *Cmd) {
        CmdLFRead("s");
-       getSamples("20000", TRUE);
+       getSamples("12000", TRUE);
        return CmdG_Prox_II_Demod("");
 }
 
        return CmdG_Prox_II_Demod("");
 }
 
@@ -161,7 +157,7 @@ int CmdGuardClone(const char *Cmd) {
        PrintAndLog("Blk | Data ");
        PrintAndLog("----+------------");
        for ( i = 0; i<4; ++i )
        PrintAndLog("Blk | Data ");
        PrintAndLog("----+------------");
        for ( i = 0; i<4; ++i )
-               PrintAndLog(" %02d | %08x", i, blocks[i]);
+               PrintAndLog(" %02d | 0x%08x", i, blocks[i]);
 
        UsbCommand resp;
        UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {0,0,0}};
 
        UsbCommand resp;
        UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {0,0,0}};
@@ -171,7 +167,7 @@ int CmdGuardClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index 68ab8f2b076029770db6c9a27d961d8eafc4a3a8..63b28789d38d13f3830841326f1f8f65479ffb2c 100644 (file)
@@ -8,6 +8,8 @@
 //-----------------------------------------------------------------------------
 #ifndef CMDLFGUARD_H__
 #define CMDLFGUARD_H__
 //-----------------------------------------------------------------------------
 #ifndef CMDLFGUARD_H__
 #define CMDLFGUARD_H__
+#include <string.h>
+#include <inttypes.h>
 #include "proxmark3.h"
 #include "ui.h"
 #include "util.h"
 #include "proxmark3.h"
 #include "ui.h"
 #include "util.h"
index 7852508d1f07df2ace191183fb6d89194c38a566..508886d5a86e06aad2f534b48ef7ca3ae4c374c5 100644 (file)
@@ -180,7 +180,7 @@ int CmdJablotronClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index ab34d8ff8cbc1fa5da7fac7c48a1db68d2fa8ddd..21d47fb99f41c770fd28a48eb08ac4ff07328de4 100644 (file)
@@ -254,7 +254,7 @@ int CmdLFNedapClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index f859bae9484e0aab6d53e87737c06bd833ced3d7..96c436556b38ee62a487da8f11ce7bb8e8af79d3 100644 (file)
@@ -184,7 +184,7 @@ int CmdNoralsyClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index 36f99107bc8eddb493104c7b32c8d971b0508e3f..47ff7db3e4ab6e4ac0d94287cb6fed071c713ef4 100644 (file)
@@ -116,13 +116,12 @@ int GetPrescoBits(uint32_t fullcode, uint8_t *prescoBits) {
 //see ASKDemod for what args are accepted
 int CmdPrescoDemod(const char *Cmd) {
        bool st = true;
 //see ASKDemod for what args are accepted
 int CmdPrescoDemod(const char *Cmd) {
        bool st = true;
-
        if (!ASKDemod_ext("32 0 0", FALSE, FALSE, 1, &st)) {
                if (g_debugMode) PrintAndLog("DEBUG: Error Presco ASKDemod failed");
                return 0;
        }
        size_t size = DemodBufferLen;
        if (!ASKDemod_ext("32 0 0", FALSE, FALSE, 1, &st)) {
                if (g_debugMode) PrintAndLog("DEBUG: Error Presco ASKDemod failed");
                return 0;
        }
        size_t size = DemodBufferLen;
-       //call lfdemod.c demod for Viking
+       //call lfdemod.c demod for Presco
        int ans = PrescoDemod(DemodBuffer, &size);
        if (ans < 0) {
                if (g_debugMode){
        int ans = PrescoDemod(DemodBuffer, &size);
        if (ans < 0) {
                if (g_debugMode){
@@ -163,7 +162,7 @@ int CmdPrescoRead(const char *Cmd) {
        // read lf silently
        CmdLFRead("s");
        // get samples silently
        // read lf silently
        CmdLFRead("s");
        // get samples silently
-       getSamples("20000", TRUE);
+       getSamples("12000", TRUE);
        // demod and output Presco ID   
        return CmdPrescoDemod(Cmd);
 }
        // demod and output Presco ID   
        return CmdPrescoDemod(Cmd);
 }
@@ -174,7 +173,7 @@ int CmdPrescoClone(const char *Cmd) {
 
        bool Q5 = false;
        uint32_t sitecode=0, usercode=0, fullcode=0;
 
        bool Q5 = false;
        uint32_t sitecode=0, usercode=0, fullcode=0;
-       uint32_t blocks[5] = {T55x7_MODULATION_MANCHESTER | T55x7_BITRATE_RF_32 | 4<<T55x7_MAXBLOCK_SHIFT | T55x7_ST_TERMINATOR, 0, 0, 0, 5};
+       uint32_t blocks[5] = {T55x7_MODULATION_MANCHESTER | T55x7_BITRATE_RF_32 | 4<<T55x7_MAXBLOCK_SHIFT | T55x7_ST_TERMINATOR, 0, 0, 0, 0};
        
        // get wiegand from printed number.
        if (GetWiegandFromPresco(Cmd, &sitecode, &usercode, &fullcode, &Q5) == -1) return usage_lf_presco_clone();
        
        // get wiegand from printed number.
        if (GetWiegandFromPresco(Cmd, &sitecode, &usercode, &fullcode, &Q5) == -1) return usage_lf_presco_clone();
@@ -215,7 +214,7 @@ int CmdPrescoClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index f1097121a2090373af8fe45b77a6a3bc3bb518b0..f22267de8007891b5d11de45d71e6bd8edd2e7ce 100644 (file)
@@ -115,7 +115,7 @@ int CmdPyramidClone(const char *Cmd) {
        PrintAndLog("Blk | Data ");
        PrintAndLog("----+------------");
        for ( i = 0; i<5; ++i )
        PrintAndLog("Blk | Data ");
        PrintAndLog("----+------------");
        for ( i = 0; i<5; ++i )
-               PrintAndLog(" %02d | %08" PRIx32, i, blocks[i]);
+               PrintAndLog(" %02d | 0x%08" PRIx32, i, blocks[i]);
 
        UsbCommand resp;
        UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {0,0,0}};
 
        UsbCommand resp;
        UsbCommand c = {CMD_T55XX_WRITE_BLOCK, {0,0,0}};
@@ -125,7 +125,7 @@ int CmdPyramidClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
index 5cadd24cadf4221fd97c09c514a63ceb3dcf2ccf..1b005d96a1313262c87b5caf5940b1eeec3d1f40 100644 (file)
@@ -1410,10 +1410,9 @@ void t55x7_create_config_block( int tagtype ){
 \r
 int CmdResetRead(const char *Cmd) {\r
        UsbCommand c = {CMD_T55XX_RESET_READ, {0,0,0}};\r
 \r
 int CmdResetRead(const char *Cmd) {\r
        UsbCommand c = {CMD_T55XX_RESET_READ, {0,0,0}};\r
-\r
        clearCommandBuffer();\r
        SendCommand(&c);\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
                PrintAndLog("command execution time out");\r
                return 0;\r
        }\r
index 9eca4052f988a85cef6e8752b8febca6efa79eb6..e432954d98d0c4ea90e7f413082de314da118501 100644 (file)
@@ -137,7 +137,7 @@ int CmdVisa2kClone(const char *Cmd) {
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
                c.arg[1] = i;
                clearCommandBuffer();
                SendCommand(&c);
-               if (!WaitForResponseTimeout(CMD_ACK, &resp, 1000)){
+               if (!WaitForResponseTimeout(CMD_ACK, &resp, T55XX_WRITE_TIMEOUT)){
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
                        PrintAndLog("Error occurred, device did not respond during write operation.");
                        return -1;
                }
Impressum, Datenschutz