-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
70 lines (54 loc) · 2.69 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
CC := x86_64-w64-mingw32-gcc
CXX := x86_64-w64-mingw32-g++
LD := x86_64-w64-mingw32-ld
CFLAGS := -Wall -m64 -ffunction-sections -fno-asynchronous-unwind-tables -nostdlib -fno-ident -O2
#SysmonEnte
S_SRCSENTE := src/SysmonEnte/adjuststack.asm src/SysmonEnte/chkstk.asm src/SysmonEnte/gatetrampolin.asm
C_SRCSENTE := src/SysmonEnte/apiresolve.c src/SysmonEnte/main.c src/SysmonEnte/injection.c src/SysmonEnte/misc.c src/SysmonEnte/recycledgate.c src/SysmonEnte/threads.c src/SysmonEnte/token.c
OBJSENTE := $(patsubst src/SysmonEnte/%.asm,src/SysmonEnte/%.o,$(S_SRCSENTE)) $(patsubst src/SysmonEnte/%.c,src/SysmonEnte/%.o,$(C_SRCSENTE))
CCLDFLAGSENTE := -Wl,-Tsrc/SysmonEnte/linker.ld,--no-seh -DC2
#Kueken
S_SRCSKUEKEN := src/Kueken/adjuststack.asm src/Kueken/chkstk.asm
C_SRCSKUEKEN := src/Kueken/apiresolve.c src/Kueken/main.c
OBJSKUEKEN := $(patsubst src/Kueken/%.asm,src/Kueken/%.o,$(S_SRCSKUEKEN)) $(patsubst src/Kueken/%.c,src/Kueken/%.o,$(C_SRCSKUEKEN))
CCLDFLAGSKUEKEN := -Wl,-Tsrc/Kueken/linker.ld,--no-seh -DC2
all: bin/Kueken.exe bin/Kueken.bin src/SysmonEnte/kueken.h bin/SysmonEnte.exe bin/SysmonEnte.bin bin/EntenLoader.exe
bin/Kueken.exe: $(OBJSKUEKEN)
$(LD) -s $^ -o $@
bin/Kueken.bin: bin/Kueken.exe
objcopy -j .text -O binary $< $@
src/Kueken/%.o: src/Kueken/%.asm
nasm -f win64 $< -o $@
src/Kueken/%.o: src/Kueken/%.c
$(CC) $< $(CFLAGS) -c -o $@ $(CCLDFLAGSKUEKEN)
bin/SysmonEnte.exe: $(OBJSENTE)
$(LD) -s $^ -o $@
bin/SysmonEnte.bin: bin/SysmonEnte.exe
objcopy -j .text -O binary $< $@
src/SysmonEnte/%.o: src/SysmonEnte/%.asm
nasm -f win64 $< -o $@
src/SysmonEnte/%.o: src/SysmonEnte/%.c
$(CC) $< $(CFLAGS) -c -o $@ $(CCLDFLAGSENTE)
src/SysmonEnte/kueken.h: bin/Kueken.bin
( \
set -e; \
cat src/SysmonEnte/kueken.h.prefix; \
python3 helpers/convertToHex.py $< | xargs -i echo '{}';\
echo ';' \
mv [email protected] $@
src/EntenLoader/SysmonEnte.h: bin/SysmonEnte.bin
( \
set -e; \
cat src/EntenLoader/SysmonEnte.h.prefix; \
python3 helpers/convertToHex.py $< | xargs -i echo '{}';\
echo ';' \
mv [email protected] $@
bin/EntenLoader.exe: src/EntenLoader/EntenLoader.cpp src/EntenLoader/SysmonEnte.h
$(CXX) -s -o $@ $< -municode
rm bin/Kueken.exe bin/Kueken.bin bin/SysmonEnte.exe
.PHONY: clean
clean:
rm -rf $(OBJSENTE) $(OBJSKUEKEN) \
bin/Kueken.exe bin/Kueken.bin bin/SysmonEnte.exe bin/SysmonEnte.bin src/EntenLoader/SysmonEnte.h bin/EntenLoader.exe src/SysmonEnte/kueken.h