forked from plasma-disassembler/plasma
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (35 loc) · 1.27 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
TESTS_DIR = tests
SRC = $(shell ls -d $(TESTS_DIR)/*.c)
REV = $(patsubst $(TESTS_DIR)/%.c, $(TESTS_DIR)/%.rev, $(SRC))
BIN = $(patsubst $(TESTS_DIR)/%.c, $(TESTS_DIR)/%.bin, $(SRC))
.PHONY : all check compile FORCE clean
FLAGS[tests/server.c] = "-lpthread"
FLAGS[tests/canary_plt.c] = "-fstack-protector"
FLAGS[tests/strlen.c] = "-Os"
FLAGS[tests/andor5.c] = "-O3"
FLAGS[tests/andor6.c] = "-O3"
SYMBOLS[tests/server.rev] = "main" "connection_handler"
SYMBOLS[tests/pendu.rev] = "_main" "___main" "__imp___cexit"
SYMBOLS[tests/shellcode.rev] = "0x0"
SYMBOLS[tests/malloc.rev] = "malloc"
SYMBOLS[tests/entryloop1.rev] = "0x4041b0"
OPTIONS[tests/shellcode.rev] = "--raw x86"
OPTIONS[tests/malloc.rev] = "--raw x64 --rawbase 0x77110"
OPTIONS[tests/entryloop1.rev] = "--raw x64 --rawbase 0x4041b0"
all: check
check:
@python3 test_reverse.py
# Verbose : print the diff at each test
# set the variable V=1 on the commande line
# Don't rebuild. We want to keep the original rev file.
# You need to recreate the file .rev at hand (with the options -nc -ns)
# Or you can use the file regen.sh
oldcheck: $(REV)
FORCE:
$(TESTS_DIR)/%.rev: FORCE
@./diff.sh $@ ${OPTIONS[$@]} ${V} $(SYMBOLS[$@])
clean:
@rm -f tmp*
compile: $(BIN)
$(TESTS_DIR)/%.bin: $(TESTS_DIR)/%.c
gcc $< $(FLAGS[$^]) -o $@