]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - tools/mfkey/mfkey64.c
Upgrade crapto1 library to v3.3 (#232)
[proxmark3-svn] / tools / mfkey / mfkey64.c
index eeb9bb651bd5173e78fddcbf57c528a6ba4096df..4b9b29ee32ea50c7bfebffdca254e7989b5babd5 100755 (executable)
@@ -1,10 +1,5 @@
-#define __STDC_FORMAT_MACROS
 #include <inttypes.h>
-#define llx PRIx64
-#define lli PRIi64
-
-// Test-file: test2.c
-#include "crapto1.h"
+#include "crapto1/crapto1.h"
 #include <stdio.h>
 #include <string.h>
 
@@ -23,7 +18,7 @@ int main (int argc, char *argv[]) {
   printf("Recover key from only one complete authentication!\n\n");
 
   if (argc < 6 ) {
-    printf(" syntax: %s <uid> <nt> <{nr}> <{ar}> <{at}> <[enc]> [enc...]\n\n", argv[0]);
+    printf(" syntax: %s <uid> <nt> <{nr}> <{ar}> <{at}> [enc] [enc...]\n\n", argv[0]);
     return 1;
   }
 
@@ -39,7 +34,7 @@ int main (int argc, char *argv[]) {
   for (int i = 0; i < encc; i++) {
     enclen[i] = strlen(argv[i + 6]) / 2;
     for (int i2 = 0; i2 < enclen[i]; i2++) {
-      sscanf(argv[i+6] + i2*2,"%2x", (uint8_t*)&enc[i][i2]);
+      sscanf(argv[i+6] + i2*2,"%2x", (unsigned int *)&enc[i][i2]);
     }
   }
   printf("Recovering key for:\n");
@@ -103,8 +98,8 @@ int main (int argc, char *argv[]) {
   lfsr_rollback_word(revstate, nr_enc, 1);
   lfsr_rollback_word(revstate, uid ^ nt, 0);
   crypto1_get_lfsr(revstate, &key);
-  printf("\nFound Key: [%012"llx"]\n\n",key);
+  printf("\nFound Key: [%012" PRIx64"]\n\n",key);
   crypto1_destroy(revstate);
 
   return 0;
-}
\ No newline at end of file
+}
Impressum, Datenschutz