forked from airbus-cyber/ghidralligator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
38 lines (25 loc) · 1.22 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
FLAGS=-Wall -Wno-sign-compare
PRJ_NAME=ghidralligator
STD_LIB_VERSION=c++17
GHIDRA_SRC=-I./src
EMU_HEADERS=-I./headers
LNK=src/libsla.a
libsla.a:
$(MAKE) -C src/ $@
libsla_dbg.a:
$(MAKE) -C src/ $@
ghidralligator_dbg: libsla_dbg.a
rm -f $(PRJ_NAME)_dbg
g++ -g $(FLAGS) -lmcheck -std=$(STD_LIB_VERSION) $(PRJ_NAME).cc ./user_hooks/*_hooks.cc fuzzers.cc memory.cc cmdline.cc parser.cc afl.cc utils.cc $(GHIDRA_SRC) $(EMU_HEADERS) -o $(PRJ_NAME)_dbg -ldl src/libsla_dbg.a -lstdc++fs
ghidralligator: libsla.a
rm -f $(PRJ_NAME)
g++ -O3 $(FLAGS) -std=$(STD_LIB_VERSION) $(PRJ_NAME).cc ./user_hooks/*_hooks.cc fuzzers.cc memory.cc cmdline.cc parser.cc afl.cc utils.cc $(GHIDRA_SRC) $(EMU_HEADERS) -o $(PRJ_NAME) -ldl $(LNK) -lstdc++fs
ghidralligator_fast: libsla.a
rm -f $(PRJ_NAME)_fast*
cat ghidralligator.cc | grep -v printf | grep -v debug_print | grep -v verbose_print | grep -v hexdump > $(PRJ_NAME)_fast.cc
g++ -O3 $(FLAGS) -std=$(STD_LIB_VERSION) $(PRJ_NAME)_fast.cc ./user_hooks/*_hooks.cc fuzzers.cc memory.cc cmdline.cc parser.cc afl.cc utils.cc $(GHIDRA_SRC) $(EMU_HEADERS) -o $(PRJ_NAME)_fast -ldl $(LNK) -lstdc++fs
clean:
rm -f $(LNK)
$(MAKE) -C src/ clean
rm -rf *.o $(PRJ_NAME) $(PRJ_NAME)_dbg
rm -rf ./tmp_dir/