Browse Source

hook functions

master
Robin Thoni 9 years ago
parent
commit
721c769a5a
4 changed files with 29 additions and 3 deletions
  1. 2
    2
      src/Makefile.am
  2. 10
    0
      src/log.c
  3. 11
    0
      src/log.h
  4. 6
    1
      src/mfcuk.c

+ 2
- 2
src/Makefile.am View File

@@ -2,9 +2,9 @@ AM_CFLAGS  = @libnfc_CFLAGS@
2 2
 
3 3
 bin_PROGRAMS = mfcuk
4 4
 
5
-noinst_HEADERS = crapto1.h mifare.h nfc-utils.h mfcuk_mifare.h mfcuk_finger.h mfcuk_utils.h xgetopt.h mfcuk.h
5
+noinst_HEADERS = crapto1.h mifare.h nfc-utils.h mfcuk_mifare.h mfcuk_finger.h mfcuk_utils.h xgetopt.h mfcuk.h log.h
6 6
 
7
-mfcuk_SOURCES = crapto1.c crypto1.c mifare.c nfc-utils.c mfcuk_mifare.c mfcuk_finger.c mfcuk_utils.c xgetopt.c mfcuk.c 
7
+mfcuk_SOURCES = crapto1.c crypto1.c mifare.c nfc-utils.c mfcuk_mifare.c mfcuk_finger.c mfcuk_utils.c xgetopt.c mfcuk.c log.c
8 8
 mfcuk_LDADD = @libnfc_LIBS@
9 9
 
10 10
 # dist_man_MANS = mfcuk.1

+ 10
- 0
src/log.c View File

@@ -0,0 +1,10 @@
1
+#include "log.h"
2
+
3
+void log_progress(uint32_t uid, uint8_t type, uint64_t key, uint32_t block,
4
+    uint32_t diff, uint32_t auth)
5
+{
6
+}
7
+
8
+void log_key(uint32_t block, uint64_t key)
9
+{
10
+}

+ 11
- 0
src/log.h View File

@@ -0,0 +1,11 @@
1
+#ifndef LOG_H
2
+# define LOG_H
3
+
4
+# include <stdint.h>
5
+
6
+void log_progress(uint32_t uid, uint8_t type, uint64_t key, uint32_t block,
7
+    uint32_t diff, uint32_t auth);
8
+
9
+void log_key(uint32_t block, uint64_t key);
10
+
11
+#endif /* !LOG_H */

+ 6
- 1
src/mfcuk.c View File

@@ -138,6 +138,8 @@
138 138
 #  include <byteswap.h>
139 139
 #endif
140 140
 
141
+#include "log.h"
142
+
141 143
 #if defined (__GNUC__)
142 144
 #  define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10)
143 145
 #  if GCC_VERSION >= 430
@@ -652,6 +654,7 @@ static uint32_t mfcuk_key_recovery_block(nfc_device *pnd, uint32_t uiUID, uint64
652 654
           crypto1_get_lfsr(current_state, &key_recovered);
653 655
 
654 656
           if (bfOpts['v'] && (verboseLevel > 1)) {
657
+            log_key(uiBlock, key_recovered);
655 658
             printf("\nINFO: block %d recovered KEY: %012"PRIx64"\n", uiBlock, key_recovered);
656 659
           }
657 660
 
@@ -1650,7 +1653,9 @@ int main(int argc, char *argv[])
1650 1653
           mfcuk_darkside_select_tag(pnd, iSleepAtFieldOFF, iSleepAfterFieldON, &ti.nti);
1651 1654
 
1652 1655
           // Print usefull/useless info (sort-of "Let me entertain you!")
1653
-          if (bfOpts['v'] && (verboseLevel > 2)) {
1656
+          log_progress(tag_recover_verify.uid, tag_recover_verify.type,
1657
+              crntRecovKey, block, numSpoofEntries, numAuthAttempts);
1658
+          if (bfOpts['v'] && (verboseLevel > 3)) {
1654 1659
             printf("\n-----------------------------------------------------\n");
1655 1660
             printf("Let me entertain you!\n");
1656 1661
             printf("    uid: %08x\n", tag_recover_verify.uid);

Loading…
Cancel
Save