diff options
author | Toni Uhlig <matzeton@googlemail.com> | 2018-07-11 08:48:37 +0200 |
---|---|---|
committer | Toni Uhlig <matzeton@googlemail.com> | 2018-07-11 08:51:12 +0200 |
commit | 71e27ae1766e0090fa989aad7ee930152a1921de (patch) | |
tree | 5f07a7c63e9b03543d077f90a214bd8fbb09edb7 | |
parent | c8bc99eb8027a57570183e64e52fcb8fbc4c1e3d (diff) |
improved Makefile, check for supported arch
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r-- | .gitignore | 4 | ||||
-rw-r--r-- | Makefile | 7 | ||||
-rw-r--r-- | funcjmp_ext_x86.c | 3 | ||||
-rw-r--r-- | funcjmp_simple_x86.c (renamed from funcjmp_simple.c) | 3 |
4 files changed, 10 insertions, 7 deletions
@@ -6,7 +6,5 @@ overflow_tcp overflow_tcp_x64 sc-test sc-test_x64 -funcjmp_simple -funcjmp_ext +funcjmp_simple_x86 funcjmp_ext_x86 -format @@ -11,7 +11,7 @@ X64_FLAGS = -m64 -mpreferred-stack-boundary=4 SOURCES = $(wildcard *.c) TARGETS = $(patsubst %.c,%,$(SOURCES)) -all: $(TARGETS) shellcode crypter +all: $(TARGETS) overflow_x64 overflow_tcp_x64 sc-test_x64 shellcode crypter main: $(TARGETS) @@ -26,9 +26,8 @@ crypter: % : %.c $(CC) $(CFLAGS) $(X86_FLAGS) $(OCFLAGS) -o $@ $< -ifeq ($(LBITS),64) - -$(CC) $(CFLAGS) $(X64_FLAGS) $(OCFLAGS) -o $@_x64 $< -endif +%_x64 : %.c + $(CC) $(CFLAGS) $(X64_FLAGS) $(OCFLAGS) -o $@ $< rebuild: clean all diff --git a/funcjmp_ext_x86.c b/funcjmp_ext_x86.c index 9bf20f4..46e76bd 100644 --- a/funcjmp_ext_x86.c +++ b/funcjmp_ext_x86.c @@ -1,6 +1,9 @@ #include <stdio.h> #include <stdlib.h> +#ifndef __i386 +#error "Unsupported Architecture" +#endif #define INTEL_ASM(_asm_str) asm volatile(".intel_syntax noprefix"); \ asm volatile(_asm_str); \ diff --git a/funcjmp_simple.c b/funcjmp_simple_x86.c index 97db760..5291788 100644 --- a/funcjmp_simple.c +++ b/funcjmp_simple_x86.c @@ -1,6 +1,9 @@ #include <stdio.h> #include <stdlib.h> +#ifndef __i386 +#error "Unsupported Architecture" +#endif #define INTEL_ASM(_asm_str) asm volatile(".intel_syntax noprefix"); \ asm volatile(_asm_str); \ |