Skip to content

Instantly share code, notes, and snippets.

@FrankSpierings
Created February 29, 2020 11:28
Show Gist options
  • Save FrankSpierings/1bb8ece3d5a2ac2519d4fa7213e56126 to your computer and use it in GitHub Desktop.
Save FrankSpierings/1bb8ece3d5a2ac2519d4fa7213e56126 to your computer and use it in GitHub Desktop.

Outside container

NAME=winbuild; docker run --rm -it --name ${NAME} --hostname ${NAME} -v /tmp/data:/tmp/data ubuntu bash

Inside container

apt update -y
apt install -y build-essential git make mingw-w64 win-iconv-mingw-w64-dev
cd /tmp/data
git clone https://github.com/hashcat/hashcat.git
cd hashcat
cat << "_EOF" > /tmp/patch
diff --git a/src/Makefile b/src/Makefile
index f378c0fe..b1b18723 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -27,6 +27,7 @@ UNAME                   := $(patsubst CYGWIN_NT-%,CYGWIN,$(UNAME))
 UNAME                   := $(patsubst MSYS_NT-%,MSYS2,$(UNAME))
 UNAME                   := $(patsubst MINGW32_NT-%,MSYS2,$(UNAME))
 UNAME                   := $(patsubst MINGW64_NT-%,MSYS2,$(UNAME))
+UNAME                   := MSYS2

 ifeq (,$(filter $(UNAME),Linux FreeBSD Darwin CYGWIN MSYS2))
 $(error "! Your Operating System ($(UNAME)) is not supported by this Makefile")
@@ -56,7 +57,7 @@ MODULE_INTERFACE_VERSION := 520
 ## Native compiler paths
 ##

-CC                      := gcc
+CC                      := x86_64-w64-mingw32-gcc
 AR                      := ar
 FIND                    := find
 INSTALL                 := install
_EOF

make -j4
cp /usr/x86_64-w64-mingw32/bin/iconv.dll .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment