forked from rigred/sandsifter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
41 lines (37 loc) · 1.23 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
# sand sifter make file
#
# in x86, instructions run in 32 bit mode sometimes differ from the same
# instructions run in 64 bit mode. for this reason, it can be beneficial to
# fuzz both 32 and 64 bit instructions. this requires a 32 and 64 bit binary.
# afaict, capstone will not let you simultaneously install both 32 and 64 bit
# versions. to overcome this, we statically link to capstone. to build both a
# 32 bit and 64 bit injector:
#
# - build and install 32 bit capstone:
# ./make.sh nix32
# sudo ./make.sh nix32 install
#
# - build the 32 bit injector:
# make CFLAGS=-m32
# mv injector injector_32
#
# - build and install 64 bit capstone:
# ./make.sh
# sudo ./make.sh install
#
# - build the 64 bit injector:
# make injector
# mv injector injector_64
#
# you can now copy injector_32 and injector_64 to 'injector' before running
# ./sifter.py in order to explore that facet of the architecture.
#
#TODO: i don't know if i was ever able to get a statically linked capstone to
# work like i describe above
all: injector
injector: injector.o
$(CC) $(CFLAGS) $(LIBS) $(LDFLAGS) $< -Wall -static -no-pie -l:libcapstone.a -o sifter-injector -pthread
%.o: %.c
$(CC) $(CFLAGS) -c -g $< -o $@ -Wall
clean:
rm -f *.o sifter-injector