diff options
Diffstat (limited to 'bruiser')
-rw-r--r-- | bruiser/bruiser.cpp | 2 | ||||
-rw-r--r-- | bruiser/lua-5.3.4/Makefile | 2 | ||||
-rw-r--r-- | bruiser/lua-5.3.4/src/Makefile | 4 | ||||
-rw-r--r-- | bruiser/luatablegen/makefile | 25 | ||||
-rw-r--r-- | bruiser/makefile | 30 |
5 files changed, 44 insertions, 19 deletions
diff --git a/bruiser/bruiser.cpp b/bruiser/bruiser.cpp index e47d37c..65564b4 100644 --- a/bruiser/bruiser.cpp +++ b/bruiser/bruiser.cpp @@ -23,7 +23,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.* /*project headers*/ #include "bruiser.h" #include "CompletionHints.h" -#include "../mutator_aux.h" +#include "../m0/mutator_aux.h" #include "mutagen.h" #include "ORCmutation.h" #include "executioner.h" diff --git a/bruiser/lua-5.3.4/Makefile b/bruiser/lua-5.3.4/Makefile index 119110d..e97f52a 100644 --- a/bruiser/lua-5.3.4/Makefile +++ b/bruiser/lua-5.3.4/Makefile @@ -4,7 +4,7 @@ # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= # Your platform. See PLATS for possible values. -PLAT= none +PLAT= linux # Where to install. The installation starts in the src and doc directories, # so take care if INSTALL_TOP is not an absolute path. See the local target. diff --git a/bruiser/lua-5.3.4/src/Makefile b/bruiser/lua-5.3.4/src/Makefile index 0eb167f..202d0c9 100644 --- a/bruiser/lua-5.3.4/src/Makefile +++ b/bruiser/lua-5.3.4/src/Makefile @@ -4,7 +4,7 @@ # == CHANGE THE SETTINGS BELOW TO SUIT YOUR ENVIRONMENT ======================= # Your platform. See PLATS for possible values. -PLAT= none +PLAT= linux CC= gcc -std=gnu99 CFLAGS= -fpic -O2 -Wall -Wextra -DLUA_COMPAT_MODULE -DLUA_COMPAT_5_2 $(SYSCFLAGS) $(MYCFLAGS) @@ -49,7 +49,7 @@ ALL_A= $(LUA_A) # Targets start here. default: $(PLAT) -all: $(ALL_T) +all: $(ALL_A) o: $(ALL_O) diff --git a/bruiser/luatablegen/makefile b/bruiser/luatablegen/makefile index 472c591..b59a216 100644 --- a/bruiser/luatablegen/makefile +++ b/bruiser/luatablegen/makefile @@ -1,16 +1,25 @@ CC=clang CC?=clang -CC_FLAGS=$(shell $(PY_CONF) --includes) -fpic +CC_FLAGS=-fpic CC_EXTRA?= CC_FLAGS+=$(CC_EXTRA) SRCS=$(wildcard *.c) TBG_OBJLIST=$(patsubst %.c, %.o , $(wildcard *.c)) +TBG_OBJLIST_DBG=$(patsubst %.c, %.odbg , $(wildcard *.c)) +TBG_OBJLIST_COV=$(patsubst %.c, %.ocov , $(wildcard *.c)) +ADD_SANITIZERS_CC= -g -fsanitize=address -fno-omit-frame-pointer +ADD_SANITIZERS_LD= -g -fsanitize=address +MEM_SANITIZERS_CC= -g -fsanitize=memory -fno-omit-frame-pointer +MEM_SANITIZERS_LD= -g -fsanitize=memory +UB_SANITIZERS_CC= -g -fsanitize=undefined -fno-omit-frame-pointer +UB_SANITIZERS_LD= -g -fsanitize=undefined +COV_CC= -fprofile-instr-generate -fcoverage-mapping .DEFAULT:all .PHONY:all clean help -all:$(TBG_OBJLIST) +all:$(TBG_OBJLIST) $(TBG_OBJLIST_DBG) $(TBG_OBJLIST_COV) @echo $(TBG_OBJLIST) @echo $(TBG_OBJLIST_INC) @@ -19,14 +28,22 @@ depend:.depend .depend:$(SRCS) rm -rf .depend $(CC) -MM $(CC_FLAGS) $^ > ./.depend + echo $(patsubst %.o:, %.odbg:, $(shell $(CC) -MM $(CC_FLAGS) $^)) | sed -r 's/[A-Za-z0-9\-\_]+\.odbg/\n&/g' >> ./.depend + echo $(patsubst %.o:, %.ocov:, $(shell $(CC) -MM $(CC_FLAGS) $^)) | sed -r 's/[A-Za-z0-9\-\_]+\.ocov/\n&/g' >> ./.depend -include ./.depend .c.o: - $(CC) $(CC_FLAGS) -c $< -o $@ + $(CC) $(CC_FLAGS) -c $< -o $@ + +%.odbg:%.c + $(CC) $(CC_FLAGS) -g -c $< -o $@ + +%.ocov:%.c + $(CC) $(CC_FLAGS) $(COV_CC) -c $< -o $@ clean: - rm -f *.o *~ $(TARGET) + rm -f *.o *~ $(TARGET) *.ocov *.odbg rm .depend help: diff --git a/bruiser/makefile b/bruiser/makefile index a5194c0..4a61d66 100644 --- a/bruiser/makefile +++ b/bruiser/makefile @@ -72,8 +72,10 @@ SRCS:=$(wildcard *.cpp) C_SRCS:=$(wildcard *.c) CXX_FLAGS+=$(CXX_EXTRA) EXTRA_LD_FLAGS+=$(shell $(PY_CONF) --ldflags) -lffi -lcapstone -lkeystone -L./lua-5.3.4/src -llua -TBG_OBJLIST_INC=$(patsubst ./luatablegen/%.c, ./luatablegen/%.o, $(wildcard ./luatablegen/*.c)) LD_FLAGS+=$(EXTRA_LD_FLAGS) +TBG_OBJLIST_INC=$(patsubst ./luatablegen/%.c, ./luatablegen/%.o, $(wildcard ./luatablegen/*.c)) +TBG_OBJLIST_DBG_INC=$(patsubst ./luatablegen/%.c, ./luatablegen/%.odbg, $(wildcard ./luatablegen/*.c)) +TBG_OBJLIST_COV_INC=$(patsubst ./luatablegen/%.c, ./luatablegen/%.ocov, $(wildcard ./luatablegen/*.c)) .DEFAULT:all @@ -104,11 +106,17 @@ dependc:.dependc .c.o: $(CC) $(CC_FLAGS) -c $< -o $@ +%.ocov:%.c + $(CC) $(CC_FLAGS) $(COV_CXX) -c $< -o $@ + +%.odbg:%.c + $(CC) $(CC_FLAGS) -g -c $< -o $@ + .cpp.o: $(CXX) $(CXX_FLAGS) -c $< -o $@ -../mutator_aux.o:../mutator_aux.cpp - $(CXX) $(CXX_FLAGS) -c $< -o $@ +#../mutator_aux.o:../mutator_aux.cpp + #$(CXX) $(CXX_FLAGS) -c $< -o $@ linenoise.o: $(CC) $(CC_FLAGS) linenoise/linenoise.c -c -o linenoise.o @@ -123,7 +131,7 @@ linenoise.o: $(MAKE) -C luatablegen $(LIB_LUA): - $(MAKE) -C lua-5.3.4/src linux a + $(MAKE) -C lua-5.3.4/src linux %.odbg:%.cpp $(CXX) $(CXX_FLAGS) -g -c $< -o $@ @@ -131,16 +139,17 @@ $(LIB_LUA): %.ocov:%.cpp $(CXX) $(CXX_FLAGS) $(COV_CXX) -c $< -o $@ -$(TARGET): $(TARGET).o ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +$(TARGET): $(TARGET).o ../m0/mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) $(CXX) $^ $(LD_FLAGS) -o $@ -$(TARGET)-static: $(TARGET).o ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +# currently broken since it needs a static libpython +$(TARGET)-static: $(TARGET).o ../m0/mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) $(CXX) $^ $(LD_FLAGS) -static -o $@ -$(TARGET)-dbg: $(TARGET).odbg ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +$(TARGET)-dbg: $(TARGET).odbg ../m0/mutator_aux.odbg ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.odbg mutagen.o ORCmutation.o bruiserffi.odbg asmrewriter.odbg bruisercapstone.odbg ramdump.odbg ffs.odbg $(LIB_LUA) $(TBG_OBJLIST_DBG_INC) $(CXX) $^ $(LD_FLAGS) -g -o $@ -$(TARGET)-cov: $(TARGET).ocov ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +$(TARGET)-cov: $(TARGET).ocov ../m0/mutator_aux.ocov ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.ocov mutagen.o ORCmutation.o bruiserffi.ocov asmrewriter.ocov bruisercapstone.ocov ramdump.ocov ffs.ocov $(LIB_LUA) $(TBG_OBJLIST_COV_INC) $(CXX) $^ $(LD_FLAGS) $(COV_LD) -o $@ cov: @@ -168,10 +177,10 @@ tags:$(SRCS) %.dis: %.o objdump -r -d -M intel -S $< > $@ -$(TARGET).so: $(TARGET).o ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +$(TARGET).so: $(TARGET).o ../m0/mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) $(CXX) $^ $(LD_FLAGS) -shared -o $@ -$(TARGET).a: $(TARGET).o ../mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) +$(TARGET).a: $(TARGET).o ../m0/mutator_aux.o ../tinyxml2/tinyxml2.o linenoise.o CompletionHints.o mutagen.o ORCmutation.o bruiserffi.o asmrewriter.o bruisercapstone.o ramdump.o ffs.o $(LIB_LUA) $(TBG_OBJLIST_INC) ar rcs $(TARGET).a $(TARGET).o clean: @@ -182,7 +191,6 @@ deepclean: rm -f *.o *.dis *.odbg *.ocov *~ $(TARGET) $(TARGET).so tags $(TARGET)-static $(TARGET)-dbg $(TARGET).a $(TARGET)-cov FILE*.cpp FILE*.hpp rm .depend $(MAKE) -C lua-5.3.4 clean - $(MAKE) -C LuaJIT clean $(MAKE) -C luatablegen clean help: |