forked from DrSchottky/mfcuk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Renamed project and binary to mfcuk (instead of mfcuk_keyrecovery_…
…darkside) - Fixed fingerprint related bugs - Moved Template data to correct path relative to where mfcuk binary is built
- Loading branch information
1 parent
7390ac0
commit 6fde5d8
Showing
23 changed files
with
792 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,7 @@ | ||
= Author | ||
Andrei Costin <[email protected]>, http://andreicostin.com | ||
|
||
= Contributors | ||
|
||
Romuald Conty <[email protected]> - porting to libnfc 1.3.x, 1.4.x, 1.5.x | ||
Nethemba Core Team <[email protected]> - core AC, AM, configure and packaging |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,73 +1,32 @@ | ||
AC_INIT([mfcuk], [0.3.2], [[email protected]]) | ||
AC_INIT([mfcuk], [0.3.3], [[email protected]]) | ||
|
||
AC_CONFIG_MACRO_DIR([m4]) | ||
|
||
AC_PROG_CC | ||
|
||
AC_CONFIG_HEADERS([config.h]) | ||
|
||
AC_CONFIG_SRCDIR([src/mfcuk.c]) | ||
|
||
AM_INIT_AUTOMAKE | ||
|
||
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) | ||
|
||
# Checks for libnfc. | ||
WITH_NFC=0 | ||
## Search libnfc with command line option (default prefix: auto) | ||
LIBNFC_PREFIX="auto" | ||
AC_ARG_WITH(libnfc,[--with-libnfc=DIR location of the libnfc], | ||
[if test "$withval" != no; then | ||
if test "$withval" != yes; then | ||
LIBNFC_PREFIX=$withval | ||
fi | ||
fi]) | ||
if test x"$LIBNFC_PREFIX" != "xauto"; then | ||
LIBNFC_CFLAGS="-L$LIBNFC_PREFIX/lib/ -I$LIBNFC_PREFIX/include/" | ||
LIBNFC_LIBS="-lnfc" | ||
fi | ||
|
||
# Search using pkg-config | ||
AC_PATH_PROG(PKG_CONFIG, pkg-config, [AC_MSG_WARN([pkg-config not found.])]) | ||
if test x"$WITH_NFC" = "x0"; then | ||
if test x"$PKG_CONFIG" != "x"; then | ||
LIBNFC_REQUIRED_VERSION=1.5.1 | ||
PKG_CHECK_MODULES([LIBNFC], [libnfc >= $LIBNFC_REQUIRED_VERSION], [WITH_NFC=1], [WITH_NFC=0]) | ||
fi | ||
fi | ||
CFLAGS="$CFLAGS $LIBNFC_CFLAGS" | ||
AC_CHECK_HEADERS([nfc/nfc.h],[WITH_NFC=1], AC_MSG_ERROR([A version of libnfc greater than or equal to $LIBNFC_REQUIRED_VERSION is required])) | ||
|
||
if test x"$WITH_NFC" = "x0"; then | ||
AC_MSG_ERROR([A version of libnfc greater than or equal to $LIBNFC_REQUIRED_VERSION is required.]) | ||
fi | ||
|
||
# Checks for programs. | ||
AC_PROG_CC | ||
|
||
# Checks for libraries. | ||
AC_CHECK_LIB([nfc], [nfc_version]) | ||
# Checks for pkg-config modules. | ||
LIBNFC_REQUIRED_VERSION=1.5.1 | ||
PKG_CHECK_MODULES([LIBNFC], [libnfc >= $LIBNFC_REQUIRED_VERSION], [], [AC_MSG_ERROR([libnfc >= $LIBNFC_REQUIRED_VERSION is mandatory.])]) | ||
|
||
# Checks for header files. | ||
AC_CHECK_HEADERS([byteswap.h]) | ||
AC_CHECK_HEADERS([endian.h sys/endian.h CoreFoundation/CoreFoundation.h]) | ||
AC_CHECK_HEADERS([stdint.h stdlib.h string.h sys/time.h unistd.h]) | ||
|
||
AC_DEFINE(_XOPEN_SOURCE, 600, [Enable POSIX extensions if present]) | ||
PKG_CONFIG_REQUIRES="libnfc" | ||
AC_SUBST([PKG_CONFIG_REQUIRES]) | ||
|
||
# Checks for typedefs, structures, and compiler characteristics. | ||
AC_HEADER_STDBOOL | ||
AC_TYPE_SIZE_T | ||
AC_TYPE_UINT16_T | ||
AC_TYPE_UINT32_T | ||
AC_TYPE_UINT64_T | ||
AC_TYPE_UINT8_T | ||
|
||
# Checks for library functions. | ||
AC_FUNC_MALLOC | ||
AC_FUNC_REALLOC | ||
AC_CHECK_FUNCS([memset strchr]) | ||
|
||
# Help us to write great code ;-) | ||
CFLAGS="$CFLAGS -Wall -pedantic -Wextra -std=c99" | ||
|
||
AC_CONFIG_FILES([Makefile | ||
src/Makefile]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,9 @@ | ||
bin_PROGRAMS = mfcuk_keyrecovery_darkside | ||
AM_CFLAGS = @LIBNFC_CFLAGS@ | ||
AM_LDFLAGS = @LIBNFC_LIBS@ | ||
|
||
noinst_HEADERS = \ | ||
crapto1.h \ | ||
mfcuk_finger.h \ | ||
mfcuk_keyrecovery_darkside.h \ | ||
mfcuk_mifare.h \ | ||
mfcuk_utils.h \ | ||
mifare.h \ | ||
nfc-utils.h \ | ||
xgetopt.h | ||
bin_PROGRAMS = mfcuk | ||
|
||
# set the include path found by configure | ||
mfcuk_keyrecovery_darkside_SOURCES = \ | ||
crapto1.c \ | ||
crypto1.c \ | ||
mfcuk_finger.c \ | ||
mfcuk_keyrecovery_darkside.c \ | ||
mfcuk_mifare.c \ | ||
mfcuk_utils.c \ | ||
mifare.c \ | ||
nfc-utils.c | ||
noinst_HEADERS = crapto1.h mifare.h nfc-utils.h mfcuk_mifare.h mfcuk_finger.h mfcuk_utils.h xgetopt.h mfcuk.h | ||
mfcuk_SOURCES = crapto1.c crypto1.c mifare.c nfc-utils.c mfcuk_mifare.c mfcuk_finger.c mfcuk_utils.c xgetopt.c mfcuk.c | ||
|
||
mfcuk_keyrecovery_darkside_LDADD = -lnfc -lusb -lpcsclite | ||
|
||
# dist_man_MANS = mfcuk_keyrecovery_darkside.1 | ||
# dist_man_MANS = mfcuk.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, | ||
MA 02110-1301, US$ | ||
Copyright (C) 2008-2008 bla <[email protected]> | ||
Copyright (C) 2008-2009 bla <[email protected]> | ||
*/ | ||
#ifndef CRAPTO1_INCLUDED | ||
#define CRAPTO1_INCLUDED | ||
|
@@ -35,12 +35,8 @@ uint32_t prng_successor(uint32_t x, uint32_t n); | |
|
||
struct Crypto1State* lfsr_recovery32(uint32_t ks2, uint32_t in); | ||
struct Crypto1State* lfsr_recovery64(uint32_t ks2, uint32_t ks3); | ||
uint32_t *lfsr_prefix_ks(uint8_t ks[8], int isodd); | ||
struct Crypto1State* lfsr_common_prefix(uint32_t pfx, uint32_t rr, uint8_t ks[8], uint8_t par[8][8]); | ||
|
||
uint8_t lfsr_rollback_bit(struct Crypto1State* s, uint32_t in, int fb); | ||
uint8_t lfsr_rollback_byte(struct Crypto1State* s, uint32_t in, int fb); | ||
uint32_t lfsr_rollback_word(struct Crypto1State* s, uint32_t in, int fb); | ||
void lfsr_rollback(struct Crypto1State* s, uint32_t in, int fb); | ||
int nonce_distance(uint32_t from, uint32_t to); | ||
#define FOREACH_VALID_NONCE(N, FILTER, FSIZE)\ | ||
uint32_t __n = 0,__M = 0, N = 0;\ | ||
|
@@ -57,25 +53,25 @@ int nonce_distance(uint32_t from, uint32_t to); | |
#define LF_POLY_EVEN (0x870804) | ||
#define BIT(x, n) ((x) >> (n) & 1) | ||
#define BEBIT(x, n) BIT(x, (n) ^ 24) | ||
static /*inline*/ int parity(uint32_t x) | ||
static inline int parity(uint32_t x) | ||
{ | ||
#if !defined __i386__ || !defined __GNUC__ | ||
x ^= x >> 16; | ||
x ^= x >> 8; | ||
x ^= x >> 4; | ||
return BIT(0x6996, x & 0xf); | ||
#else | ||
asm( "movl %1, %%eax\n" | ||
asm( "movl %1, %%eax\n" | ||
"mov %%ax, %%cx\n" | ||
"shrl $0x10, %%eax\n" | ||
"xor %%ax, %%cx\n" | ||
"xor %%ch, %%cl\n" | ||
"setpo %%al\n" | ||
"movzx %%al, %0\n": "=r"(x) : "r"(x): "eax","ecx"); | ||
"xor %%ch, %%cl\n" | ||
"setpo %%al\n" | ||
"movzx %%al, %0\n": "=r"(x) : "r"(x): "eax","ecx"); | ||
return x; | ||
#endif | ||
} | ||
static /*inline*/ int filter(uint32_t const x) | ||
static inline int filter(uint32_t const x) | ||
{ | ||
uint32_t f; | ||
|
||
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.