Skip to content

Commit

Permalink
ophcrack: init at 3.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Tochiaha committed Jul 4, 2024
1 parent 72fd057 commit fbd65e0
Showing 1 changed file with 127 additions and 0 deletions.
127 changes: 127 additions & 0 deletions pkgs/by-name/op/ophcrack/package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
lib,
stdenv,
enableQt5 ? true,
libsForQt5,
fetchurl,
fetchpatch,
autoreconfHook,
pkg-config,
openssl,
libtool,
zlib,
freetype,
expat,
}:

let
ophcrackApp = {
pname = "ophcrack";
version = "3.8.0";

src = fetchurl {
url = "https://sourceforge.net/projects/ophcrack/files/ophcrack/3.8.0/ophcrack-3.8.0.tar.bz2";
hash = "sha256-BIpt9XmDo6WjGsfE7BLfFqpJ5lKilnbZPU75WdUK7uA=";
};

patches = [
(fetchpatch {
url = "https://salsa.debian.org/pkg-security-team/ophcrack/-/raw/c60118b40802e1162dcebfe5f881cf973b2334d3/debian/patches/fix_spelling_error.diff";
hash = "sha256-Fc044hTU4Mtdym+HukGAwGzaLm7aVzV9KpvHvFUG2Sc=";
})
(fetchpatch {
url = "https://salsa.debian.org/pkg-security-team/ophcrack/-/raw/e19d993a7dbf131d13128366e2aac270a685befc/debian/patches/qmake_crossbuild.diff";
hash = "sha256-sOKXOBpAYGLacU6IxjRzy3HCnGm4DFowDL2qP+DzG8M=";
})
];
};

ophcrackCli = stdenv.mkDerivation (
ophcrackApp
// {
pname = "ophcrack-cli";
nativeBuildInputs = [
autoreconfHook
libtool
expat
pkg-config
];
buildInputs = [
openssl
zlib
freetype
];

configureFlags = [
"--with-libssl=yes"
"--disable-gui"
];

buildPhase = ''
runHook preBuild
make
runHook postBuild
'';

postInstall = ''
mv $out/bin/ophcrack $out/bin/ophcrack-cli
'';
}
);

ophcrackGui = stdenv.mkDerivation (
ophcrackApp
// {
pname = "ophcrack-gui";
nativeBuildInputs = [
pkg-config
libsForQt5.wrapQtAppsHook
];
buildInputs = [
openssl
libsForQt5.qtcharts
];

configureFlags = [
"--with-libssl=yes"
"--enable-gui"
"--with-qt5charts"
];

postinstall = ''
wrapProgram $out/bin/ophcrack \
--prefix PATH : "${libsForQt5.qtbase}/bin"
'';
}
);

in
stdenv.mkDerivation {
pname = "ophcrack";
version = "3.8.0";
src = null;

nativeBuildInputs = [ ];
buildInputs = [
ophcrackCli
ophcrackGui
];

dontUnpack = true;

installPhase = ''
mkdir -p $out/bin
cp ${ophcrackCli}/bin/ophcrack-cli $out/bin/
cp ${ophcrackGui}/bin/ophcrack $out/bin/
'';

meta = {
description = "Free Windows password cracker based on rainbow tables";
homepage = "https://ophcrack.sourceforge.io";
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ tochiaha ];
platforms = lib.platforms.all;
};
}

0 comments on commit fbd65e0

Please sign in to comment.