2015-06-01 14:58:07 +01:00
|
|
|
{ stdenv, fetchurl, p7zip, patchelf, gmp }:
|
2014-03-31 16:56:02 +01:00
|
|
|
|
2014-08-22 10:57:40 +01:00
|
|
|
assert stdenv.isLinux;
|
|
|
|
|
2014-03-31 16:56:02 +01:00
|
|
|
let
|
|
|
|
bits = if stdenv.system == "x86_64-linux" then "64" else "32";
|
2015-06-01 14:58:07 +01:00
|
|
|
libPath = stdenv.lib.makeLibraryPath [ stdenv.cc.libc gmp ];
|
2014-03-31 16:56:02 +01:00
|
|
|
|
|
|
|
fixBin = x: ''
|
2014-12-17 18:11:30 +00:00
|
|
|
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
|
2014-03-31 16:56:02 +01:00
|
|
|
--set-rpath ${libPath} ${x}
|
|
|
|
'';
|
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "hashcat-${version}";
|
2015-06-01 14:58:07 +01:00
|
|
|
version = "0.49";
|
2014-03-31 16:56:02 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "http://hashcat.net/files/${name}.7z";
|
2015-06-01 14:58:07 +01:00
|
|
|
sha256 = "0va07flncihgmnri5wj0jn636w86x5qwm4jmj2halcyg7qwqijh2";
|
2014-03-31 16:56:02 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ p7zip patchelf ];
|
|
|
|
|
|
|
|
unpackPhase = "7z x $src > /dev/null && cd ${name}";
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/bin $out/libexec
|
|
|
|
cp -R * $out/libexec
|
|
|
|
|
|
|
|
echo -n "/" > $out/bin/eula.accepted
|
|
|
|
ln -s $out/libexec/hashcat-cli${bits}.bin $out/bin/hashcat
|
|
|
|
ln -s $out/libexec/hashcat-cliXOP.bin $out/bin/hashcat-xop
|
|
|
|
ln -s $out/libexec/hashcat-cliAVX.bin $out/bin/hashcat-avx
|
|
|
|
'';
|
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
${fixBin "$out/libexec/hashcat-cli${bits}.bin"}
|
|
|
|
${fixBin "$out/libexec/hashcat-cliXOP.bin"}
|
|
|
|
${fixBin "$out/libexec/hashcat-cliAVX.bin"}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Fast password cracker";
|
|
|
|
homepage = "http://hashcat.net/hashcat/";
|
|
|
|
license = stdenv.lib.licenses.unfreeRedistributable;
|
|
|
|
platforms = stdenv.lib.platforms.linux;
|
|
|
|
maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
|
|
|
|
};
|
|
|
|
}
|