Sfoglia il codice sorgente

hook functions

master
Robin Thoni 9 anni fa
parent
commit
721c769a5a
4 ha cambiato i file con 29 aggiunte e 3 eliminazioni
  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 Vedi File

2
 
2
 
3
 bin_PROGRAMS = mfcuk
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
 mfcuk_LDADD = @libnfc_LIBS@
8
 mfcuk_LDADD = @libnfc_LIBS@
9
 
9
 
10
 # dist_man_MANS = mfcuk.1
10
 # dist_man_MANS = mfcuk.1

+ 10
- 0
src/log.c Vedi File

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 Vedi File

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 Vedi File

138
 #  include <byteswap.h>
138
 #  include <byteswap.h>
139
 #endif
139
 #endif
140
 
140
 
141
+#include "log.h"
142
+
141
 #if defined (__GNUC__)
143
 #if defined (__GNUC__)
142
 #  define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10)
144
 #  define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__ * 10)
143
 #  if GCC_VERSION >= 430
145
 #  if GCC_VERSION >= 430
652
           crypto1_get_lfsr(current_state, &key_recovered);
654
           crypto1_get_lfsr(current_state, &key_recovered);
653
 
655
 
654
           if (bfOpts['v'] && (verboseLevel > 1)) {
656
           if (bfOpts['v'] && (verboseLevel > 1)) {
657
+            log_key(uiBlock, key_recovered);
655
             printf("\nINFO: block %d recovered KEY: %012"PRIx64"\n", uiBlock, key_recovered);
658
             printf("\nINFO: block %d recovered KEY: %012"PRIx64"\n", uiBlock, key_recovered);
656
           }
659
           }
657
 
660
 
1650
           mfcuk_darkside_select_tag(pnd, iSleepAtFieldOFF, iSleepAfterFieldON, &ti.nti);
1653
           mfcuk_darkside_select_tag(pnd, iSleepAtFieldOFF, iSleepAfterFieldON, &ti.nti);
1651
 
1654
 
1652
           // Print usefull/useless info (sort-of "Let me entertain you!")
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
             printf("\n-----------------------------------------------------\n");
1659
             printf("\n-----------------------------------------------------\n");
1655
             printf("Let me entertain you!\n");
1660
             printf("Let me entertain you!\n");
1656
             printf("    uid: %08x\n", tag_recover_verify.uid);
1661
             printf("    uid: %08x\n", tag_recover_verify.uid);

Loading…
Annulla
Salva