From a381539545ebc5ed0d42a68b26184af3d79314b1 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Mon, 20 Nov 2023 18:25:11 -0800 Subject: [PATCH 1/5] replace index with strchr The former is deprecated and unavailable if POSIX_C_SOUCE==200811L. Signed-off-by: Rosen Penev --- src/backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/backend.c b/src/backend.c index f7c916e1d..c2e3e0a21 100644 --- a/src/backend.c +++ b/src/backend.c @@ -7472,11 +7472,11 @@ int backend_ctx_devices_init (hashcat_ctx_t *hashcat_ctx, const int comptime) #if defined (__APPLE__) - char *start130 = index (device_param->opencl_driver_version, '('); - char *stop130 = index (device_param->opencl_driver_version, ')'); + char *start130 = strchr (device_param->opencl_driver_version, '('); + char *stop130 = strchr (device_param->opencl_driver_version, ')'); - char *start131 = index (opencl_platform_version, '('); - char *stop131 = index (opencl_platform_version, ')'); + char *start131 = strchr (opencl_platform_version, '('); + char *stop131 = strchr (opencl_platform_version, ')'); // either none or one of these have a date string From 8d1fc952f7d0658e68eec816588587f5a50c81fd Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 8 Dec 2023 16:47:24 -0800 Subject: [PATCH 2/5] Fix compilation on newer FreeBSD Apparently qsort_r is a macro now. Check for it. Signed-off-by: Rosen Penev --- include/sort_r.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/sort_r.h b/include/sort_r.h index 79bd8ab65..f9fb31360 100644 --- a/include/sort_r.h +++ b/include/sort_r.h @@ -138,7 +138,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, size_t nel, size_t w, /* Declare structs and functions */ - #if defined _SORT_R_BSD + #if defined _SORT_R_BSD && !defined(qsort_r) /* Ensure qsort_r is defined */ extern void qsort_r(void *base, size_t nel, size_t width, void *thunk, From 2f1a983bc6fd2278fb0bb82cd571d0f1e427319f Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Fri, 8 Dec 2023 17:16:07 -0800 Subject: [PATCH 3/5] Fix MinGW printf formats Based on various compilation flags, MinGW uses either gnu_printf or printf (really ms_printf) internally which confuses the compiler when encountering gnu formats. OTOH, clang under MinGW does not support gnu_printf. Just use the macro to handle this mess. Also remove macro that was originally used to work around this. It's wrong and should not be used. Signed-off-by: Rosen Penev --- include/event.h | 22 +++++++++++++--------- include/logfile.h | 6 +++++- include/shared.h | 7 ++++++- src/Makefile | 1 - src/event.c | 6 +++++- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/include/event.h b/include/event.h index fca7eec55..4f9cfa0a7 100644 --- a/include/event.h +++ b/include/event.h @@ -14,15 +14,19 @@ void event_call (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, cons #define EVENT(id) event_call ((id), hashcat_ctx, NULL, 0) #define EVENT_DATA(id,buf,len) event_call ((id), hashcat_ctx, (buf), (len)) -__attribute__ ((format (printf, 2, 3))) size_t event_log_advice_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_info_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_warning_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_error_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); - -__attribute__ ((format (printf, 2, 3))) size_t event_log_advice (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_info (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_warning (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); -__attribute__ ((format (printf, 2, 3))) size_t event_log_error (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +#ifndef __MINGW_PRINTF_FORMAT +#define __MINGW_PRINTF_FORMAT printf +#endif + +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_advice_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_info_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_warning_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_error_nn (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); + +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_advice (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_info (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_warning (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) size_t event_log_error (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...); int event_ctx_init (hashcat_ctx_t *hashcat_ctx); void event_ctx_destroy (hashcat_ctx_t *hashcat_ctx); diff --git a/include/logfile.h b/include/logfile.h index b3f3fb8d1..f154f6bb5 100644 --- a/include/logfile.h +++ b/include/logfile.h @@ -34,9 +34,13 @@ #define logfile_top_string(var) logfile_top_var_string (#var, (var)) #define logfile_sub_string(var) logfile_sub_var_string (#var, (var)) +#ifndef __MINGW_PRINTF_FORMAT +#define __MINGW_PRINTF_FORMAT printf +#endif + void logfile_generate_topid (hashcat_ctx_t *hashcat_ctx); void logfile_generate_subid (hashcat_ctx_t *hashcat_ctx); -void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...) __attribute__ ((format (printf, 2, 3))); +void logfile_append (hashcat_ctx_t *hashcat_ctx, const char *fmt, ...) __attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))); int logfile_init (hashcat_ctx_t *hashcat_ctx); void logfile_destroy (hashcat_ctx_t *hashcat_ctx); diff --git a/include/shared.h b/include/shared.h index f1660c58e..9bd47f18a 100644 --- a/include/shared.h +++ b/include/shared.h @@ -7,6 +7,7 @@ #define HC_SHARED_H #include +#include #include #include #include @@ -24,6 +25,10 @@ #include #endif +#ifndef __MINGW_PRINTF_FORMAT +#define __MINGW_PRINTF_FORMAT printf +#endif + int sort_by_string_sized (const void *p1, const void *p2); int sort_by_stringptr (const void *p1, const void *p2); @@ -44,7 +49,7 @@ char *filename_from_filepath (char *filepath); void naive_replace (char *s, const char key_char, const char replace_char); void naive_escape (char *s, size_t s_max, const char key_char, const char escape_char); -__attribute__ ((format (printf, 2, 3))) int hc_asprintf (char **strp, const char *fmt, ...); +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 2, 3))) int hc_asprintf (char **strp, const char *fmt, ...); void setup_environment_variables (const folder_config_t *folder_config); void setup_umask (void); diff --git a/src/Makefile b/src/Makefile index 1cd440645..a7eb7b985 100644 --- a/src/Makefile +++ b/src/Makefile @@ -750,7 +750,6 @@ CFLAGS_CROSS_WIN := $(CFLAGS) CFLAGS_CROSS_WIN += -fPIC CFLAGS_CROSS_WIN += -I$(WIN_ICONV)/include/ CFLAGS_CROSS_WIN += -DWITH_HWMON -CFLAGS_CROSS_WIN += -D__USE_MINGW_ANSI_STDIO=0 LFLAGS_CROSS_LINUX := $(LFLAGS) LFLAGS_CROSS_LINUX += -lpthread diff --git a/src/event.c b/src/event.c index ec3f3569f..d8ce7a44d 100644 --- a/src/event.c +++ b/src/event.c @@ -8,6 +8,10 @@ #include "thread.h" #include "event.h" +#ifndef __MINGW_PRINTF_FORMAT +#define __MINGW_PRINTF_FORMAT printf +#endif + void event_call (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, const size_t len) { event_ctx_t *event_ctx = hashcat_ctx->event_ctx; @@ -62,7 +66,7 @@ void event_call (const u32 id, hashcat_ctx_t *hashcat_ctx, const void *buf, cons } } -__attribute__ ((format (printf, 1, 0))) +__attribute__ ((format (__MINGW_PRINTF_FORMAT, 1, 0))) static int event_log (const char *fmt, va_list ap, char *s, const size_t sz) { size_t length; From 755b0f41cc5b30e5727c6c5362c001fb595193aa Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 28 Feb 2024 18:46:02 -0800 Subject: [PATCH 4/5] dragon --- src/folder.c | 4 ++-- src/terminal.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/folder.c b/src/folder.c index cf35b97e5..75253ecdb 100644 --- a/src/folder.c +++ b/src/folder.c @@ -13,7 +13,7 @@ #if defined (__APPLE__) #include "event.h" -#elif defined (__FreeBSD__) || defined (__NetBSD__) +#elif defined (__DragonFly__) || (__FreeBSD__) || defined (__NetBSD__) #include #include #endif @@ -46,7 +46,7 @@ static int get_exec_path (char *exec_path, const size_t exec_path_sz) const size_t len = strlen (exec_path); - #elif defined (__FreeBSD__) + #elif defined (__DragonFly__) || (__FreeBSD__) int mib[4]; diff --git a/src/terminal.c b/src/terminal.c index 211a8b24f..07d9190b3 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -441,7 +441,7 @@ void SetConsoleWindowSize (const int x) } #endif -#if defined (__FreeBSD__) || defined (__NetBSD__) || defined (__linux__) || defined (__CYGWIN__) +#if defined (__DragonFly__) || (__FreeBSD__) || defined (__NetBSD__) || defined (__linux__) || defined (__CYGWIN__) static struct termios savemodes; static int havemodes = 0; From b266fa6b7ea18c46f87152f054dde695cf4e2cdc Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Thu, 11 Aug 2022 15:42:35 -0700 Subject: [PATCH 5/5] hashcat: add meson Provides simpler and faster build recipes than the custom ones currently in use. Uses wraps(subprojects) from WrapDB instead of custom dependencies when the host does not provide them. Added a CI to test most platforms. Added wraps in case host system is missing dependencies. Supports cross compilation. Sample Windows cross build definition files added. Signed-off-by: Rosen Penev --- .github/workflows/meson.yml | 167 ++++++++++ BUILD_WSL.md | 5 +- BUILD_macOS.md | 3 - meson.build | 236 ++++++++++++++ meson_options.txt | 14 + mingw32-cross.txt | 16 + mingw64-cross.txt | 16 + modules | 1 + modules/.lock | 0 src/Makefile | 13 +- src/meson.build | 127 ++++++++ src/modules/meson.build | 543 ++++++++++++++++++++++++++++++++ subprojects/.gitignore | 2 + subprojects/minizip-ng.wrap | 13 + subprojects/opencl-headers.wrap | 13 + subprojects/xxhash.wrap | 13 + subprojects/zlib.wrap | 13 + tools/win-iconv-32.diff | 32 -- tools/win-iconv-64.diff | 32 -- ucrt64-cross.txt | 16 + 20 files changed, 1194 insertions(+), 81 deletions(-) create mode 100644 .github/workflows/meson.yml create mode 100644 meson.build create mode 100644 meson_options.txt create mode 100644 mingw32-cross.txt create mode 100644 mingw64-cross.txt create mode 120000 modules delete mode 100644 modules/.lock create mode 100644 src/meson.build create mode 100644 src/modules/meson.build create mode 100644 subprojects/.gitignore create mode 100644 subprojects/minizip-ng.wrap create mode 100644 subprojects/opencl-headers.wrap create mode 100644 subprojects/xxhash.wrap create mode 100644 subprojects/zlib.wrap delete mode 100644 tools/win-iconv-32.diff delete mode 100644 tools/win-iconv-64.diff create mode 100644 ucrt64-cross.txt diff --git a/.github/workflows/meson.yml b/.github/workflows/meson.yml new file mode 100644 index 000000000..128dec5f7 --- /dev/null +++ b/.github/workflows/meson.yml @@ -0,0 +1,167 @@ +name: On PRs - meson + +on: pull_request + +concurrency: + group: ${{github.workflow}}-${{github.head_ref}} + cancel-in-progress: true + +jobs: + Alpine: + runs-on: ubuntu-latest + strategy: + matrix: + platform: ['x86_64', 'x86', 'armhf', 'armv7', 'aarch64', 'ppc64le', 'riscv64'] + defaults: + run: + shell: alpine.sh {0} + steps: + - uses: actions/checkout@v4 + - uses: jirutka/setup-alpine@v1 + with: + branch: edge + arch: ${{matrix.platform}} + packages: > + build-base cmake meson pkgconf linux-headers opencl-dev minizip-dev xxhash-dev zlib-dev + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" -Dwarning_level=3 + meson compile -C "${{github.workspace}}/build" --verbose + meson test -C "${{github.workspace}}/build" --verbose + Ubuntu: + runs-on: ubuntu-20.04 + strategy: + matrix: + cc: ['7', '13'] + steps: + - uses: actions/checkout@v4 + - uses: egor-tensin/setup-gcc@v1 + with: + version: ${{matrix.cc}} + - uses: BSFishy/meson-build@v1.0.3 + with: + action: build + directory: build + options: --verbose + meson-version: 0.57.0 + Ubuntu-clang: + runs-on: ubuntu-20.04 + strategy: + matrix: + cc: ['7', '18'] + env: + CC_LD: lld-${{matrix.cc}} + steps: + - uses: actions/checkout@v4 + - uses: egor-tensin/setup-clang@v1 + with: + version: ${{matrix.cc}} + - name: Install packages + run: | + sudo apt install -y lld-${{matrix.cc}} + - uses: BSFishy/meson-build@v1.0.3 + with: + action: build + directory: build + options: --verbose + meson-version: 0.57.0 + Cygwin: + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: 'MSYS' + install: >- + gcc + libiconv-devel + meson + ninja + - name: Compile and Test + run: | + meson setup build + meson compile -C build --verbose + MSYS2: + runs-on: windows-latest + strategy: + matrix: + platform: ['MINGW64', 'UCRT64', 'CLANG64'] + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v4 + - uses: msys2/setup-msys2@v2 + with: + msystem: ${{matrix.platform}} + pacboy: >- + cc:p + dlfcn:p + meson:p + minizip:p + ninja:p + opencl-headers:p + pkgconf:p + xxhash:p + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose + MacOS: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + - name: Install packages + run: | + python3 -m pip install meson ninja + - name: Compile and Test + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose + DragonflyBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/dragonflybsd-vm@v1 + with: + prepare: | + pkg install -y meson ninja + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose + FreeBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/freebsd-vm@v1 + with: + prepare: | + pkg install -y meson ninja + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose + NetBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/netbsd-vm@v1 + with: + prepare: | + pkg_add meson + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose + OpenBSD: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: vmactions/openbsd-vm@v1 + with: + prepare: | + pkg_add meson ninja + run: | + meson setup "${{github.workspace}}/build" + meson compile -C "${{github.workspace}}/build" --verbose diff --git a/BUILD_WSL.md b/BUILD_WSL.md index 115c3772b..75acdcb15 100644 --- a/BUILD_WSL.md +++ b/BUILD_WSL.md @@ -12,11 +12,8 @@ Enable WSL. Press the win + r key on your keyboard simultaneously and in the "Run" popup window type bash and make sure to install additional dependencies necessary for hashcat compilation ``` -sudo apt install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 make git +sudo apt install gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 win-iconv-mingw-w64-dev make git git clone https://github.com/hashcat/hashcat -git clone https://github.com/win-iconv/win-iconv -cd win-iconv/ -patch < ../hashcat/tools/win-iconv-64.diff sudo make install cd ../ ``` diff --git a/BUILD_macOS.md b/BUILD_macOS.md index 67d09a6bf..bf9dd35e7 100644 --- a/BUILD_macOS.md +++ b/BUILD_macOS.md @@ -9,9 +9,6 @@ Make sure to have the HomeBrew upgraded. ``` brew install mingw-w64 git clone https://github.com/hashcat/hashcat -git clone https://github.com/win-iconv/win-iconv -cd win-iconv/ -patch < ../hashcat/tools/win-iconv-64.diff sudo make install cd ../ ``` diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..13f8aa78c --- /dev/null +++ b/meson.build @@ -0,0 +1,236 @@ +project( + 'hashcat', + 'c', + 'cpp', + version: '6.3.1', + default_options: ['c_std=gnu11', 'cpp_std=c++11', 'warning_level=1'], + meson_version: '>=0.49.0', +) + +cc = meson.get_compiler('c') + +if cc.links('#include \nint main(){iconv_open("", "");}') + iconv_dep = dependency('', required: false) +else + iconv_dep = cc.find_library('iconv') +endif + +threads_dep = dependency('threads') + +deps = [ + iconv_dep, + threads_dep, + dependency('OpenCL-Headers'), + dependency('minizip'), + dependency('libxxhash'), + dependency('zlib'), +] + +if host_machine.system() != 'windows' + if meson.version().version_compare('>=0.62') + deps += dependency('dl') + else + deps += cc.find_library('dl') + endif +endif + +if host_machine.system() == 'windows' + deps += cc.find_library('psapi') + deps += cc.find_library('ws2_32') + if meson.is_cross_build() + deps += cc.find_library('ssp') + endif +elif host_machine.system() == 'darwin' + deps += dependency('appleframeworks', modules: ['CoreFoundation', 'Foundation', 'IOKit', 'Metal']) +else + deps += cc.find_library('m') +endif + +lzma = static_library( + 'lzma', + 'deps/LZMA-SDK/C/7zAlloc.c', + 'deps/LZMA-SDK/C/7zArcIn.c', + 'deps/LZMA-SDK/C/7zBuf.c', + 'deps/LZMA-SDK/C/7zBuf2.c', + 'deps/LZMA-SDK/C/7zCrc.c', + 'deps/LZMA-SDK/C/7zCrcOpt.c', + 'deps/LZMA-SDK/C/7zDec.c', + 'deps/LZMA-SDK/C/7zFile.c', + 'deps/LZMA-SDK/C/7zStream.c', + 'deps/LZMA-SDK/C/Aes.c', + 'deps/LZMA-SDK/C/AesOpt.c', + 'deps/LZMA-SDK/C/Alloc.c', + 'deps/LZMA-SDK/C/Bcj2.c', + 'deps/LZMA-SDK/C/Bcj2Enc.c', + 'deps/LZMA-SDK/C/Bra.c', + 'deps/LZMA-SDK/C/Bra86.c', + 'deps/LZMA-SDK/C/BraIA64.c', + 'deps/LZMA-SDK/C/CpuArch.c', + 'deps/LZMA-SDK/C/Delta.c', + 'deps/LZMA-SDK/C/DllSecur.c', + 'deps/LZMA-SDK/C/LzFind.c', + 'deps/LZMA-SDK/C/LzFindMt.c', + 'deps/LZMA-SDK/C/Lzma2Dec.c', + 'deps/LZMA-SDK/C/Lzma2DecMt.c', + 'deps/LZMA-SDK/C/Lzma2Enc.c', + 'deps/LZMA-SDK/C/Lzma86Dec.c', + 'deps/LZMA-SDK/C/Lzma86Enc.c', + 'deps/LZMA-SDK/C/LzmaDec.c', + 'deps/LZMA-SDK/C/LzmaEnc.c', + 'deps/LZMA-SDK/C/LzmaLib.c', + 'deps/LZMA-SDK/C/MtCoder.c', + 'deps/LZMA-SDK/C/MtDec.c', + 'deps/LZMA-SDK/C/Ppmd7.c', + 'deps/LZMA-SDK/C/Ppmd7Dec.c', + 'deps/LZMA-SDK/C/Ppmd7Enc.c', + 'deps/LZMA-SDK/C/Sha256.c', + 'deps/LZMA-SDK/C/Sha256Opt.c', + 'deps/LZMA-SDK/C/Sort.c', + 'deps/LZMA-SDK/C/Threads.c', + 'deps/LZMA-SDK/C/Xz.c', + 'deps/LZMA-SDK/C/XzCrc64.c', + 'deps/LZMA-SDK/C/XzCrc64Opt.c', + 'deps/LZMA-SDK/C/XzDec.c', + 'deps/LZMA-SDK/C/XzEnc.c', + 'deps/LZMA-SDK/C/XzIn.c', + dependencies: threads_dep, +) + +lzma_inc = include_directories('deps/LZMA-SDK/C') +lzma_dep = declare_dependency( + include_directories: lzma_inc, + link_with: lzma, +) + +deps += lzma_dep + +if get_option('unrar') and host_machine.system() != 'cygwin' + unrar = static_library( + 'unrar', + 'deps/unrar/archive.cpp', + 'deps/unrar/arcread.cpp', + 'deps/unrar/blake2s.cpp', + 'deps/unrar/cmddata.cpp', + 'deps/unrar/consio.cpp', + 'deps/unrar/crc.cpp', + 'deps/unrar/crypt.cpp', + 'deps/unrar/encname.cpp', + 'deps/unrar/errhnd.cpp', + 'deps/unrar/extinfo.cpp', + 'deps/unrar/extract.cpp', + 'deps/unrar/filcreat.cpp', + 'deps/unrar/file.cpp', + 'deps/unrar/filefn.cpp', + 'deps/unrar/filestr.cpp', + 'deps/unrar/find.cpp', + 'deps/unrar/getbits.cpp', + 'deps/unrar/global.cpp', + 'deps/unrar/hash.cpp', + 'deps/unrar/hc_decompress_rar.cpp', + 'deps/unrar/headers.cpp', + 'deps/unrar/isnt.cpp', + 'deps/unrar/list.cpp', + 'deps/unrar/match.cpp', + 'deps/unrar/options.cpp', + 'deps/unrar/pathfn.cpp', + 'deps/unrar/qopen.cpp', + 'deps/unrar/rarvm.cpp', + 'deps/unrar/rawread.cpp', + 'deps/unrar/rdwrfn.cpp', + 'deps/unrar/recvol.cpp', + 'deps/unrar/resource.cpp', + 'deps/unrar/rijndael.cpp', + 'deps/unrar/rs.cpp', + 'deps/unrar/rs16.cpp', + 'deps/unrar/scantree.cpp', + 'deps/unrar/secpassword.cpp', + 'deps/unrar/sha1.cpp', + 'deps/unrar/sha256.cpp', + 'deps/unrar/smallfn.cpp', + 'deps/unrar/strfn.cpp', + 'deps/unrar/strlist.cpp', + 'deps/unrar/system.cpp', + 'deps/unrar/threadpool.cpp', + 'deps/unrar/timefn.cpp', + 'deps/unrar/ui.cpp', + 'deps/unrar/unicode.cpp', + 'deps/unrar/unpack.cpp', + 'deps/unrar/volume.cpp', + ) + + unrar_inc = include_directories('deps/unrar') + unrar_dep = declare_dependency( + include_directories: unrar_inc, + link_with: unrar, + ) + + deps += unrar_dep + if host_machine.system() == 'windows' + deps += cc.find_library('powrprof') + deps += cc.find_library('wbemuuid') + endif +else + unrar_dep = dependency('', required: false) +endif + +incdirs = include_directories('include', 'OpenCL') + +subdir('src') +subdir('modules') + +install_data( + 'hashcat.hcstat2', + install_dir: get_option('libdir') / meson.project_name(), +) + +install_subdir( + 'OpenCL', + install_dir: get_option('libdir') / meson.project_name(), +) + +install_subdir( + 'tunings', + install_dir: get_option('libdir') / meson.project_name(), +) + +install_subdir( + 'charsets', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +install_subdir( + 'docs', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +install_subdir( + 'layouts', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +install_subdir( + 'masks', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +install_subdir( + 'rules', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +install_data( + 'example0.sh', + 'example400.sh', + 'example500.sh', + 'example.dict', + install_dir: get_option('datadir') / 'doc' / meson.project_name(), +) + +executable( + 'hashcat', + 'src/main.c', + c_args: ['-DCOMPTIME=0', '-DVERSION_TAG="@0@"'.format(meson.project_version())], + dependencies: libhashcat_dep, + pie: true, + install: true, +) diff --git a/meson_options.txt b/meson_options.txt new file mode 100644 index 000000000..a4890adc6 --- /dev/null +++ b/meson_options.txt @@ -0,0 +1,14 @@ +option('brain', type : 'boolean', + value : true, + description : 'Build libhashcat with support for its brain', +) + +option('cubin', type : 'boolean', + value : true, + description : 'Build libhashcat with cubin support', +) + +option('unrar', type : 'boolean', + value : true, + description : 'Build libhashcat with unrar support', +) diff --git a/mingw32-cross.txt b/mingw32-cross.txt new file mode 100644 index 000000000..17fe490fb --- /dev/null +++ b/mingw32-cross.txt @@ -0,0 +1,16 @@ +[binaries] +c = 'i686-w64-mingw32-gcc' +cpp = 'i686-w64-mingw32-g++' +ld = 'i686-w64-mingw32-ld' +ar = 'i686-w64-mingw32-ar' +dlltool = 'i686-w64-mingw32-dlltool' +strip = 'i686-w64-mingw32-strip' +pkgconfig = 'i686-w64-mingw32-pkg-config' +windres = 'i686-w64-mingw32-windres' +exe_wrapper = 'wine' + +[host_machine] +system = 'windows' +cpu_family = 'x86' +cpu = 'x86' +endian = 'little' diff --git a/mingw64-cross.txt b/mingw64-cross.txt new file mode 100644 index 000000000..c28c7ee97 --- /dev/null +++ b/mingw64-cross.txt @@ -0,0 +1,16 @@ +[binaries] +c = 'x86_64-w64-mingw32-gcc' +cpp = 'x86_64-w64-mingw32-g++' +ld = 'x86_64-w64-mingw32-ld' +ar = 'x86_64-w64-mingw32-ar' +dlltool = 'x86_64-w64-mingw32-dlltool' +strip = 'x86_64-w64-mingw32-strip' +pkgconfig = 'x86_64-w64-mingw32-pkg-config' +windres = 'x86_64-w64-mingw32-windres' +exe_wrapper = 'wine64' + +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' diff --git a/modules b/modules new file mode 120000 index 000000000..b36e7f391 --- /dev/null +++ b/modules @@ -0,0 +1 @@ +src/modules \ No newline at end of file diff --git a/modules/.lock b/modules/.lock deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/Makefile b/src/Makefile index a7eb7b985..12d4dd2b2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -732,13 +732,6 @@ CXX_WIN := x86_64-w64-mingw32-g++ AR_LINUX := ar AR_WIN := x86_64-w64-mingw32-ar -## To compile win-iconv with mingw clone from here: https://github.com/win-iconv/win-iconv -## -## Then patch the makefile with the patches from tools/win-iconv-64.diff and run make install -## - -WIN_ICONV := /opt/win-iconv-64 - ## ## Compiler options ## @@ -748,7 +741,6 @@ CFLAGS_CROSS_LINUX += -fPIC CFLAGS_CROSS_LINUX += -DWITH_HWMON CFLAGS_CROSS_WIN := $(CFLAGS) CFLAGS_CROSS_WIN += -fPIC -CFLAGS_CROSS_WIN += -I$(WIN_ICONV)/include/ CFLAGS_CROSS_WIN += -DWITH_HWMON LFLAGS_CROSS_LINUX := $(LFLAGS) @@ -758,6 +750,7 @@ LFLAGS_CROSS_LINUX += -lm LFLAGS_CROSS_WIN := $(LFLAGS) LFLAGS_CROSS_WIN += -Wl,--dynamicbase LFLAGS_CROSS_WIN += -Wl,--nxcompat +LFLAGS_CROSS_WIN += -liconv LFLAGS_CROSS_WIN += -lpsapi LFLAGS_CROSS_WIN += -lws2_32 LFLAGS_CROSS_WIN += -lpowrprof @@ -874,10 +867,10 @@ obj/combined.WIN.a: $(WIN_OBJS) hashcat.bin: src/main.c obj/combined.LINUX.a $(CC_LINUX) $(CCFLAGS) $(CFLAGS_CROSS_LINUX) -o $@ $^ $(LFLAGS_CROSS_LINUX) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -DINSTALL_FOLDER=\"$(INSTALL_FOLDER)\" -DSHARED_FOLDER=\"$(SHARED_FOLDER)\" -DDOCUMENT_FOLDER=\"$(DOCUMENT_FOLDER)\" -hashcat.exe: src/main.c obj/combined.WIN.a $(WIN_ICONV)/lib/libiconv.a +hashcat.exe: src/main.c obj/combined.WIN.a $(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -o $@ $^ $(LFLAGS_CROSS_WIN) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -hashcat.dll: src/main.c obj/combined.WIN.a $(WIN_ICONV)/lib/libiconv.a +hashcat.dll: src/main.c obj/combined.WIN.a $(CC_WIN) $(CCFLAGS) $(CFLAGS_CROSS_WIN) -o $@ $^ $(LFLAGS_CROSS_WIN) -DCOMPTIME=$(COMPTIME) -DVERSION_TAG=\"$(VERSION_TAG)\" -shared endif diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 000000000..e80762fb6 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,127 @@ +libhashcat_srcs = files( + 'affinity.c', + 'autotune.c', + 'backend.c', + 'benchmark.c', + 'bitmap.c', + 'bitops.c', + 'combinator.c', + 'common.c', + 'convert.c', + 'cpt.c', + 'cpu_crc32.c', + 'debugfile.c', + 'dictstat.c', + 'dispatch.c', + 'dynloader.c', + 'emu_general.c', + 'emu_inc_bignum_operations.c', + 'emu_inc_cipher_aes.c', + 'emu_inc_cipher_camellia.c', + 'emu_inc_cipher_des.c', + 'emu_inc_cipher_kuznyechik.c', + 'emu_inc_cipher_serpent.c', + 'emu_inc_cipher_twofish.c', + 'emu_inc_common.c', + 'emu_inc_ecc_secp256k1.c', + 'emu_inc_hash_base58.c', + 'emu_inc_hash_md4.c', + 'emu_inc_hash_md5.c', + 'emu_inc_hash_ripemd160.c', + 'emu_inc_hash_sha1.c', + 'emu_inc_hash_sha224.c', + 'emu_inc_hash_sha256.c', + 'emu_inc_hash_sha384.c', + 'emu_inc_hash_sha512.c', + 'emu_inc_hash_streebog256.c', + 'emu_inc_hash_streebog512.c', + 'emu_inc_hash_whirlpool.c', + 'emu_inc_platform.c', + 'emu_inc_rp.c', + 'emu_inc_rp_optimized.c', + 'emu_inc_scalar.c', + 'emu_inc_simd.c', + 'event.c', + 'ext_ADL.c', + 'ext_OpenCL.c', + 'ext_cuda.c', + 'ext_hip.c', + 'ext_hiprtc.c', + 'ext_iokit.c', + 'ext_lzma.c', + 'ext_nvapi.c', + 'ext_nvml.c', + 'ext_nvrtc.c', + 'ext_sysfs_amdgpu.c', + 'ext_sysfs_cpu.c', + 'filehandling.c', + 'folder.c', + 'hashcat.c', + 'hashes.c', + 'hlfmt.c', + 'hwmon.c', + 'induct.c', + 'interface.c', + 'keyboard_layout.c', + 'locking.c', + 'logfile.c', + 'loopback.c', + 'memory.c', + 'monitor.c', + 'mpsp.c', + 'outfile.c', + 'outfile_check.c', + 'pidfile.c', + 'potfile.c', + 'restore.c', + 'rp.c', + 'rp_cpu.c', + 'selftest.c', + 'shared.c', + 'slow_candidates.c', + 'status.c', + 'stdout.c', + 'straight.c', + 'terminal.c', + 'thread.c', + 'timer.c', + 'tuningdb.c', + 'usage.c', + 'user_options.c', + 'wordlist.c', +) + +if host_machine.system() == 'darwin' + add_languages('objc') + libhashcat_srcs += files('ext_metal.m') +endif + +hashcat_args = [] +if get_option('brain') + hashcat_args += '-DWITH_BRAIN' + libhashcat_srcs += 'brain.c' +endif + +if get_option('cubin') + hashcat_args += '-DWITH_CUBIN' +endif + +if host_machine.system() in ['cygwin', 'darwin', 'linux', 'windows'] + hashcat_args += '-DWITH_HWMON' +endif + +libhashcat = library( + 'hashcat', + libhashcat_srcs, + c_args: hashcat_args, + include_directories: incdirs, + version: meson.project_version(), + dependencies: deps, + install: true, +) + +libhashcat_dep = declare_dependency( + dependencies: deps, + include_directories: incdirs, + link_with: libhashcat, +) diff --git a/src/modules/meson.build b/src/modules/meson.build new file mode 100644 index 000000000..18a4326c2 --- /dev/null +++ b/src/modules/meson.build @@ -0,0 +1,543 @@ +modules = [ + '00000', + '00010', + '00011', + '00012', + '00020', + '00021', + '00022', + '00023', + '00024', + '00030', + '00040', + '00050', + '00060', + '00070', + '00100', + '00101', + '00110', + '00111', + '00112', + '00120', + '00121', + '00122', + '00124', + '00125', + '00130', + '00131', + '00132', + '00133', + '00140', + '00141', + '00150', + '00160', + '00170', + '00200', + '00300', + '00400', + '00500', + '00501', + '00600', + '00610', + '00620', + '00900', + '01000', + '01100', + '01300', + '01400', + '01410', + '01411', + '01420', + '01421', + '01430', + '01440', + '01441', + '01450', + '01460', + '01470', + '01500', + '01600', + '01700', + '01710', + '01711', + '01720', + '01722', + '01730', + '01731', + '01740', + '01750', + '01760', + '01770', + '01800', + '02000', + '02100', + '02400', + '02410', + '02500', + '02501', + '02600', + '02611', + '02612', + '02630', + '02711', + '02811', + '03000', + '03100', + '03200', + '03500', + '03610', + '03710', + '03711', + '03730', + '03800', + '03910', + '04010', + '04110', + '04300', + '04400', + '04410', + '04420', + '04430', + '04500', + '04510', + '04520', + '04521', + '04522', + '04700', + '04710', + '04711', + '04800', + '04900', + '05000', + '05100', + '05200', + '05300', + '05400', + '05500', + '05600', + '05700', + '05800', + '06000', + '06050', + '06060', + '06100', + '06211', + '06212', + '06213', + '06221', + '06222', + '06223', + '06231', + '06232', + '06233', + '06241', + '06242', + '06243', + '06300', + '06400', + '06500', + '06600', + '06700', + '06800', + '06900', + '07000', + '07100', + '07200', + '07300', + '07350', + '07400', + '07401', + '07500', + '07700', + '07701', + '07800', + '07801', + '07900', + '08000', + '08100', + '08200', + '08300', + '08400', + '08500', + '08600', + '08700', + '08800', + '08900', + '09000', + '09100', + '09200', + '09300', + '09400', + '09500', + '09600', + '09700', + '09710', + '09720', + '09800', + '09810', + '09820', + '09900', + '10000', + '10100', + '10200', + '10300', + '10400', + '10410', + '10420', + '10500', + '10600', + '10700', + '10800', + '10810', + '10820', + '10830', + '10840', + '10870', + '10900', + '10901', + '11000', + '11100', + '11200', + '11300', + '11400', + '11500', + '11600', + '11700', + '11750', + '11760', + '11800', + '11850', + '11860', + '11900', + '12000', + '12001', + '12100', + '12200', + '12300', + '12400', + '12500', + '12600', + '12700', + '12800', + '12900', + '13000', + '13100', + '13200', + '13300', + '13400', + '13500', + '13600', + '13711', + '13712', + '13713', + '13721', + '13722', + '13723', + '13731', + '13732', + '13733', + '13741', + '13742', + '13743', + '13751', + '13752', + '13753', + '13761', + '13762', + '13763', + '13771', + '13772', + '13773', + '13781', + '13782', + '13783', + '13800', + '13900', + '14000', + '14100', + '14400', + '14500', + '14600', + '14700', + '14800', + '14900', + '15000', + '15100', + '15200', + '15300', + '15310', + '15400', + '15500', + '15600', + '15700', + '15900', + '15910', + '16000', + '16100', + '16200', + '16300', + '16400', + '16500', + '16600', + '16700', + '16800', + '16801', + '16900', + '17010', + '17020', + '17030', + '17040', + '17200', + '17210', + '17220', + '17225', + '17230', + '17300', + '17400', + '17500', + '17600', + '17700', + '17800', + '17900', + '18000', + '18100', + '18200', + '18300', + '18400', + '18500', + '18600', + '18700', + '18800', + '18900', + '19000', + '19100', + '19200', + '19300', + '19500', + '19600', + '19700', + '19800', + '19900', + '20011', + '20012', + '20013', + '20200', + '20300', + '20400', + '20500', + '20510', + '20600', + '20710', + '20711', + '20712', + '20720', + '20800', + '20900', + '21000', + '21100', + '21200', + '21300', + '21310', + '21400', + '21420', + '21500', + '21501', + '21600', + '21700', + '21800', + '22000', + '22001', + '22100', + '22200', + '22300', + '22301', + '22400', + '22500', + '22600', + '22700', + '22911', + '22921', + '22931', + '22941', + '22951', + '23001', + '23002', + '23003', + '23100', + '23200', + '23300', + '23400', + '23500', + '23600', + '23700', + '23900', + '24100', + '24200', + '24300', + '24410', + '24420', + '24500', + '24600', + '24700', + '24800', + '24900', + '25000', + '25100', + '25200', + '25300', + '25400', + '25500', + '25600', + '25700', + '25800', + '25900', + '26000', + '26100', + '26200', + '26300', + '26401', + '26402', + '26403', + '26500', + '26600', + '26610', + '26700', + '26800', + '26900', + '27000', + '27100', + '27200', + '27300', + '27400', + '27500', + '27600', + '27700', + '27800', + '27900', + '28000', + '28100', + '28200', + '28300', + '28400', + '28501', + '28502', + '28503', + '28504', + '28505', + '28506', + '28600', + '28700', + '28800', + '28900', + '29000', + '29100', + '29200', + '29311', + '29312', + '29313', + '29321', + '29322', + '29323', + '29331', + '29332', + '29333', + '29341', + '29342', + '29343', + '29411', + '29412', + '29413', + '29421', + '29422', + '29423', + '29431', + '29432', + '29433', + '29441', + '29442', + '29443', + '29451', + '29452', + '29453', + '29461', + '29462', + '29463', + '29471', + '29472', + '29473', + '29481', + '29482', + '29483', + '29511', + '29512', + '29513', + '29521', + '29522', + '29523', + '29531', + '29532', + '29533', + '29541', + '29542', + '29543', + '29600', + '29700', + '29800', + '29910', + '29920', + '29930', + '29940', + '30000', + '30120', + '30420', + '30500', + '30600', + '30700', + '30901', + '30902', + '30903', + '30904', + '30905', + '30906', + '31000', + '31100', + '31200', + '31300', + '31400', + '31700', + '31800', + '31900', + '32000', + '32010', + '32020', + '32030', + '32031', + '32040', + '32041', + '32050', + '32060', + '32070', + '32100', + '32200', + '32300', + '32410', + '32420', + '32500', + '99999', +] + +if unrar_dep.found() + modules += '23800' +endif + +foreach m : modules + shared_library( + 'module_@0@'.format(m), + 'module_@0@.c'.format(m), + c_args: '-DMODULE_INTERFACE_VERSION_CURRENT=700', + name_prefix: '', + dependencies: libhashcat_dep, + install: true, + install_dir: get_option('libdir') / 'hashcat' / 'modules', + ) +endforeach diff --git a/subprojects/.gitignore b/subprojects/.gitignore new file mode 100644 index 000000000..faa2502ea --- /dev/null +++ b/subprojects/.gitignore @@ -0,0 +1,2 @@ +/*/ +!packagefiles/ diff --git a/subprojects/minizip-ng.wrap b/subprojects/minizip-ng.wrap new file mode 100644 index 000000000..35c574bda --- /dev/null +++ b/subprojects/minizip-ng.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = minizip-ng-4.0.4 +source_url = https://github.com/zlib-ng/minizip-ng/archive/refs/tags/4.0.4.tar.gz +source_filename = 4.0.4.tar.gz +source_hash = 955800fe39f9d830fcb84e60746952f6a48e41093ec7a233c63ad611b5fcfe9f +patch_filename = minizip-ng_4.0.4-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/minizip-ng_4.0.4-1/get_patch +patch_hash = ea85589c3b658728c97690cd7acaf05c8391ec1b99b63f234b9468e4a308c498 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/minizip-ng_4.0.4-1/4.0.4.tar.gz +wrapdb_version = 4.0.4-1 + +[provide] +minizip = minizip_ng_dep diff --git a/subprojects/opencl-headers.wrap b/subprojects/opencl-headers.wrap new file mode 100644 index 000000000..15a8e309b --- /dev/null +++ b/subprojects/opencl-headers.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = OpenCL-Headers-2023.04.17 +source_url = https://github.com/KhronosGroup/OpenCL-Headers/archive/refs/tags/v2023.04.17.tar.gz +source_filename = OpenCL-Headers-2023.04.17.tar.gz +source_hash = 0ce992f4167f958f68a37918dec6325be18f848dee29a4521c633aae3304915d +patch_filename = opencl-headers_2023.04.17-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/opencl-headers_2023.04.17-1/get_patch +patch_hash = 7f948e8da8d5c654f05e7d9e8832669645d69e712fed836541f029e4f65712c6 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/opencl-headers_2023.04.17-1/OpenCL-Headers-2023.04.17.tar.gz +wrapdb_version = 2023.04.17-1 + +[provide] +OpenCL-Headers = opencl_headers_dep diff --git a/subprojects/xxhash.wrap b/subprojects/xxhash.wrap new file mode 100644 index 000000000..e4d612565 --- /dev/null +++ b/subprojects/xxhash.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = xxHash-0.8.2 +source_url = https://github.com/Cyan4973/xxHash/archive/v0.8.2.tar.gz +source_filename = xxHash-0.8.2.tar.gz +source_hash = baee0c6afd4f03165de7a4e67988d16f0f2b257b51d0e3cb91909302a26a79c4 +patch_filename = xxhash_0.8.2-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/xxhash_0.8.2-1/get_patch +patch_hash = e721ef7a4c4ee0ade8b8440f6f7cb9f935b68e825249d74cb1c2503c53e68d25 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/xxhash_0.8.2-1/xxHash-0.8.2.tar.gz +wrapdb_version = 0.8.2-1 + +[provide] +libxxhash = xxhash_dep diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap new file mode 100644 index 000000000..aa14de177 --- /dev/null +++ b/subprojects/zlib.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = zlib-1.3.1 +source_url = http://zlib.net/fossils/zlib-1.3.1.tar.gz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/zlib_1.3.1-1/zlib-1.3.1.tar.gz +source_filename = zlib-1.3.1.tar.gz +source_hash = 9a93b2b7dfdac77ceba5a558a580e74667dd6fede4585b91eefb60f03b72df23 +patch_filename = zlib_1.3.1-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/zlib_1.3.1-1/get_patch +patch_hash = e79b98eb24a75392009cec6f99ca5cdca9881ff20bfa174e8b8926d5c7a47095 +wrapdb_version = 1.3.1-1 + +[provide] +zlib = zlib_dep diff --git a/tools/win-iconv-32.diff b/tools/win-iconv-32.diff deleted file mode 100644 index 7dc17e3a6..000000000 --- a/tools/win-iconv-32.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/Makefile b/Makefile -index 5937584..8777fad 100644 ---- a/Makefile -+++ b/Makefile -@@ -6,10 +6,10 @@ - # MKDIR_P, INSTALL, RM - # prefix, BINARY_PATH, INCLUDE_PATH, LIBRARY_PATH - --CC ?= gcc --AR ?= ar --RANLIB ?= ranlib --DLLTOOL ?= dlltool -+CC := i686-w64-mingw32-gcc -+AR := i686-w64-mingw32-ar -+RANLIB := i686-w64-mingw32-ranlib -+DLLTOOL := i686-w64-mingw32-dlltool - - MKDIR_P = mkdir -p - INSTALL = install -c -@@ -19,10 +19,10 @@ RM = rm -f - DEFAULT_LIBICONV_DLL ?= \"\" - - CFLAGS += -pedantic -Wall --CFLAGS += -DUSE_LIBICONV_DLL -+#CFLAGS += -DUSE_LIBICONV_DLL - CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL) - --prefix ?= /usr/local -+prefix ?= /opt/win-iconv-32 - BINARY_PATH = $(prefix)/bin - INCLUDE_PATH = $(prefix)/include - LIBRARY_PATH = $(prefix)/lib diff --git a/tools/win-iconv-64.diff b/tools/win-iconv-64.diff deleted file mode 100644 index 2c658d8c1..000000000 --- a/tools/win-iconv-64.diff +++ /dev/null @@ -1,32 +0,0 @@ -diff --git a/Makefile b/Makefile -index 5937584..c4742a3 100644 ---- a/Makefile -+++ b/Makefile -@@ -6,10 +6,10 @@ - # MKDIR_P, INSTALL, RM - # prefix, BINARY_PATH, INCLUDE_PATH, LIBRARY_PATH - --CC ?= gcc --AR ?= ar --RANLIB ?= ranlib --DLLTOOL ?= dlltool -+CC := x86_64-w64-mingw32-gcc -+AR := x86_64-w64-mingw32-ar -+RANLIB := x86_64-w64-mingw32-ranlib -+DLLTOOL := x86_64-w64-mingw32-dlltool - - MKDIR_P = mkdir -p - INSTALL = install -c -@@ -19,10 +19,10 @@ RM = rm -f - DEFAULT_LIBICONV_DLL ?= \"\" - - CFLAGS += -pedantic -Wall --CFLAGS += -DUSE_LIBICONV_DLL -+#CFLAGS += -DUSE_LIBICONV_DLL - CFLAGS += -DDEFAULT_LIBICONV_DLL=$(DEFAULT_LIBICONV_DLL) - --prefix ?= /usr/local -+prefix ?= /opt/win-iconv-64 - BINARY_PATH = $(prefix)/bin - INCLUDE_PATH = $(prefix)/include - LIBRARY_PATH = $(prefix)/lib diff --git a/ucrt64-cross.txt b/ucrt64-cross.txt new file mode 100644 index 000000000..d2061b5b1 --- /dev/null +++ b/ucrt64-cross.txt @@ -0,0 +1,16 @@ +[binaries] +c = 'x86_64-w64-mingw32ucrt-gcc' +cpp = 'x86_64-w64-mingw32ucrt-g++' +ld = 'x86_64-w64-mingw32ucrt-ld' +ar = 'x86_64-w64-mingw32ucrt-ar' +dlltool = 'x86_64-w64-mingw32ucrt-dlltool' +strip = 'x86_64-w64-mingw32ucrt-strip' +pkgconfig = 'x86_64-w64-mingw32ucrt-pkg-config' +windres = 'x86_64-w64-mingw32ucrt-windres' +exe_wrapper = 'wine64' + +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little'