-
Notifications
You must be signed in to change notification settings - Fork 243
/
Makefile.mingw
128 lines (85 loc) · 10.8 KB
/
Makefile.mingw
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
BOFNAME := nanodump
CC_x64 := x86_64-w64-mingw32-gcc
CC_x86 := i686-w64-mingw32-gcc
GCC := gcc
STRIP_x64 := x86_64-w64-mingw32-strip
STRIP_x86 := i686-w64-mingw32-strip
OPTIONS := -masm=intel -Wall -I include -Wl,--dynamicbase
PPL_MEDIC_OPTIONS := -Wno-trigraphs -DPASS_PARAMS_VIA_NAMED_PIPES=1
SSP_OPTIONS := -DPASS_PARAMS_VIA_NAMED_PIPES=1
nanodump: clean
$(info ###### RELEASE ######)
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x64.exe $(OPTIONS) -DNANO -DEXE
$(STRIP_x64) --strip-all dist/$(BOFNAME).x64.exe
$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x86.exe $(OPTIONS) -DNANO -DEXE
$(STRIP_x86) --strip-all dist/$(BOFNAME).x86.exe
$(CC_x64) -c source/entry.c -o dist/$(BOFNAME).x64.o $(OPTIONS) -DNANO -DBOF
$(STRIP_x64) --strip-unneeded dist/$(BOFNAME).x64.o
$(CC_x86) -c source/entry.c -o dist/$(BOFNAME).x86.o $(OPTIONS) -DNANO -DBOF
$(STRIP_x86) --strip-unneeded dist/$(BOFNAME).x86.o
$(GCC) source/bin2c.c -o dist/bin2c -static -s -Os
$(CC_x64) source/utils.c source/handle.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/dinvoke.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ssp.x64.dll $(OPTIONS) $(SSP_OPTIONS) -DNANO -DSSP -DDDL -shared
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ssp.x64.dll
./dist/bin2c dist/$(BOFNAME)_ssp.x64.dll $(BOFNAME)_ssp_dll > include/$(BOFNAME)_ssp_dll.x64.h
$(CC_x86) source/utils.c source/handle.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/dinvoke.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ssp.x86.dll $(OPTIONS) $(SSP_OPTIONS) -DNANO -DSSP -DDDL -shared
$(STRIP_x86) --strip-all dist/$(BOFNAME)_ssp.x86.dll
./dist/bin2c dist/$(BOFNAME)_ssp.x86.dll $(BOFNAME)_ssp_dll > include/$(BOFNAME)_ssp_dll.x86.h
$(CC_x64) -c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x64.o $(OPTIONS) $(SSP_OPTIONS) -DBOF -DSSP
$(STRIP_x64) --strip-unneeded dist/$(BOFNAME)_ssp.x64.o
$(CC_x86) -c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x86.o $(OPTIONS) $(SSP_OPTIONS) -DBOF -DSSP
$(STRIP_x86) --strip-unneeded dist/$(BOFNAME)_ssp.x86.o
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/pipe.c source/ssp/ssp_utils.c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x64.exe $(OPTIONS) $(SSP_OPTIONS) -DEXE -DSSP
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ssp.x64.exe
$(CC_x86) source/utils.c source/syscalls.c source/dinvoke.c source/pipe.c source/ssp/ssp_utils.c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x86.exe $(OPTIONS) $(SSP_OPTIONS) -DEXE -DSSP
$(STRIP_x86) --strip-all dist/$(BOFNAME)_ssp.x86.exe
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/entry.c -o dist/$(BOFNAME)_ppl_dump.x64.dll $(OPTIONS) -DNANO -DPPL_DUMP -DDDL -shared
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ppl_dump.x64.dll
./dist/bin2c dist/$(BOFNAME)_ppl_dump.x64.dll $(BOFNAME)_ppl_dump_dll > include/$(BOFNAME)_ppl_dump_dll.x64.h
$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/entry.c -o dist/$(BOFNAME)_ppl_dump.x86.dll $(OPTIONS) -DNANO -DPPL_DUMP -DDDL -shared
$(STRIP_x86) --strip-all dist/$(BOFNAME)_ppl_dump.x86.dll
./dist/bin2c dist/$(BOFNAME)_ppl_dump.x86.dll $(BOFNAME)_ppl_dump_dll > include/$(BOFNAME)_ppl_dump_dll.x86.h
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_dump.c -o dist/$(BOFNAME)_ppl_dump.x64.exe $(OPTIONS) -DEXE -DPPL_DUMP
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ppl_dump.x64.exe
$(CC_x86) source/utils.c source/syscalls.c source/dinvoke.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_dump.c -o dist/$(BOFNAME)_ppl_dump.x86.exe $(OPTIONS) -DEXE -DPPL_DUMP
$(STRIP_x86) --strip-all dist/$(BOFNAME)_ppl_dump.x86.exe
$(CC_x64) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_dump.x64.o $(OPTIONS) -DBOF -DPPL_DUMP
$(STRIP_x64) --strip-unneeded dist/$(BOFNAME)_ppl_dump.x64.o
$(CC_x86) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_dump.x86.o $(OPTIONS) -DBOF -DPPL_DUMP
$(STRIP_x86) --strip-unneeded dist/$(BOFNAME)_ppl_dump.x86.o
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/ppl/ppl_medic_dll.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ppl_medic.x64.dll $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DNANO -DPPL_MEDIC -DDDL -shared
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ppl_medic.x64.dll
./dist/bin2c dist/$(BOFNAME)_ppl_medic.x64.dll $(BOFNAME)_ppl_medic_dll > include/$(BOFNAME)_ppl_medic_dll.x64.h
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/handle.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_medic.c source/pipe.c source/ppl/ppl_medic_client.c -o dist/$(BOFNAME)_ppl_medic.x64.exe $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DEXE -DPPL_MEDIC -DNANO
$(STRIP_x64) --strip-all dist/$(BOFNAME)_ppl_medic.x64.exe
$(CC_x64) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_medic.x64.o $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DBOF -DPPL_MEDIC
$(STRIP_x64) --strip-unneeded dist/$(BOFNAME)_ppl_medic.x64.o
$(GCC) source/restore_signature.c -o scripts/restore_signature -static -s -Os
$(STRIP_x64) --strip-all scripts/restore_signature
debug: clean
$(info ###### DEBUG ######)
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x64.exe $(OPTIONS) -DNANO -DEXE -DDEBUG
$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/dinvoke.c source/utils.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/malseclogon.c source/nanodump.c source/werfault.c source/entry.c -o dist/$(BOFNAME).x86.exe $(OPTIONS) -DNANO -DEXE -DDEBUG
$(CC_x64) -c source/entry.c -o dist/$(BOFNAME).x64.o $(OPTIONS) -DNANO -DBOF -DDEBUG
$(CC_x86) -c source/entry.c -o dist/$(BOFNAME).x86.o $(OPTIONS) -DNANO -DBOF -DDEBUG
$(GCC) source/bin2c.c -o dist/bin2c -static -s -Os
$(CC_x64) source/utils.c source/handle.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/dinvoke.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ssp.x64.dll $(OPTIONS) $(SSP_OPTIONS) -DNANO -DSSP -DDDL -shared -DDEBUG
./dist/bin2c dist/$(BOFNAME)_ssp.x64.dll $(BOFNAME)_ssp_dll > include/$(BOFNAME)_ssp_dll.x64.h
$(CC_x86) source/utils.c source/handle.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/dinvoke.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ssp.x86.dll $(OPTIONS) $(SSP_OPTIONS) -DNANO -DSSP -DDDL -shared -DDEBUG
./dist/bin2c dist/$(BOFNAME)_ssp.x86.dll $(BOFNAME)_ssp_dll > include/$(BOFNAME)_ssp_dll.x86.h
$(CC_x64) -c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x64.o $(OPTIONS) $(SSP_OPTIONS) -DBOF -DSSP -DDEBUG
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/pipe.c source/ssp/ssp_utils.c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x64.exe $(OPTIONS) $(SSP_OPTIONS) -DEXE -DSSP -DDEBUG
$(CC_x86) source/utils.c source/syscalls.c source/dinvoke.c source/pipe.c source/ssp/ssp_utils.c source/ssp/ssp.c -o dist/$(BOFNAME)_ssp.x86.exe $(OPTIONS) $(SSP_OPTIONS) -DEXE -DSSP -DDEBUG
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/entry.c -o dist/$(BOFNAME)_ppl_dump.x64.dll $(OPTIONS) -DNANO -DPPL_DUMP -DDDL -shared -DDEBUG
./dist/bin2c dist/$(BOFNAME)_ppl_dump.x64.dll $(BOFNAME)_ppl_dump_dll > include/$(BOFNAME)_ppl_dump_dll.x64.h
$(CC_x86) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/entry.c -o dist/$(BOFNAME)_ppl_dump.x86.dll $(OPTIONS) -DNANO -DPPL_DUMP -DDDL -shared -DDEBUG
./dist/bin2c dist/$(BOFNAME)_ppl_dump.x86.dll $(BOFNAME)_ppl_dump_dll > include/$(BOFNAME)_ppl_dump_dll.x86.h
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_dump.c -o dist/$(BOFNAME)_ppl_dump.x64.exe $(OPTIONS) -DEXE -DPPL_DUMP -DDEBUG
$(CC_x86) source/utils.c source/syscalls.c source/dinvoke.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_dump.c -o dist/$(BOFNAME)_ppl_dump.x86.exe $(OPTIONS) -DEXE -DPPL_DUMP -DDEBUG
$(CC_x64) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_dump.x64.o $(OPTIONS) -DBOF -DPPL_DUMP -DDEBUG
$(CC_x64) source/spoof_callstack.c source/hw_breakpoint.c source/shtinkering.c source/output.c source/ppl/cleanup.c source/utils.c source/dinvoke.c source/handle.c source/impersonate.c source/modules.c source/syscalls.c source/token_priv.c source/nanodump.c source/ppl/ppl_medic_dll.c source/pipe.c source/entry.c -o dist/$(BOFNAME)_ppl_medic.x64.dll $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DNANO -DPPL_MEDIC -DDDL -shared -DDEBUG
./dist/bin2c dist/$(BOFNAME)_ppl_medic.x64.dll $(BOFNAME)_ppl_medic_dll > include/$(BOFNAME)_ppl_medic_dll.x64.h
$(CC_x64) source/utils.c source/syscalls.c source/dinvoke.c source/handle.c source/token_priv.c source/ppl/ppl_utils.c source/impersonate.c source/ppl/ppl.c source/ppl/ppl_medic.c source/pipe.c source/ppl/ppl_medic_client.c -o dist/$(BOFNAME)_ppl_medic.x64.exe $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DEXE -DPPL_MEDIC -DNANO -DDEBUG
$(CC_x64) -c source/ppl/ppl.c -o dist/$(BOFNAME)_ppl_medic.x64.o $(OPTIONS) $(PPL_MEDIC_OPTIONS) -DBOF -DPPL_MEDIC -DDEBUG
$(GCC) source/restore_signature.c -o scripts/restore_signature -static -s -Os
clean:
rm -f dist/*