|
| 1 | +WORKDIR = `pwd` |
| 2 | + |
| 3 | +CC = gcc |
| 4 | +CXX = g++ |
| 5 | +AR = ar |
| 6 | +LD = g++ |
| 7 | +WINDRES = windres |
| 8 | + |
| 9 | +INC = -I../Dependencies/beaengine/include |
| 10 | +CFLAGS = -Wall -fPIC -D RECLASSNET64=1 |
| 11 | +RESINC = |
| 12 | +LIBDIR = |
| 13 | +LIB = -lstdc++fs |
| 14 | +LDFLAGS = -shared |
| 15 | + |
| 16 | +INC_DEBUG = $(INC) |
| 17 | +CFLAGS_DEBUG = $(CFLAGS) -g |
| 18 | +RESINC_DEBUG = $(RESINC) |
| 19 | +RCFLAGS_DEBUG = $(RCFLAGS) |
| 20 | +LIBDIR_DEBUG = $(LIBDIR) |
| 21 | +LIB_DEBUG = $(LIB) |
| 22 | +LDFLAGS_DEBUG = $(LDFLAGS) |
| 23 | +OBJDIR_DEBUG = obj/debug |
| 24 | +DEP_DEBUG = |
| 25 | +OUT_DEBUG = build/debug/NativeCore.so |
| 26 | + |
| 27 | +INC_RELEASE = $(INC) |
| 28 | +CFLAGS_RELEASE = $(CFLAGS) -O2 |
| 29 | +RESINC_RELEASE = $(RESINC) |
| 30 | +RCFLAGS_RELEASE = $(RCFLAGS) |
| 31 | +LIBDIR_RELEASE = $(LIBDIR) |
| 32 | +LIB_RELEASE = $(LIB) |
| 33 | +LDFLAGS_RELEASE = $(LDFLAGS) -s |
| 34 | +OBJDIR_RELEASE = obj/release |
| 35 | +DEP_RELEASE = |
| 36 | +OUT_RELEASE = build/release/NativeCore.so |
| 37 | + |
| 38 | +OBJ_DEBUG = $(OBJDIR_DEBUG)/WriteRemoteMemory.o $(OBJDIR_DEBUG)/ReadRemoteMemory.o $(OBJDIR_DEBUG)/OpenRemoteProcess.o $(OBJDIR_DEBUG)/IsProcessValid.o $(OBJDIR_DEBUG)/Input.o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_DEBUG)/EnumerateProcesses.o $(OBJDIR_DEBUG)/DisassembleCode.o $(OBJDIR_DEBUG)/Debugger.o $(OBJDIR_DEBUG)/ControlRemoteProcess.o $(OBJDIR_DEBUG)/CloseRemoteProcess.o $(OBJDIR_DEBUG)/BaeEngine.o |
| 39 | + |
| 40 | +OBJ_RELEASE = $(OBJDIR_RELEASE)/WriteRemoteMemory.o $(OBJDIR_RELEASE)/ReadRemoteMemory.o $(OBJDIR_RELEASE)/OpenRemoteProcess.o $(OBJDIR_RELEASE)/IsProcessValid.o $(OBJDIR_RELEASE)/Input.o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR_RELEASE)/EnumerateProcesses.o $(OBJDIR_RELEASE)/DisassembleCode.o $(OBJDIR_RELEASE)/Debugger.o $(OBJDIR_RELEASE)/ControlRemoteProcess.o $(OBJDIR_RELEASE)/CloseRemoteProcess.o $(OBJDIR_RELEASE)/BaeEngine.o |
| 41 | + |
| 42 | +all: debug release |
| 43 | + |
| 44 | +clean: clean_debug clean_release |
| 45 | + |
| 46 | +before_debug: |
| 47 | + test -d build/debug || mkdir -p build/debug |
| 48 | + test -d $(OBJDIR_DEBUG) || mkdir -p $(OBJDIR_DEBUG) |
| 49 | + |
| 50 | +after_debug: |
| 51 | + |
| 52 | +debug: before_debug out_debug after_debug |
| 53 | + |
| 54 | +out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) |
| 55 | + $(CXX) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG) |
| 56 | + |
| 57 | +$(OBJDIR_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp |
| 58 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR_DEBUG)/WriteRemoteMemory.o |
| 59 | + |
| 60 | +$(OBJDIR_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp |
| 61 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR_DEBUG)/ReadRemoteMemory.o |
| 62 | + |
| 63 | +$(OBJDIR_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp |
| 64 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR_DEBUG)/OpenRemoteProcess.o |
| 65 | + |
| 66 | +$(OBJDIR_DEBUG)/IsProcessValid.o: IsProcessValid.cpp |
| 67 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR_DEBUG)/IsProcessValid.o |
| 68 | + |
| 69 | +$(OBJDIR_DEBUG)/Input.o: Input.cpp |
| 70 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR_DEBUG)/Input.o |
| 71 | + |
| 72 | +$(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp |
| 73 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o |
| 74 | + |
| 75 | +$(OBJDIR_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp |
| 76 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR_DEBUG)/EnumerateProcesses.o |
| 77 | + |
| 78 | +$(OBJDIR_DEBUG)/DisassembleCode.o: DisassembleCode.cpp |
| 79 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR_DEBUG)/DisassembleCode.o |
| 80 | + |
| 81 | +$(OBJDIR_DEBUG)/Debugger.o: Debugger.cpp |
| 82 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR_DEBUG)/Debugger.o |
| 83 | + |
| 84 | +$(OBJDIR_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp |
| 85 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR_DEBUG)/ControlRemoteProcess.o |
| 86 | + |
| 87 | +$(OBJDIR_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp |
| 88 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR_DEBUG)/CloseRemoteProcess.o |
| 89 | + |
| 90 | +$(OBJDIR_DEBUG)/BaeEngine.o: ../Dependencies/beaengine/src/BeaEngine.c |
| 91 | + $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/beaengine/src/BeaEngine.c -o $(OBJDIR_DEBUG)/BaeEngine.o |
| 92 | + |
| 93 | +clean_debug: |
| 94 | + rm -f $(OBJ_DEBUG) $(OUT_DEBUG) |
| 95 | + rm -rf build/debug |
| 96 | + rm -rf $(OBJDIR_DEBUG) |
| 97 | + |
| 98 | +before_release: |
| 99 | + test -d build/release || mkdir -p build/release |
| 100 | + test -d $(OBJDIR_RELEASE) || mkdir -p $(OBJDIR_RELEASE) |
| 101 | + |
| 102 | +after_release: |
| 103 | + |
| 104 | +release: before_release out_release after_release |
| 105 | + |
| 106 | +out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) |
| 107 | + $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) |
| 108 | + |
| 109 | +$(OBJDIR_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp |
| 110 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR_RELEASE)/WriteRemoteMemory.o |
| 111 | + |
| 112 | +$(OBJDIR_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp |
| 113 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR_RELEASE)/ReadRemoteMemory.o |
| 114 | + |
| 115 | +$(OBJDIR_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp |
| 116 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR_RELEASE)/OpenRemoteProcess.o |
| 117 | + |
| 118 | +$(OBJDIR_RELEASE)/IsProcessValid.o: IsProcessValid.cpp |
| 119 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR_RELEASE)/IsProcessValid.o |
| 120 | + |
| 121 | +$(OBJDIR_RELEASE)/Input.o: Input.cpp |
| 122 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR_RELEASE)/Input.o |
| 123 | + |
| 124 | +$(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp |
| 125 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o |
| 126 | + |
| 127 | +$(OBJDIR_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp |
| 128 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR_RELEASE)/EnumerateProcesses.o |
| 129 | + |
| 130 | +$(OBJDIR_RELEASE)/DisassembleCode.o: DisassembleCode.cpp |
| 131 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR_RELEASE)/DisassembleCode.o |
| 132 | + |
| 133 | +$(OBJDIR_RELEASE)/Debugger.o: Debugger.cpp |
| 134 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR_RELEASE)/Debugger.o |
| 135 | + |
| 136 | +$(OBJDIR_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp |
| 137 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR_RELEASE)/ControlRemoteProcess.o |
| 138 | + |
| 139 | +$(OBJDIR_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp |
| 140 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR_RELEASE)/CloseRemoteProcess.o |
| 141 | + |
| 142 | +$(OBJDIR_RELEASE)/BaeEngine.o: ../Dependencies/beaengine/src/BeaEngine.c |
| 143 | + $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/beaengine/src/BeaEngine.c -o $(OBJDIR_RELEASE)/BaeEngine.o |
| 144 | + |
| 145 | +clean_release: |
| 146 | + rm -f $(OBJ_RELEASE) $(OUT_RELEASE) |
| 147 | + rm -rf build/release |
| 148 | + rm -rf $(OBJDIR_RELEASE) |
| 149 | + |
| 150 | +.PHONY: before_debug after_debug clean_debug before_release after_release clean_release |
0 commit comments