-
Notifications
You must be signed in to change notification settings - Fork 0
/
makefile
127 lines (116 loc) · 3.26 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
.PHONY: build
build:
g++ -Wno-deprecated-declarations \
./src/main.cpp \
./src/serialization/Message.cpp \
./src/serialization/MessageDecoder.cpp \
./src/serialization/MessagePaddr.cpp \
./src/crypto/Srp.cpp \
./src/database/Connection.cpp \
./src/database/Firebird.cpp \
./src/crypto/Sha1.cpp \
./src/serialization/opcodes/Acceptdata.cpp \
./src/serialization/opcodes/Responsedata.cpp \
-I ./src/ \
-lcrypto \
-o firebird_cli
leaks:
g++ -Wno-deprecated-declarations \
./src/leaks.cpp \
./src/serialization/Message.cpp \
./src/serialization/MessageDecoder.cpp \
./src/serialization/MessagePaddr.cpp \
./src/crypto/Srp.cpp \
./src/database/Connection.cpp \
./src/database/Firebird.cpp \
./src/crypto/Sha1.cpp \
./src/utils/Profile.cpp \
./src/serialization/opcodes/Acceptdata.cpp \
./src/serialization/opcodes/Responsedata.cpp \
-I ./src/ \
-lcrypto \
-ggdb3 \
-o firebird_leaks
#./firebird_leaks
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./firebird_leaks
cli_leaks:
g++ -Wno-deprecated-declarations \
./src/main.cpp \
./src/serialization/Message.cpp \
./src/serialization/MessageDecoder.cpp \
./src/serialization/MessagePaddr.cpp \
./src/crypto/Srp.cpp \
./src/database/Connection.cpp \
./src/database/Firebird.cpp \
./src/crypto/Sha1.cpp \
./src/utils/Profile.cpp \
./src/serialization/opcodes/Acceptdata.cpp \
./src/serialization/opcodes/Responsedata.cpp \
-I ./src/ \
-lcrypto \
-ggdb3 \
-o firebird_leaks
#./firebird_leaks
valgrind --leak-check=full \
--show-leak-kinds=all \
--track-origins=yes \
--verbose \
--log-file=valgrind-out.txt \
./firebird_leaks
test:
cd src && g++ -Wno-deprecated-declarations \
test.cpp \
./serialization/Message.cpp \
./serialization/MessagePaddr.cpp \
./serialization/MessageDecoder.cpp \
./crypto/Srp.cpp \
./crypto/Sha1.cpp \
./database/Connection.cpp \
./serialization/opcodes/Acceptdata.cpp \
./serialization/opcodes/Responsedata.cpp \
-o ../firebird_cli_test -I ./ -lm -lcrypto
./firebird_cli_test --noisy
run: build
./firebird_cli
fuzz:
echo "fuzz"
./afl/afl-g++ -Wno-deprecated-declarations \
./src/fuzzing/FuzzMessageDecoder.cpp \
./src/serialization/Message.cpp \
./src/serialization/MessageDecoder.cpp \
./src/serialization/MessagePaddr.cpp \
./src/crypto/Srp.cpp \
./src/database/Connection.cpp \
./src/database/Firebird.cpp \
./src/crypto/Sha1.cpp \
./src/utils/Profile.cpp \
./src/serialization/opcodes/Acceptdata.cpp \
./src/serialization/opcodes/Responsedata.cpp \
-I ./src/ \
-lcrypto \
-o FuzzMessageDecoder
# ./FuzzMessageDecoder
./afl/afl-fuzz -i ./afl/input/ -o ./afl/output/ -- ./FuzzMessageDecoder
@@
fuzz_build:
wget -c https://lcamtuf.coredump.cx/afl/releases/afl-latest.tgz
tar -xf afl-latest.tgz
cd afl-2.52b && make
docker_run:
sudo docker container run -p 3050:3050 \
-it --entrypoint "/bin/bash" \
-t firebird_db
docker_build:
sudo docker build -t firebird_db .
node_addon:
#node-gyp configure
node-gyp build
delta: build node_addon
TIMEFORMAT='%3lR' /usr/bin/time -p ./firebird_cli
TIMEFORMAT='%3lR' /usr/bin/time -p node ./ref/node-firebird/example.js
TIMEFORMAT='%3lR' /usr/bin/time -p node test.js