]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/mifarehost.c
fix: hf mf mifare - populate keylist (#568)
[proxmark3-svn] / client / mifarehost.c
index d204bf12c87e9a3358eba16c392e05a80ae980dc..2bd21077e9b6ba5cd23c276445cccc809f3dbf04 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
+                               if (par_list == 0) {\r
+                                       num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock+(j*6));\r
                                } else {\r
-                                       num_to_bytes(last_keylist[i*max_keys + j], 6, keyBlock);\r
+                                       num_to_bytes(keylist[i*max_keys + j], 6, keyBlock+(j*6));\r
                                }\r
                        }\r
                        if (!mfCheckKeys(0, 0, false, size, keyBlock, key)) {\r
@@ -295,7 +297,13 @@ typedef
 \r
 \r
 // wrapper function for multi-threaded lfsr_recovery32\r
-void* nested_worker_thread(void *arg)\r
+void\r
+#ifdef __has_attribute\r
+#if __has_attribute(force_align_arg_pointer)\r
+__attribute__((force_align_arg_pointer)) \r
+#endif\r
+#endif\r
+*nested_worker_thread(void *arg)\r
 {\r
        struct Crypto1State *p1;\r
        StateList_t *statelist = arg;\r
@@ -309,6 +317,7 @@ void* nested_worker_thread(void *arg)
        return statelist->head.slhead;\r
 }\r
 \r
+\r
 int mfnested(uint8_t blockNo, uint8_t keyType, uint8_t *key, uint8_t trgBlockNo, uint8_t trgKeyType, uint8_t *resultKey, bool calibrate)\r
 {\r
        uint16_t i;\r
Impressum, Datenschutz