2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv
|
2020-06-19 10:36:08 +00:00
|
|
|
, fetchurl
|
|
|
|
, makeWrapper
|
|
|
|
, opencl-headers
|
|
|
|
, ocl-icd
|
|
|
|
, xxHash
|
|
|
|
}:
|
2014-03-31 15:56:02 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-05-28 08:51:43 +00:00
|
|
|
pname = "hashcat";
|
2021-08-30 16:38:54 +00:00
|
|
|
version = "6.2.4";
|
2014-03-31 15:56:02 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-11-01 15:05:10 +00:00
|
|
|
url = "https://hashcat.net/files/hashcat-${version}.tar.gz";
|
2021-08-30 16:38:54 +00:00
|
|
|
sha256 = "sha256-kCA5b/kzaT4xC0ebZB6G8Xg9mBnWDR2Qd1KtjSSmDDE=";
|
2014-03-31 15:56:02 +00:00
|
|
|
};
|
|
|
|
|
2017-11-01 15:05:10 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
2018-11-17 20:10:52 +00:00
|
|
|
buildInputs = [ opencl-headers xxHash ];
|
2014-03-31 15:56:02 +00:00
|
|
|
|
2017-11-01 15:05:10 +00:00
|
|
|
makeFlags = [
|
2019-01-08 02:51:22 +00:00
|
|
|
"PREFIX=${placeholder "out"}"
|
2017-11-01 15:05:10 +00:00
|
|
|
"COMPTIME=1337"
|
|
|
|
"VERSION_TAG=${version}"
|
2019-05-28 08:51:43 +00:00
|
|
|
"USE_SYSTEM_OPENCL=1"
|
|
|
|
"USE_SYSTEM_XXHASH=1"
|
2017-11-01 15:05:10 +00:00
|
|
|
];
|
2014-03-31 15:56:02 +00:00
|
|
|
|
2021-02-22 01:37:51 +00:00
|
|
|
preFixup = ''
|
|
|
|
for f in $out/share/hashcat/OpenCL/*.cl; do
|
2021-05-11 12:01:35 +00:00
|
|
|
# Rewrite files to be included for compilation at runtime for opencl offload
|
2021-02-22 01:37:51 +00:00
|
|
|
sed "s|#include \"\(.*\)\"|#include \"$out/share/hashcat/OpenCL/\1\"|g" -i "$f"
|
2021-05-11 12:01:35 +00:00
|
|
|
sed "s|#define COMPARE_\([SM]\) \"\(.*\.cl\)\"|#define COMPARE_\1 \"$out/share/hashcat/OpenCL/\2\"|g" -i "$f"
|
2021-02-22 01:37:51 +00:00
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2017-11-01 15:05:10 +00:00
|
|
|
postFixup = ''
|
|
|
|
wrapProgram $out/bin/hashcat --prefix LD_LIBRARY_PATH : ${ocl-icd}/lib
|
2014-03-31 15:56:02 +00:00
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2014-03-31 15:56:02 +00:00
|
|
|
description = "Fast password cracker";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://hashcat.net/hashcat/";
|
2017-11-01 15:05:10 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ kierdavis zimbatm ];
|
2014-03-31 15:56:02 +00:00
|
|
|
};
|
|
|
|
}
|