]> git.zerfleddert.de Git - proxmark3-svn/commitdiff
Merge pull request #560 from pwpiwi/fix_hfmfmif
authorIceman <iceman@iuse.se>
Tue, 6 Feb 2018 07:15:03 +0000 (08:15 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Feb 2018 07:15:03 +0000 (08:15 +0100)
fix: prevent hf mf mifare from always running twice

client/mifarehost.c

index dd656ee1f24253677c4d1b5199db28203e784a33..a01d3b5f0485bf43b6b0087bc40a81b357edf9de 100644 (file)
@@ -178,12 +178,14 @@ int mfDarkside(uint64_t *key)
                        continue;\r
                }\r
 \r
-               qsort(keylist, keycount, sizeof(*keylist), compare_uint64);\r
-               keycount = intersection(last_keylist, keylist);\r
-               if (keycount == 0) {\r
-                       free(last_keylist);\r
-                       last_keylist = keylist;\r
-                       continue;\r
+               if (par_list == 0) {\r
+                       qsort(keylist, keycount, sizeof(*keylist), compare_uint64);\r
+                       keycount = intersection(last_keylist, keylist);\r
+                       if (keycount == 0) {\r
+                               free(last_keylist);\r
+                               last_keylist = keylist;\r
+                               continue;\r
+                       }\r
                }\r
 \r
                if (keycount > 1) {\r
@@ -198,10 +200,10 @@ int mfDarkside(uint64_t *key)
                for (int i = 0; i < keycount; i += max_keys) {\r
                        int size = keycount - i > max_keys ? max_keys : keycount - i;\r
                        for (int j = 0; j < size; j++) {\r
-                               if (last_keylist == NULL) {\r
-                                       num_to_bytes(keylist[i*max_keys + j], 6, keyBlock);\r
-                               } else {\r
+                               if (par_list == 0) {\r
                                        num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock);\r
+                               } else {\r
+                                       num_to_bytes(keylist[i*max_keys + j], 6, keyBlock);\r
                                }\r
                        }\r
                        if (!mfCheckKeys(0, 0, false, size, keyBlock, key)) {\r
Impressum, Datenschutz