1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-01-28 00:21:18 +00:00

Dependencies: Make unrar dependencies optional and disable hash-mode 23800 if dependency is disabled

This commit is contained in:
Jens Steube 2021-05-15 00:04:08 +02:00
parent a5bb988f92
commit ce90f83b65
2 changed files with 32 additions and 1 deletions

View File

@ -1,5 +1,11 @@
* changes v6.2.0 -> v6.x.x * changes v6.2.0 -> v6.x.x
##
## Technical
##
- Dependencies: Make unrar dependencies optional and disable hash-mode 23800 if dependency is disabled
* changes v6.1.1 -> v6.2.0 * changes v6.1.1 -> v6.2.0
## ##

View File

@ -9,6 +9,7 @@ PRODUCTION := 0
PRODUCTION_VERSION := v6.2.0 PRODUCTION_VERSION := v6.2.0
ENABLE_CUBIN ?= 1 ENABLE_CUBIN ?= 1
ENABLE_BRAIN ?= 1 ENABLE_BRAIN ?= 1
ENABLE_UNRAR ?= 1
USE_SYSTEM_LZMA ?= 0 USE_SYSTEM_LZMA ?= 0
USE_SYSTEM_ZLIB ?= 0 USE_SYSTEM_ZLIB ?= 0
USE_SYSTEM_OPENCL ?= 0 USE_SYSTEM_OPENCL ?= 0
@ -138,11 +139,13 @@ else
DEPS_XXHASH_PATH := $(LIBRARY_DEV_ROOT_FOLDER) DEPS_XXHASH_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
endif endif
ifeq ($(ENABLE_UNRAR),1)
ifeq ($(USE_SYSTEM_UNRAR),0) ifeq ($(USE_SYSTEM_UNRAR),0)
DEPS_UNRAR_PATH := deps/unrar DEPS_UNRAR_PATH := deps/unrar
else else
DEPS_UNRAR_PATH := $(LIBRARY_DEV_ROOT_FOLDER) DEPS_UNRAR_PATH := $(LIBRARY_DEV_ROOT_FOLDER)
endif endif
endif
## ##
## Filenames for library and frontend ## Filenames for library and frontend
@ -197,6 +200,7 @@ CFLAGS_ZLIB += -DIOAPI_NO_64
endif endif
## because UNRAR ## because UNRAR
ifeq ($(ENABLE_UNRAR),1)
ifeq ($(USE_SYSTEM_UNRAR),0) ifeq ($(USE_SYSTEM_UNRAR),0)
ifneq ($(UNAME),Darwin) ifneq ($(UNAME),Darwin)
CFLAGS_UNRAR += -Wno-misleading-indentation CFLAGS_UNRAR += -Wno-misleading-indentation
@ -215,6 +219,7 @@ CFLAGS_UNRAR += -Wno-implicit-fallthrough
CFLAGS_UNRAR += -Wno-extra CFLAGS_UNRAR += -Wno-extra
CFLAGS_UNRAR += -Wno-unknown-pragmas CFLAGS_UNRAR += -Wno-unknown-pragmas
endif endif
endif
ifeq ($(DEBUG),0) ifeq ($(DEBUG),0)
CFLAGS += -O2 CFLAGS += -O2
@ -272,8 +277,11 @@ CFLAGS += -DWITH_CUBIN
endif endif
# unrar # unrar
ifeq ($(ENABLE_UNRAR),1)
CFLAGS += -I$(DEPS_UNRAR_PATH) CFLAGS += -I$(DEPS_UNRAR_PATH)
CFLAGS += -DWITH_UNRAR
LFLAGS += -lstdc++ LFLAGS += -lstdc++
endif
## ##
## Native compilation target ## Native compilation target
@ -387,6 +395,7 @@ WIN_OBJS += $(foreach OBJ,$(OBJS_XXHASH),obj/$(OBJ).WIN.o)
endif endif
endif endif
ifeq ($(ENABLE_UNRAR),1)
ifeq ($(USE_SYSTEM_UNRAR),0) ifeq ($(USE_SYSTEM_UNRAR),0)
OBJS_UNRAR := strlist strfn pathfn smallfn global file filefn filcreat archive arcread unicode system isnt crypt crc rawread encname resource match timefn rdwrfn consio options errhnd rarvm secpassword rijndael getbits sha1 sha256 blake2s hash extinfo extract volume list find unpack headers threadpool rs16 cmddata ui filestr recvol rs scantree qopen hc_decompress_rar OBJS_UNRAR := strlist strfn pathfn smallfn global file filefn filcreat archive arcread unicode system isnt crypt crc rawread encname resource match timefn rdwrfn consio options errhnd rarvm secpassword rijndael getbits sha1 sha256 blake2s hash extinfo extract volume list find unpack headers threadpool rs16 cmddata ui filestr recvol rs scantree qopen hc_decompress_rar
@ -394,6 +403,7 @@ NATIVE_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).NATIVE.o)
LINUX_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).LINUX.o) LINUX_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).LINUX.o)
WIN_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).WIN.o) WIN_OBJS += $(foreach OBJ,$(OBJS_UNRAR),obj/$(OBJ).WIN.o)
endif endif
endif
## ##
## Targets: Native Compilation ## Targets: Native Compilation
@ -568,10 +578,12 @@ obj/%.NATIVE.o: $(DEPS_XXHASH_PATH)/%.c
endif endif
endif endif
ifeq ($(ENABLE_UNRAR),1)
ifeq ($(USE_SYSTEM_UNRAR),0) ifeq ($(USE_SYSTEM_UNRAR),0)
obj/%.NATIVE.o: $(DEPS_UNRAR_PATH)/%.cpp obj/%.NATIVE.o: $(DEPS_UNRAR_PATH)/%.cpp
$(CXX) -c $(CXXFLAGS) $(CFLAGS_NATIVE) $(CFLAGS_UNRAR) $< -o $@ -fpic $(CXX) -c $(CXXFLAGS) $(CFLAGS_NATIVE) $(CFLAGS_UNRAR) $< -o $@ -fpic
endif endif
endif
obj/combined.NATIVE.a: $(NATIVE_OBJS) obj/combined.NATIVE.a: $(NATIVE_OBJS)
$(AR) rcs $@ $^ $(AR) rcs $@ $^
@ -607,7 +619,16 @@ MODULE_SUFFIX := dll
endif endif
MODULES_SRC := $(wildcard src/modules/*.c) MODULES_SRC := $(wildcard src/modules/*.c)
MODULES_LIB := $(patsubst src/modules/module_%.c, modules/module_%.$(MODULE_SUFFIX), $(MODULES_SRC))
MODULES_DISABLE ?=
ifeq ($(ENABLE_UNRAR),0)
MODULES_SRC := $(filter-out src/modules/module_23800.c,$(MODULES_SRC))
MODULES_DISABLE += modules/module_23800.so
MODULES_DISABLE += modules/module_23800.dll
endif
$(MODULES_DISABLE): ;
ifeq ($(SHARED),1) ifeq ($(SHARED),1)
modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c $(HASHCAT_LIBRARY) modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c $(HASHCAT_LIBRARY)
@ -617,6 +638,8 @@ modules/module_%.$(MODULE_SUFFIX): src/modules/module_%.c obj/combined.NATIVE.a
$(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION) $(CC) $(CCFLAGS) $(CFLAGS_NATIVE) $^ -o $@ $(LFLAGS_NATIVE) -shared -fPIC -D MODULE_INTERFACE_VERSION_CURRENT=$(MODULE_INTERFACE_VERSION)
endif endif
MODULES_LIB := $(patsubst src/modules/module_%.c, modules/module_%.$(MODULE_SUFFIX), $(MODULES_SRC))
.PHONY: modules .PHONY: modules
modules: $(MODULES_LIB) modules: $(MODULES_LIB)
@ -737,6 +760,7 @@ obj/%.WIN.o: $(DEPS_XXHASH_PATH)/%.c
endif endif
endif endif
ifeq ($(ENABLE_UNRAR),1)
ifeq ($(USE_SYSTEM_UNRAR),0) ifeq ($(USE_SYSTEM_UNRAR),0)
obj/%.LINUX.o: $(DEPS_UNRAR_PATH)/%.cpp obj/%.LINUX.o: $(DEPS_UNRAR_PATH)/%.cpp
$(CXX_LINUX) $(CXXFLAGS) $(CFLAGS_CROSS_LINUX) $(CFLAGS_UNRAR) -c -o $@ $< $(CXX_LINUX) $(CXXFLAGS) $(CFLAGS_CROSS_LINUX) $(CFLAGS_UNRAR) -c -o $@ $<
@ -744,6 +768,7 @@ obj/%.LINUX.o: $(DEPS_UNRAR_PATH)/%.cpp
obj/%.WIN.o: $(DEPS_UNRAR_PATH)/%.cpp obj/%.WIN.o: $(DEPS_UNRAR_PATH)/%.cpp
$(CXX_WIN) $(CXXFLAGS) $(CFLAGS_CROSS_WIN) $(CFLAGS_UNRAR) -c -o $@ $< $(CXX_WIN) $(CXXFLAGS) $(CFLAGS_CROSS_WIN) $(CFLAGS_UNRAR) -c -o $@ $<
endif endif
endif
obj/combined.LINUX.a: $(LINUX_OBJS) obj/combined.LINUX.a: $(LINUX_OBJS)
$(AR_LINUX) rcs $@ $^ $(AR_LINUX) rcs $@ $^