diff options
author | segfault <segfault@secmail.pro> | 2019-03-25 01:49:56 +0100 |
---|---|---|
committer | segfault <segfault@secmail.pro> | 2019-03-25 01:49:56 +0100 |
commit | 368a9d701233bda78358335f62aa84c8f81cbeaa (patch) | |
tree | ac0d6c78d867954ff7d0cb326f84ad84053cf7df /Makefile |
initial commit
Signed-off-by: segfault <segfault@secmail.pro>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 45 |
1 files changed, 45 insertions, 0 deletions
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) |