]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
added: readed blocks (password mode) into tag.sectors[]. 'lf hitag sim' simulates...
authorthijsbreman@gmail.com <thijsbreman@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 18 Oct 2012 10:01:13 +0000 (10:01 +0000)
committerthijsbreman@gmail.com <thijsbreman@gmail.com@ef4ab9da-24cd-11de-8aaa-f3a34680c41f>
Thu, 18 Oct 2012 10:01:13 +0000 (10:01 +0000)
armsrc/hitag2.c
client/cmdlfhitag.c

index 59f29eae42f20299aa3bd101a3f7e39f81fdbe7a..37eb211c821fec35f7bf82d19b0f127185dcb5bc 100644 (file)
@@ -477,16 +477,26 @@ bool hitag2_password(byte_t* rx, const size_t rxlen, byte_t* tx, size_t* txlen)
                                *txlen = 32;
                                memcpy(tx,password,4);
                                bPwd = true;
                                *txlen = 32;
                                memcpy(tx,password,4);
                                bPwd = true;
+                                memcpy(tag.sectors[blocknr],rx,4);
+                                blocknr++;
                        } else {
                        } else {
-        if (blocknr > 7) {
-          DbpString("Read succesful!");
-          // We are done... for now
-          return false;
-        }
-        *txlen = 10;
-        tx[0] = 0xc0 | (blocknr << 3) | ((blocknr^7) >> 2);
-        tx[1] = ((blocknr^7) << 6);
-        blocknr++;
+                               
+                       if(blocknr == 1){
+                               //store password in block1, the TAG answers with Block3, but we need the password in memory
+                               memcpy(tag.sectors[blocknr],tx,4);
+                       }else{
+                               memcpy(tag.sectors[blocknr],rx,4);
+                       }
+                       
+                       blocknr++;
+                       if (blocknr > 7) {
+                         DbpString("Read succesful!");
+                         // We are done... for now
+                         return false;
+                       }
+                       *txlen = 10;
+                       tx[0] = 0xc0 | (blocknr << 3) | ((blocknr^7) >> 2);
+                       tx[1] = ((blocknr^7) << 6);
                        }
                } break;
                        
                        }
                } break;
                        
index bdabe5e46bb60aab592ac17d0b16a8c933199df9..c852544c5532bb135836bc432a8e28cdacaadf54 100644 (file)
@@ -199,7 +199,7 @@ int CmdLFHitagReader(const char *Cmd) {
                        PrintAndLog(" Hitag2 (2*)",htf);
                        PrintAndLog("  21 <password> (password mode)",htf);
                        PrintAndLog("  22 <nr> <ar> (authentication)",htf);
                        PrintAndLog(" Hitag2 (2*)",htf);
                        PrintAndLog("  21 <password> (password mode)",htf);
                        PrintAndLog("  22 <nr> <ar> (authentication)",htf);
-                       PrintAndLog("  23 <key> (authentication)",htf);
+                       PrintAndLog("  23 <key> (authentication) key is in format: ISK high + ISK low",htf);
                        PrintAndLog("  25 (test recorded authentications)",htf);
                        return 1;
                } break;
                        PrintAndLog("  25 (test recorded authentications)",htf);
                        return 1;
                } break;
Impressum, Datenschutz