]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflegic.c
CHG: finally, the ticks timer does what it is supposed to do. 32bits and working.
[proxmark3-svn] / client / cmdhflegic.c
index f4d0827f24f62284d153de8910d298b8e7af7cb4..f0fb12be8b7973ed1d2db94eb7925e35a60ccc55 100644 (file)
@@ -390,8 +390,8 @@ int CmdLegicDecode(const char *Cmd) {
 int CmdLegicRFRead(const char *Cmd) {
 
        // params:
-       // offset in data
-       // number of bytes.
+       // offset in data memory
+       // number of bytes to read
        char cmdp = param_getchar(Cmd, 0);
        if ( cmdp == 'H' || cmdp == 'h' ) return usage_legic_read();
        
@@ -401,7 +401,7 @@ int CmdLegicRFRead(const char *Cmd) {
        // OUT-OF-BOUNDS check
        if ( len + offset > MAX_LENGTH ) {
                len = MAX_LENGTH - offset;
-               PrintAndLog("Out-of-bound, shorten len to %d",len);
+               PrintAndLog("Out-of-bound, shorten len to %d", len);
        }
        
        if ( (IV & 0x7F) != IV ){
@@ -414,7 +414,7 @@ int CmdLegicRFRead(const char *Cmd) {
                PrintAndLog("LSB of IV must be SET");   
        }
 
-       PrintAndLog("Using IV: 0x%02x", IV);
+       //PrintAndLog("Using IV: 0x%02x | Offset: 0x%02x | Len: 0x%02x ", IV, offset, len);
        
        UsbCommand c = {CMD_READER_LEGIC_RF, {offset, len, IV}};
        clearCommandBuffer();
@@ -425,12 +425,14 @@ int CmdLegicRFRead(const char *Cmd) {
                uint16_t len = resp.arg[1] & 0x3FF;
                 if ( isOK ) {
                        PrintAndLog("use 'hf legic decode'");
-                }
+
                        uint8_t *data = resp.d.asBytes;
                        PrintAndLog("\nData        |");
                        PrintAndLog("-----------------------------");
                        PrintAndLog(" %s|\n", sprint_hex(data, len));
-               // }
+                } else {
+                        PrintAndLog("failed reading tag");
+                }
        } else {
                PrintAndLog("command execution time out");
                return 1;
Impressum, Datenschutz