diff --git a/Makefile b/Makefile index 10ab0620..750027d5 100644 --- a/Makefile +++ b/Makefile @@ -37,12 +37,12 @@ docker_all: docker_debug: cd ReClass.NET_Launcher && make docker_debug cd ReClass.NET && make docker_debug - docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make debug" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc_multilib:latest bash -c "cd NativeCore/Unix && make debug" docker_release: cd ReClass.NET_Launcher && make docker_release cd ReClass.NET && make docker_release - docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc:latest bash -c "cd NativeCore/Unix && make release" + docker container run --rm -v ${PWD}:/build:z -w /build -u $(shell id -u ${USER}):$(shell id -g ${USER}) gcc_multilib:latest bash -c "cd NativeCore/Unix && make release" podman_all: make podman_debug @@ -52,19 +52,21 @@ podman_all: podman_debug: cd ReClass.NET_Launcher && make podman_debug cd ReClass.NET && make podman_debug - podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make debug" + podman container run --rm -v ${PWD}:/build:z -w /build gcc_multilib:latest bash -c "cd NativeCore/Unix && make debug" podman_release: cd ReClass.NET_Launcher && make podman_release cd ReClass.NET && make podman_release - podman container run --rm -v ${PWD}:/build:z -w /build gcc:latest bash -c "cd NativeCore/Unix && make release" + podman container run --rm -v ${PWD}:/build:z -w /build gcc_multilib:latest bash -c "cd NativeCore/Unix && make release" dist: test -d build || mkdir -p build cp -r ReClass.NET/bin/* build/ cp -r ReClass.NET_Launcher/bin/* build/ - cp NativeCore/Unix/build/debug/NativeCore.so build/Debug/x64 - cp NativeCore/Unix/build/release/NativeCore.so build/Release/x64 + cp NativeCore/Unix/build/debug/x86/NativeCore.so build/Debug/x86 + cp NativeCore/Unix/build/debug/x64/NativeCore.so build/Debug/x64 + cp NativeCore/Unix/build/release/x86/NativeCore.so build/Release/x86 + cp NativeCore/Unix/build/release/x64/NativeCore.so build/Release/x64 test -d build/Debug/x86/Plugins || mkdir build/Debug/x86/Plugins test -d build/Debug/x64/Plugins || mkdir build/Debug/x64/Plugins test -d build/Release/x86/Plugins || mkdir build/Release/x86/Plugins diff --git a/NativeCore/Shared/DistormHelper.cpp b/NativeCore/Shared/DistormHelper.cpp index 9d8d9e85..092b1670 100644 --- a/NativeCore/Shared/DistormHelper.cpp +++ b/NativeCore/Shared/DistormHelper.cpp @@ -66,10 +66,10 @@ _CodeInfo CreateCodeInfo(const uint8_t* address, int length, const _OffsetType v info.codeLen = length; info.features = DF_NONE; -#ifdef RECLASSNET32 - info.dt = Decode32Bits; -#else +#ifdef RECLASSNET64 info.dt = Decode64Bits; +#else + info.dt = Decode32Bits; #endif return info; diff --git a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp index 079cba54..9d821cfe 100644 --- a/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp +++ b/NativeCore/Unix/EnumerateRemoteSectionsAndModules.cpp @@ -52,11 +52,12 @@ extern "C" void RC_CallConv EnumerateRemoteSectionsAndModules(RC_Pointer handle, auto path = std::stringstream(); path << "/proc/" << reinterpret_cast(handle) << "/maps"; + std::ifstream input(path.str()); std::unordered_map modules; std::string line; - while (std::getline(std::ifstream(path.str()), line)) + while (std::getline(input, line)) { std::stringstream ss(line); diff --git a/NativeCore/Unix/Makefile b/NativeCore/Unix/Makefile index 12c8b33b..f18ff1fb 100644 --- a/NativeCore/Unix/Makefile +++ b/NativeCore/Unix/Makefile @@ -7,192 +7,338 @@ LD = g++ WINDRES = windres INC = -I../Dependencies/distorm/include -CFLAGS = -Wall -fPIC -DRECLASSNET64=1 +CFLAGS32 = -Wall -fPIC -m32 +CFLAGS64 = -Wall -fPIC -m64 -DRECLASSNET64=1 RESINC = LIBDIR = LIB = -lstdc++fs -lstdc++ -LDFLAGS = -shared -Wl,--no-undefined +LDFLAGS32 = -m32 -shared -Wl,--no-undefined +LDFLAGS64 = -m64 -shared -Wl,--no-undefined INC_DEBUG = $(INC) -CFLAGS_DEBUG = $(CFLAGS) -g +CFLAGS32_DEBUG = $(CFLAGS32) -g +CFLAGS64_DEBUG = $(CFLAGS64) -g RESINC_DEBUG = $(RESINC) RCFLAGS_DEBUG = $(RCFLAGS) LIBDIR_DEBUG = $(LIBDIR) LIB_DEBUG = $(LIB) -LDFLAGS_DEBUG = $(LDFLAGS) -OBJDIR_DEBUG = obj/debug +LDFLAGS32_DEBUG = $(LDFLAGS32) +LDFLAGS64_DEBUG = $(LDFLAGS64) +OBJDIR32_DEBUG = obj/debug/x86 +OBJDIR64_DEBUG = obj/debug/x64 DEP_DEBUG = -OUT_DEBUG = build/debug/NativeCore.so +OUT32_DEBUG = build/debug/x86/NativeCore.so +OUT64_DEBUG = build/debug/x64/NativeCore.so INC_RELEASE = $(INC) -CFLAGS_RELEASE = $(CFLAGS) -O2 +CFLAGS32_RELEASE = $(CFLAGS32) -O2 +CFLAGS64_RELEASE = $(CFLAGS64) -O2 RESINC_RELEASE = $(RESINC) RCFLAGS_RELEASE = $(RCFLAGS) LIBDIR_RELEASE = $(LIBDIR) LIB_RELEASE = $(LIB) -LDFLAGS_RELEASE = $(LDFLAGS) -s -OBJDIR_RELEASE = obj/release +LDFLAGS32_RELEASE = $(LDFLAGS32) -s +LDFLAGS64_RELEASE = $(LDFLAGS64) -s +OBJDIR32_RELEASE = obj/release/x86 +OBJDIR64_RELEASE = obj/release/x64 DEP_RELEASE = -OUT_RELEASE = build/release/NativeCore.so +OUT32_RELEASE = build/release/x86/NativeCore.so +OUT64_RELEASE = build/release/x64/NativeCore.so -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)/DistormHelper.o $(OBJDIR_DEBUG)/Debugger.o $(OBJDIR_DEBUG)/ControlRemoteProcess.o $(OBJDIR_DEBUG)/CloseRemoteProcess.o $(OBJDIR_DEBUG)/decoder.o $(OBJDIR_DEBUG)/distorm.o $(OBJDIR_DEBUG)/instructions.o $(OBJDIR_DEBUG)/insts.o $(OBJDIR_DEBUG)/mnemonics.o $(OBJDIR_DEBUG)/operands.o $(OBJDIR_DEBUG)/prefix.o $(OBJDIR_DEBUG)/textdefs.o +OBJ32_DEBUG = $(OBJDIR32_DEBUG)/WriteRemoteMemory.o $(OBJDIR32_DEBUG)/ReadRemoteMemory.o $(OBJDIR32_DEBUG)/OpenRemoteProcess.o $(OBJDIR32_DEBUG)/IsProcessValid.o $(OBJDIR32_DEBUG)/Input.o $(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR32_DEBUG)/EnumerateProcesses.o $(OBJDIR32_DEBUG)/DisassembleCode.o $(OBJDIR32_DEBUG)/DistormHelper.o $(OBJDIR32_DEBUG)/Debugger.o $(OBJDIR32_DEBUG)/ControlRemoteProcess.o $(OBJDIR32_DEBUG)/CloseRemoteProcess.o $(OBJDIR32_DEBUG)/decoder.o $(OBJDIR32_DEBUG)/distorm.o $(OBJDIR32_DEBUG)/instructions.o $(OBJDIR32_DEBUG)/insts.o $(OBJDIR32_DEBUG)/mnemonics.o $(OBJDIR32_DEBUG)/operands.o $(OBJDIR32_DEBUG)/prefix.o $(OBJDIR32_DEBUG)/textdefs.o +OBJ64_DEBUG = $(OBJDIR64_DEBUG)/WriteRemoteMemory.o $(OBJDIR64_DEBUG)/ReadRemoteMemory.o $(OBJDIR64_DEBUG)/OpenRemoteProcess.o $(OBJDIR64_DEBUG)/IsProcessValid.o $(OBJDIR64_DEBUG)/Input.o $(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o $(OBJDIR64_DEBUG)/EnumerateProcesses.o $(OBJDIR64_DEBUG)/DisassembleCode.o $(OBJDIR64_DEBUG)/DistormHelper.o $(OBJDIR64_DEBUG)/Debugger.o $(OBJDIR64_DEBUG)/ControlRemoteProcess.o $(OBJDIR64_DEBUG)/CloseRemoteProcess.o $(OBJDIR64_DEBUG)/decoder.o $(OBJDIR64_DEBUG)/distorm.o $(OBJDIR64_DEBUG)/instructions.o $(OBJDIR64_DEBUG)/insts.o $(OBJDIR64_DEBUG)/mnemonics.o $(OBJDIR64_DEBUG)/operands.o $(OBJDIR64_DEBUG)/prefix.o $(OBJDIR64_DEBUG)/textdefs.o -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)/DistormHelper.o $(OBJDIR_RELEASE)/Debugger.o $(OBJDIR_RELEASE)/ControlRemoteProcess.o $(OBJDIR_RELEASE)/CloseRemoteProcess.o $(OBJDIR_RELEASE)/decoder.o $(OBJDIR_RELEASE)/distorm.o $(OBJDIR_RELEASE)/instructions.o $(OBJDIR_RELEASE)/insts.o $(OBJDIR_RELEASE)/mnemonics.o $(OBJDIR_RELEASE)/operands.o $(OBJDIR_RELEASE)/prefix.o $(OBJDIR_RELEASE)/textdefs.o +OBJ32_RELEASE = $(OBJDIR32_RELEASE)/WriteRemoteMemory.o $(OBJDIR32_RELEASE)/ReadRemoteMemory.o $(OBJDIR32_RELEASE)/OpenRemoteProcess.o $(OBJDIR32_RELEASE)/IsProcessValid.o $(OBJDIR32_RELEASE)/Input.o $(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR32_RELEASE)/EnumerateProcesses.o $(OBJDIR32_RELEASE)/DisassembleCode.o $(OBJDIR32_RELEASE)/DistormHelper.o $(OBJDIR32_RELEASE)/Debugger.o $(OBJDIR32_RELEASE)/ControlRemoteProcess.o $(OBJDIR32_RELEASE)/CloseRemoteProcess.o $(OBJDIR32_RELEASE)/decoder.o $(OBJDIR32_RELEASE)/distorm.o $(OBJDIR32_RELEASE)/instructions.o $(OBJDIR32_RELEASE)/insts.o $(OBJDIR32_RELEASE)/mnemonics.o $(OBJDIR32_RELEASE)/operands.o $(OBJDIR32_RELEASE)/prefix.o $(OBJDIR32_RELEASE)/textdefs.o +OBJ64_RELEASE = $(OBJDIR64_RELEASE)/WriteRemoteMemory.o $(OBJDIR64_RELEASE)/ReadRemoteMemory.o $(OBJDIR64_RELEASE)/OpenRemoteProcess.o $(OBJDIR64_RELEASE)/IsProcessValid.o $(OBJDIR64_RELEASE)/Input.o $(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o $(OBJDIR64_RELEASE)/EnumerateProcesses.o $(OBJDIR64_RELEASE)/DisassembleCode.o $(OBJDIR64_RELEASE)/DistormHelper.o $(OBJDIR64_RELEASE)/Debugger.o $(OBJDIR64_RELEASE)/ControlRemoteProcess.o $(OBJDIR64_RELEASE)/CloseRemoteProcess.o $(OBJDIR64_RELEASE)/decoder.o $(OBJDIR64_RELEASE)/distorm.o $(OBJDIR64_RELEASE)/instructions.o $(OBJDIR64_RELEASE)/insts.o $(OBJDIR64_RELEASE)/mnemonics.o $(OBJDIR64_RELEASE)/operands.o $(OBJDIR64_RELEASE)/prefix.o $(OBJDIR64_RELEASE)/textdefs.o all: debug release clean: clean_debug clean_release before_debug: - test -d build/debug || mkdir -p build/debug - test -d $(OBJDIR_DEBUG) || mkdir -p $(OBJDIR_DEBUG) + test -d build/debug/x86 || mkdir -p build/debug/x86 + test -d build/debug/x64 || mkdir -p build/debug/x64 + test -d $(OBJDIR32_DEBUG) || mkdir -p $(OBJDIR32_DEBUG) + test -d $(OBJDIR64_DEBUG) || mkdir -p $(OBJDIR64_DEBUG) after_debug: -debug: before_debug out_debug after_debug +debug: before_debug out_debug32 out_debug64 after_debug -out_debug: before_debug $(OBJ_DEBUG) $(DEP_DEBUG) - $(CXX) $(LIBDIR_DEBUG) -o $(OUT_DEBUG) $(OBJ_DEBUG) $(LDFLAGS_DEBUG) $(LIB_DEBUG) +out_debug32: before_debug $(OBJ32_DEBUG) $(DEP_DEBUG) + $(CXX) $(LIBDIR_DEBUG) -o $(OUT32_DEBUG) $(OBJ32_DEBUG) $(LDFLAGS32_DEBUG) $(LIB_DEBUG) -$(OBJDIR_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR_DEBUG)/WriteRemoteMemory.o +$(OBJDIR32_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR32_DEBUG)/WriteRemoteMemory.o -$(OBJDIR_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR_DEBUG)/ReadRemoteMemory.o +$(OBJDIR32_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR32_DEBUG)/ReadRemoteMemory.o -$(OBJDIR_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR_DEBUG)/OpenRemoteProcess.o +$(OBJDIR32_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/OpenRemoteProcess.o -$(OBJDIR_DEBUG)/IsProcessValid.o: IsProcessValid.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR_DEBUG)/IsProcessValid.o +$(OBJDIR32_DEBUG)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR32_DEBUG)/IsProcessValid.o -$(OBJDIR_DEBUG)/Input.o: Input.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR_DEBUG)/Input.o +$(OBJDIR32_DEBUG)/Input.o: Input.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR32_DEBUG)/Input.o -$(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_DEBUG)/EnumerateRemoteSectionsAndModules.o +$(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR32_DEBUG)/EnumerateRemoteSectionsAndModules.o -$(OBJDIR_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR_DEBUG)/EnumerateProcesses.o +$(OBJDIR32_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR32_DEBUG)/EnumerateProcesses.o -$(OBJDIR_DEBUG)/DisassembleCode.o: DisassembleCode.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR_DEBUG)/DisassembleCode.o +$(OBJDIR32_DEBUG)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR32_DEBUG)/DisassembleCode.o -$(OBJDIR_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR_DEBUG)/DistormHelper.o +$(OBJDIR32_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR32_DEBUG)/DistormHelper.o -$(OBJDIR_DEBUG)/Debugger.o: Debugger.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR_DEBUG)/Debugger.o +$(OBJDIR32_DEBUG)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR32_DEBUG)/Debugger.o -$(OBJDIR_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR_DEBUG)/ControlRemoteProcess.o +$(OBJDIR32_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/ControlRemoteProcess.o -$(OBJDIR_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR_DEBUG)/CloseRemoteProcess.o +$(OBJDIR32_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR32_DEBUG)/CloseRemoteProcess.o -$(OBJDIR_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR_DEBUG)/decoder.o +$(OBJDIR32_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR32_DEBUG)/decoder.o -$(OBJDIR_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR_DEBUG)/distorm.o +$(OBJDIR32_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR32_DEBUG)/distorm.o -$(OBJDIR_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR_DEBUG)/instructions.o +$(OBJDIR32_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR32_DEBUG)/instructions.o -$(OBJDIR_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR_DEBUG)/insts.o +$(OBJDIR32_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR32_DEBUG)/insts.o -$(OBJDIR_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR_DEBUG)/mnemonics.o +$(OBJDIR32_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR32_DEBUG)/mnemonics.o -$(OBJDIR_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR_DEBUG)/operands.o +$(OBJDIR32_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR32_DEBUG)/operands.o -$(OBJDIR_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR_DEBUG)/prefix.o +$(OBJDIR32_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR32_DEBUG)/prefix.o -$(OBJDIR_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c - $(CXX) $(CFLAGS_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_DEBUG)/textdefs.o +$(OBJDIR32_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS32_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR32_DEBUG)/textdefs.o + +out_debug64: before_debug $(OBJ64_DEBUG) $(DEP_DEBUG) + $(CXX) $(LIBDIR_DEBUG) -o $(OUT64_DEBUG) $(OBJ64_DEBUG) $(LDFLAGS64_DEBUG) $(LIB_DEBUG) + +$(OBJDIR64_DEBUG)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c WriteRemoteMemory.cpp -o $(OBJDIR64_DEBUG)/WriteRemoteMemory.o + +$(OBJDIR64_DEBUG)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ReadRemoteMemory.cpp -o $(OBJDIR64_DEBUG)/ReadRemoteMemory.o + +$(OBJDIR64_DEBUG)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c OpenRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/OpenRemoteProcess.o + +$(OBJDIR64_DEBUG)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c IsProcessValid.cpp -o $(OBJDIR64_DEBUG)/IsProcessValid.o + +$(OBJDIR64_DEBUG)/Input.o: Input.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c Input.cpp -o $(OBJDIR64_DEBUG)/Input.o + +$(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR64_DEBUG)/EnumerateRemoteSectionsAndModules.o + +$(OBJDIR64_DEBUG)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c EnumerateProcesses.cpp -o $(OBJDIR64_DEBUG)/EnumerateProcesses.o + +$(OBJDIR64_DEBUG)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c DisassembleCode.cpp -o $(OBJDIR64_DEBUG)/DisassembleCode.o + +$(OBJDIR64_DEBUG)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Shared/DistormHelper.cpp -o $(OBJDIR64_DEBUG)/DistormHelper.o + +$(OBJDIR64_DEBUG)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c Debugger.cpp -o $(OBJDIR64_DEBUG)/Debugger.o + +$(OBJDIR64_DEBUG)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ControlRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/ControlRemoteProcess.o + +$(OBJDIR64_DEBUG)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c CloseRemoteProcess.cpp -o $(OBJDIR64_DEBUG)/CloseRemoteProcess.o + +$(OBJDIR64_DEBUG)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR64_DEBUG)/decoder.o + +$(OBJDIR64_DEBUG)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR64_DEBUG)/distorm.o + +$(OBJDIR64_DEBUG)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR64_DEBUG)/instructions.o + +$(OBJDIR64_DEBUG)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR64_DEBUG)/insts.o + +$(OBJDIR64_DEBUG)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR64_DEBUG)/mnemonics.o + +$(OBJDIR64_DEBUG)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR64_DEBUG)/operands.o + +$(OBJDIR64_DEBUG)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR64_DEBUG)/prefix.o + +$(OBJDIR64_DEBUG)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS64_DEBUG) $(INC_DEBUG) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR64_DEBUG)/textdefs.o clean_debug: - rm -f $(OBJ_DEBUG) $(OUT_DEBUG) + rm -f $(OBJ32_DEBUG) $(OUT32_DEBUG) + rm -f $(OBJ64_DEBUG) $(OUT64_DEBUG) rm -rf build/debug - rm -rf $(OBJDIR_DEBUG) + rm -rf $(OBJDIR32_DEBUG) + rm -rf $(OBJDIR64_DEBUG) before_release: - test -d build/release || mkdir -p build/release - test -d $(OBJDIR_RELEASE) || mkdir -p $(OBJDIR_RELEASE) + test -d build/release/x86 || mkdir -p build/release/x86 + test -d build/release/x64 || mkdir -p build/release/x64 + test -d $(OBJDIR32_RELEASE) || mkdir -p $(OBJDIR32_RELEASE) + test -d $(OBJDIR64_RELEASE) || mkdir -p $(OBJDIR64_RELEASE) after_release: -release: before_release out_release after_release +release: before_release out_release32 out_release64 after_release + +out_release32: before_release $(OBJ32_RELEASE) $(DEP_RELEASE) + $(CXX) $(LIBDIR_RELEASE) -o $(OUT32_RELEASE) $(OBJ32_RELEASE) $(LDFLAGS32_RELEASE) $(LIB_RELEASE) + +$(OBJDIR32_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR32_RELEASE)/WriteRemoteMemory.o + +$(OBJDIR32_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR32_RELEASE)/ReadRemoteMemory.o + +$(OBJDIR32_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/OpenRemoteProcess.o + +$(OBJDIR32_RELEASE)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR32_RELEASE)/IsProcessValid.o + +$(OBJDIR32_RELEASE)/Input.o: Input.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR32_RELEASE)/Input.o + +$(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR32_RELEASE)/EnumerateRemoteSectionsAndModules.o + +$(OBJDIR32_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR32_RELEASE)/EnumerateProcesses.o + +$(OBJDIR32_RELEASE)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR32_RELEASE)/DisassembleCode.o + +$(OBJDIR32_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR32_RELEASE)/DistormHelper.o + +$(OBJDIR32_RELEASE)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR32_RELEASE)/Debugger.o + +$(OBJDIR32_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/ControlRemoteProcess.o + +$(OBJDIR32_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR32_RELEASE)/CloseRemoteProcess.o + +$(OBJDIR32_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR32_RELEASE)/decoder.o + +$(OBJDIR32_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR32_RELEASE)/distorm.o + +$(OBJDIR32_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR32_RELEASE)/instructions.o + +$(OBJDIR32_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR32_RELEASE)/insts.o + +$(OBJDIR32_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR32_RELEASE)/mnemonics.o + +$(OBJDIR32_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR32_RELEASE)/operands.o + +$(OBJDIR32_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR32_RELEASE)/prefix.o + +$(OBJDIR32_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS32_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR32_RELEASE)/textdefs.o -out_release: before_release $(OBJ_RELEASE) $(DEP_RELEASE) - $(LD) $(LIBDIR_RELEASE) -o $(OUT_RELEASE) $(OBJ_RELEASE) $(LDFLAGS_RELEASE) $(LIB_RELEASE) +out_release64: before_release $(OBJ64_RELEASE) $(DEP_RELEASE) + $(CXX) $(LIBDIR_RELEASE) -o $(OUT64_RELEASE) $(OBJ64_RELEASE) $(LDFLAGS64_RELEASE) $(LIB_RELEASE) -$(OBJDIR_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR_RELEASE)/WriteRemoteMemory.o +$(OBJDIR64_RELEASE)/WriteRemoteMemory.o: WriteRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c WriteRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/WriteRemoteMemory.o -$(OBJDIR_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR_RELEASE)/ReadRemoteMemory.o +$(OBJDIR64_RELEASE)/ReadRemoteMemory.o: ReadRemoteMemory.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ReadRemoteMemory.cpp -o $(OBJDIR64_RELEASE)/ReadRemoteMemory.o -$(OBJDIR_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR_RELEASE)/OpenRemoteProcess.o +$(OBJDIR64_RELEASE)/OpenRemoteProcess.o: OpenRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c OpenRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/OpenRemoteProcess.o -$(OBJDIR_RELEASE)/IsProcessValid.o: IsProcessValid.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR_RELEASE)/IsProcessValid.o +$(OBJDIR64_RELEASE)/IsProcessValid.o: IsProcessValid.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c IsProcessValid.cpp -o $(OBJDIR64_RELEASE)/IsProcessValid.o -$(OBJDIR_RELEASE)/Input.o: Input.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR_RELEASE)/Input.o +$(OBJDIR64_RELEASE)/Input.o: Input.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Input.cpp -o $(OBJDIR64_RELEASE)/Input.o -$(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR_RELEASE)/EnumerateRemoteSectionsAndModules.o +$(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o: EnumerateRemoteSectionsAndModules.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateRemoteSectionsAndModules.cpp -o $(OBJDIR64_RELEASE)/EnumerateRemoteSectionsAndModules.o -$(OBJDIR_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR_RELEASE)/EnumerateProcesses.o +$(OBJDIR64_RELEASE)/EnumerateProcesses.o: EnumerateProcesses.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c EnumerateProcesses.cpp -o $(OBJDIR64_RELEASE)/EnumerateProcesses.o -$(OBJDIR_RELEASE)/DisassembleCode.o: DisassembleCode.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR_RELEASE)/DisassembleCode.o +$(OBJDIR64_RELEASE)/DisassembleCode.o: DisassembleCode.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c DisassembleCode.cpp -o $(OBJDIR64_RELEASE)/DisassembleCode.o -$(OBJDIR_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR_RELEASE)/DistormHelper.o +$(OBJDIR64_RELEASE)/DistormHelper.o: ../Shared/DistormHelper.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Shared/DistormHelper.cpp -o $(OBJDIR64_RELEASE)/DistormHelper.o -$(OBJDIR_RELEASE)/Debugger.o: Debugger.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR_RELEASE)/Debugger.o +$(OBJDIR64_RELEASE)/Debugger.o: Debugger.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c Debugger.cpp -o $(OBJDIR64_RELEASE)/Debugger.o -$(OBJDIR_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR_RELEASE)/ControlRemoteProcess.o +$(OBJDIR64_RELEASE)/ControlRemoteProcess.o: ControlRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ControlRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/ControlRemoteProcess.o -$(OBJDIR_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR_RELEASE)/CloseRemoteProcess.o +$(OBJDIR64_RELEASE)/CloseRemoteProcess.o: CloseRemoteProcess.cpp + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c CloseRemoteProcess.cpp -o $(OBJDIR64_RELEASE)/CloseRemoteProcess.o -$(OBJDIR_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR_RELEASE)/decoder.o +$(OBJDIR64_RELEASE)/decoder.o: ../Dependencies/distorm/src/decoder.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/decoder.c -o $(OBJDIR64_RELEASE)/decoder.o -$(OBJDIR_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR_RELEASE)/distorm.o +$(OBJDIR64_RELEASE)/distorm.o: ../Dependencies/distorm/src/distorm.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/distorm.c -o $(OBJDIR64_RELEASE)/distorm.o -$(OBJDIR_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR_RELEASE)/instructions.o +$(OBJDIR64_RELEASE)/instructions.o: ../Dependencies/distorm/src/instructions.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/instructions.c -o $(OBJDIR64_RELEASE)/instructions.o -$(OBJDIR_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR_RELEASE)/insts.o +$(OBJDIR64_RELEASE)/insts.o: ../Dependencies/distorm/src/insts.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/insts.c -o $(OBJDIR64_RELEASE)/insts.o -$(OBJDIR_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR_RELEASE)/mnemonics.o +$(OBJDIR64_RELEASE)/mnemonics.o: ../Dependencies/distorm/src/mnemonics.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/mnemonics.c -o $(OBJDIR64_RELEASE)/mnemonics.o -$(OBJDIR_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR_RELEASE)/operands.o +$(OBJDIR64_RELEASE)/operands.o: ../Dependencies/distorm/src/operands.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/operands.c -o $(OBJDIR64_RELEASE)/operands.o -$(OBJDIR_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR_RELEASE)/prefix.o +$(OBJDIR64_RELEASE)/prefix.o: ../Dependencies/distorm/src/prefix.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/prefix.c -o $(OBJDIR64_RELEASE)/prefix.o -$(OBJDIR_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c - $(CXX) $(CFLAGS_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR_RELEASE)/textdefs.o +$(OBJDIR64_RELEASE)/textdefs.o: ../Dependencies/distorm/src/textdefs.c + $(CXX) $(CFLAGS64_RELEASE) $(INC_RELEASE) -c ../Dependencies/distorm/src/textdefs.c -o $(OBJDIR64_RELEASE)/textdefs.o clean_release: - rm -f $(OBJ_RELEASE) $(OUT_RELEASE) + rm -f $(OBJ32_RELEASE) $(OUT32_RELEASE) + rm -f $(OBJ64_RELEASE) $(OUT64_RELEASE) rm -rf build/release - rm -rf $(OBJDIR_RELEASE) + rm -rf $(OBJDIR32_RELEASE) + rm -rf $(OBJDIR64_RELEASE) .PHONY: before_debug after_debug clean_debug before_release after_release clean_release diff --git a/NativeCore/Unix/NativeCore.Unix.vcxproj b/NativeCore/Unix/NativeCore.Unix.vcxproj index 9ce274fd..83bff48a 100644 --- a/NativeCore/Unix/NativeCore.Unix.vcxproj +++ b/NativeCore/Unix/NativeCore.Unix.vcxproj @@ -155,7 +155,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32 -m32 %(AdditionalOptions) @@ -168,7 +167,6 @@ c++1y ../Dependencies/distorm/include;$(Sysroot)\usr\include;$(StlIncludeDirectories);%(AdditionalIncludeDirectories) -m32 %(AdditionalOptions) - RECLASSNET32;%(PreprocessorDefinitions) None true false diff --git a/NativeCore/Windows/NativeCore.vcxproj b/NativeCore/Windows/NativeCore.vcxproj index 5715bcb4..5600a51a 100644 --- a/NativeCore/Windows/NativeCore.vcxproj +++ b/NativeCore/Windows/NativeCore.vcxproj @@ -103,7 +103,7 @@ Level3 Disabled - WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + WIN32;_DEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 @@ -137,7 +137,7 @@ MaxSpeed true true - WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;RECLASSNET32;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USRDLL;NATIVECORE_EXPORTS;_CRT_SECURE_NO_WARNINGS;NOMINMAX;_SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING;%(PreprocessorDefinitions) stdcpp17 diff --git a/README.md b/README.md index 6f424ced..82a8a53d 100644 --- a/README.md +++ b/README.md @@ -77,7 +77,20 @@ Just download the [latest version](https://github.com/ReClassNET/ReClass.NET/rel If you want to compile ReClass.NET just fork the repository and open the ReClass.NET.sln file with Visual Studio 2019. Compile the project and copy the dependencies to the output folder. -To compile the linux native core library, you need WSL [installed and configured](https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2). If you do not need linux support, simply unload the project in the Solution Explorer. +To compile the linux native core library, you need WSL [installed and configured](https://learn.microsoft.com/en-us/cpp/build/walkthrough-build-debug-wsl2). If you do not need linux support, simply unload the project in the Solution Explorer. If you want to build cross-platform (x86/x64) you have to install `g++-multilib` too. + +If you use the `Makefile` with `docker` or `podman` you have to build the needed image `gcc_multilib` from the following `Dockerfile` (`docker build -t gcc_multi .`): + +``` +FROM ubuntu:latest + +RUN apt-get update \ + && apt-get install --assume-yes --no-install-recommends --quiet \ + make \ + g++ \ + g++-multilib \ + && apt-get clean all +``` ## Videos diff --git a/ReClass.NET/Forms/MainForm.cs b/ReClass.NET/Forms/MainForm.cs index 010eea25..e771a10d 100644 --- a/ReClass.NET/Forms/MainForm.cs +++ b/ReClass.NET/Forms/MainForm.cs @@ -473,6 +473,7 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs var parentNode = node?.GetParentContainer(); var nodeIsClass = node is ClassNode; + var nodeIsContainer = node is BaseContainerNode; var nodeIsSearchableValueNode = node switch { BaseHexNode _ => true, @@ -494,8 +495,8 @@ private void selectedNodeContextMenuStrip_Opening(object sender, CancelEventArgs _ => false }; - addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsClass; - insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsClass; + addBytesToolStripMenuItem.Enabled = parentNode != null || nodeIsContainer; + insertBytesToolStripMenuItem.Enabled = count == 1 && parentNode != null && !nodeIsContainer; changeTypeToolStripMenuItem.Enabled = count > 0 && !nodeIsClass; @@ -830,9 +831,10 @@ private void memoryViewControl_SelectionChanged(object sender, EventArgs e) var node = selectedNodes.FirstOrDefault()?.Node; var parentContainer = node?.GetParentContainer(); var nodeIsClass = node is ClassNode; + var isContainerNode = node is BaseContainerNode; - addBytesToolStripDropDownButton.Enabled = parentContainer != null || nodeIsClass; - insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !nodeIsClass; + addBytesToolStripDropDownButton.Enabled = parentContainer != null || isContainerNode; + insertBytesToolStripDropDownButton.Enabled = selectedNodes.Count == 1 && parentContainer != null && !isContainerNode; var enabled = selectedNodes.Count > 0 && !nodeIsClass; toolStrip.Items.OfType().ForEach(b => b.Enabled = enabled); diff --git a/ReClass.NET/Memory/UnionDataType.cs b/ReClass.NET/Memory/UnionDataType.cs index 36a47a7e..0cea977a 100644 --- a/ReClass.NET/Memory/UnionDataType.cs +++ b/ReClass.NET/Memory/UnionDataType.cs @@ -56,20 +56,20 @@ public struct UInt64FloatDoubleData public long LongValue; public IntPtr IntPtr => -#if RECLASSNET32 - unchecked((IntPtr)(int)LongValue); -#else +#if RECLASSNET64 (IntPtr)LongValue; +#else + unchecked((IntPtr)(int)LongValue); #endif [FieldOffset(0)] public ulong ULongValue; public UIntPtr UIntPtr => -#if RECLASSNET32 - unchecked((UIntPtr)(uint)ULongValue); -#else +#if RECLASSNET64 (UIntPtr)ULongValue; +#else + unchecked((UIntPtr)(uint)ULongValue); #endif [FieldOffset(0)] diff --git a/ReClass.NET/Util/Rtf/RtfBuilder.cs b/ReClass.NET/Util/Rtf/RtfBuilder.cs index 76bd7b95..5f83c837 100644 --- a/ReClass.NET/Util/Rtf/RtfBuilder.cs +++ b/ReClass.NET/Util/Rtf/RtfBuilder.cs @@ -258,7 +258,7 @@ private static string EscapeString(string value) { if (c == '\t') { - sb.Append(@"\tab"); + sb.Append(@"\tab "); } else if (c <= 255) {