Commit c30be260 authored by tahanonu's avatar tahanonu
Browse files

ophcrack-cli: refactor to use ophcrack

parent de95681a
Loading
Loading
Loading
Loading
+63 −0
Original line number Diff line number Diff line
{ lib
, stdenv
, fetchurl
, fetchpatch
, autoreconfHook
, libtool
, zlib
, pkg-config
, openssl
, freetype
, expat
{
  lib,
  stdenv,
  libsForQt5,
  fetchurl,
  fetchpatch,
  pkg-config,
  openssl,
  expat,
  enableGui ? true,
}:

stdenv.mkDerivation rec {

  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";
    url = "mirror://ophcrack/ophcrack/${version}/ophcrack-${version}.tar.bz2";
    hash = "sha256-BIpt9XmDo6WjGsfE7BLfFqpJ5lKilnbZPU75WdUK7uA=";
  };

  nativeBuildInputs = [
    autoreconfHook
    libtool
    expat
  ];

  buildInputs = [
    zlib
    openssl
    freetype
    pkg-config
  ];

  patches = [
    (fetchpatch {
      url = "https://salsa.debian.org/pkg-security-team/ophcrack/-/raw/c60118b40802e1162dcebfe5f881cf973b2334d3/debian/patches/fix_spelling_error.diff";
@@ -44,30 +30,34 @@ stdenv.mkDerivation rec {
    })
  ];

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

  buildPhase = ''
    runHook preBuild

    make

    runHook postBuild
  nativeBuildInputs = [ pkg-config ] ++ lib.optional enableGui libsForQt5.wrapQtAppsHook;
  buildInputs =
    [ openssl ]
    ++ (if enableGui then [ libsForQt5.qtcharts ] else [ expat ]) ++ lib.optional stdenv.isDarwin expat;

  configureFlags =
    [ "--with-libssl" ]
    ++ (
      if enableGui then
        [
          "--enable-gui"
          "--with-qt5charts"
        ]
      else
        [ "--disable-gui" ]
    );

  installPhase = lib.optional stdenv.isDarwin ''
    mkdir -p $out/bin
    cp -R src/ophcrack $out/bin
  '';

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

  meta = with lib; {
  meta = {
    description = "Free Windows password cracker based on rainbow tables";
    homepage = "https://ophcrack.sourceforge.io";
    license = with licenses; [ gpl2Plus ];
    maintainers = with maintainers; [ tochiaha ];
    mainProgram = "ophcrack-cli";
    platforms = platforms.all;
    license = with lib.licenses; [ gpl2Plus ];
    maintainers = with lib.maintainers; [ tochiaha ];
    mainProgram = "ophcrack";
    platforms = lib.platforms.all;
  };
}
+2 −0
Original line number Diff line number Diff line
@@ -11151,6 +11151,8 @@ with pkgs;
  openfec = callPackage ../development/libraries/openfec { };
  ophcrack-cli = ophcrack.override { enableGui = false; };
  ophis = python3Packages.callPackage ../development/compilers/ophis { };
  opendylan_bin = callPackage ../development/compilers/opendylan/bin.nix { };