From ce0e19f18536474b9078e87dc6ffa34e19f7b2b1 Mon Sep 17 00:00:00 2001 From: jsteube Date: Wed, 19 Dec 2018 16:18:40 +0100 Subject: [PATCH] Compile module as .dll example --- .gitignore | 1 + src/Makefile | 12 ++++++++++++ src/shared.c | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/.gitignore b/.gitignore index e590ba47f..cf5366dd1 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ hashcat.dll *.dSYM kernels/** lib/*.a +modules/*.dll modules/*.so obj/*.o include/CL diff --git a/src/Makefile b/src/Makefile index d99261f28..82b366ea3 100644 --- a/src/Makefile +++ b/src/Makefile @@ -549,6 +549,18 @@ modules/module_%.so: modules/module_%.c modules: $(MODULES_LIB) + + +MODULES_LIB_WIN64 := $(patsubst %.c, %.dll, $(MODULES_SRC)) + +modules/module_%.dll: modules/module_%.c + $(CC_WIN_64) $(CFLAGS_CROSS_WIN64) $< -o $@ -shared -fPIC $(MODULE_DEPEND) + +modules_win64: $(MODULES_LIB_WIN64) + + + + ## ## cross compiled hashcat ## diff --git a/src/shared.c b/src/shared.c index 4a89e12db..3d40b2ddd 100644 --- a/src/shared.c +++ b/src/shared.c @@ -757,6 +757,10 @@ float get_entropy (const u8 *buf, const int len) return entropy; } +#if defined (_WIN) + +#else + int select_read_timeout (int sockfd, const int sec) { struct timeval tv; @@ -787,6 +791,8 @@ int select_write_timeout (int sockfd, const int sec) return select (sockfd + 1, NULL, &fds, NULL, &tv); } +#endif + #if defined (_WIN) int select_read_timeout_console (const int sec)