From 368a9d701233bda78358335f62aa84c8f81cbeaa Mon Sep 17 00:00:00 2001 From: segfault Date: Mon, 25 Mar 2019 01:49:56 +0100 Subject: initial commit Signed-off-by: segfault --- Makefile | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..30f80df --- /dev/null +++ b/Makefile @@ -0,0 +1,45 @@ +SUFFIX := .exe +CC := i686-w64-mingw32-gcc +AS := nasm +RM := rm +WINE := wine +ASFLAGS := -fwin32 +CFLAGS := -Wall -std=c99 -Os -s -static -ffunction-sections -fdata-sections -flto -fPIC -m32 -D_DEFAULT_SOURCE=1 -Wl,-x +ifeq ($(NOPASTA),y) +CFLAGS += -D_NOPASTA=1 +endif +ifeq ($(DEBUG),y) +CFLAGS += -g +endif +ifneq ($(SKID),) +CFLAGS += -DSKID=$(SKID) +endif + + +all: injector$(SUFFIX) dummy$(SUFFIX) + +injector$(SUFFIX): injector.o shellcode.o + $(CC) $(CFLAGS) -o $@ $^ + +injector.o: injector.c + $(CC) $(CFLAGS) -c -o $@ $< + +shellcode.o: shellcode.asm + $(AS) $(ASFLAGS) -o $@ $< + +dummy$(SUFFIX): dummy.o + $(CC) $(CFLAGS) -o $@ $^ + +dummy.o: dummy.c + $(CC) $(CFLAGS) -c -o $@ $< + +test: all + $(RM) -f patched_dummy$(SUFFIX) + @echo '~~~~~~ INJECTOR ~~~~~~' + $(WINE) injector$(SUFFIX) dummy$(SUFFIX) + @echo '~~~~~~ PATCHED DUMMY ~~~~~~' + $(WINE) patched_dummy$(SUFFIX) + +clean: + $(RM) -f injector$(SUFFIX) injector.o shellcode.o dummy$(SUFFIX) dummy.o + $(RM) -f patched_dummy$(SUFFIX) -- cgit v1.2.3