]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdlfpresco.c
FIX: IV now is trunckated to 7bits in 'hf legic read,write, writeraw'
[proxmark3-svn] / client / cmdlfpresco.c
index d6a324480c5e715016a47cd9d002179bc3bab9ad..829e2e6f5bbc91ae152cf294a079dac66a4b9c1c 100644 (file)
@@ -45,6 +45,8 @@ int GetWiegandFromPresco(const char *Cmd, uint32_t *sitecode, uint32_t *usercode
        uint8_t cmdp = 0;
        char id[11];
        int stringlen = 0;
+       memset(id, 0x00, sizeof(id));
+       
        while(param_getchar(Cmd, cmdp) != 0x00) {
                switch(param_getchar(Cmd, cmdp)) {
                        case 'h':
@@ -81,19 +83,19 @@ int GetWiegandFromPresco(const char *Cmd, uint32_t *sitecode, uint32_t *usercode
        if(errors) return -1;
 
        if (!hex) {
-       for (int index =0; index < strlen(id); ++index) {
-               
-               // Get value from number string.
-               if ( id[index] == '*' ) val = 10;
-               if ( id[index] == '#')  val = 11;               
-               if ( id[index] >= 0x30 && id[index] <= 0x39 )
-                       val = id[index] - 0x30;
-               
-                       *fullcode += val;
+               for (int index =0; index < strlen(id); ++index) {
                
-               // last digit is only added, not multipled.
-               if ( index < strlen(id)-1 ) 
-                               *fullcode *= 12;
+                       // Get value from number string.
+                       if ( id[index] == '*' ) val = 10;
+                       if ( id[index] == '#')  val = 11;               
+                       if ( id[index] >= 0x30 && id[index] <= 0x39 )
+                               val = id[index] - 0x30;
+                       
+                               *fullcode += val;
+                       
+                       // last digit is only added, not multipled.
+                       if ( index < strlen(id)-1 ) 
+                                       *fullcode *= 12;
                }
        }
 
@@ -168,6 +170,7 @@ int CmdPrescoClone(const char *Cmd) {
        if (GetWiegandFromPresco(Cmd, &sitecode, &usercode, &fullcode, &Q5) == -1) return usage_lf_presco_clone();
 
        if (Q5)
+               //t5555 (Q5) BITRATE = (RF-2)/2 (iceman)
                blocks[0] = T5555_MODULATION_MANCHESTER | 32<<T5555_BITRATE_SHIFT | 4<<T5555_MAXBLOCK_SHIFT | T5555_ST_TERMINATOR;
 
        if ((sitecode & 0xFF) != sitecode) {
Impressum, Datenschutz