-
Notifications
You must be signed in to change notification settings - Fork 78
/
Makefile
executable file
·71 lines (52 loc) · 2.13 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# if -march=native does not work on your platform, you could try
# -msse
# -msse2
# -mavx
# or
# -mavx2
CC = gcc
CFLAGS = -std=gnu99 -O3 -march=native
LDFLAGS= -Wl,--allow-multiple-definition
all: solve_bs solve_piwi_bs solve_piwi libnfc_crypto1_crack
CRAPTEV1 = craptev1-v1.1/craptev1.c -I craptev1-v1.1/
CRAPTO1 = crapto1-v3.3/crapto1.c crapto1-v3.3/crypto1.c -I crapto1-v3.3/
CRYPTO1_BS = crypto1_bs.c crypto1_bs_crack.c
solve_bs:
$(CC) $(CFLAGS) [email protected] $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -o $@ -lpthread -lm $(LDFLAGS)
solve_piwi_bs:
$(CC) $(CFLAGS) [email protected] $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -o $@ -lpthread -lm $(LDFLAGS)
solve_piwi:
$(CC) $(CFLAGS) [email protected] $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -o $@ -lpthread $(LDFLAGS)
libnfc_crypto1_crack:
$(CC) $(CFLAGS) [email protected] $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -o $@ -lpthread -lnfc -lm $(LDFLAGS)
clean:
rm -f solve.so solve_bs solve_piwi_bs solve_piwi libnfc_crypto1_crack
get_craptev1:
echo 'Stop being lazy, find your own file!'
wget http://crapto1.netgarage.org/craptev1-v1.1.tar.xz
tar Jxvf craptev1-v1.1.tar.xz
get_crapto1:
echo 'Stop being lazy, find your own file!'
wget http://crapto1.netgarage.org/crapto1-v3.3.tar.xz
mkdir crapto1-v3.3
tar Jxvf crapto1-v3.3.tar.xz -C crapto1-v3.3
# Windows cross compilation
MINGW32 = i686-w64-mingw32-gcc
MINGW64 = x86_64-w64-mingw32-gcc
# solve.c code cannot be compiled on windows without patching the includes
WIN32EXES = solve_piwi_bs32.exe solve_piwi32.exe libnfc_crypto1_crack32.exe
win32: $(WIN32EXES)
win32_clean:
rm -f $(WIN32EXES)
WIN64EXES = solve_piwi_bs64.exe solve_piwi64.exe libnfc_crypto1_crack64.exe
win64: $(WIN64EXES)
win64_clean:
rm -f $(WIN64EXES)
solve_piwi_bs32.exe:
$(MINGW32) $(CFLAGS) solve_piwi_bs.c $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -static -m32 -o $@ -lpthread
solve_piwi_bs64.exe:
$(MINGW64) $(CFLAGS) solve_piwi_bs.c $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -static -o $@ -lpthread
solve_piwi32.exe:
$(MINGW32) $(CFLAGS) solve_piwi.c $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -static -m32 -o $@ -lpthread
solve_piwi64.exe:
$(MINGW64) $(CFLAGS) solve_piwi.c $(CRYPTO1_BS) $(CRAPTO1) ${CRAPTEV1} -static -o $@ -lpthread