2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
2024-02-29 20:09:43 +00:00
|
|
|
, nix-update-script
|
2022-12-02 08:20:57 +00:00
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2022-12-02 08:20:57 +00:00
|
|
|
pname = "bkcrack";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "1.7.0";
|
2022-12-02 08:20:57 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "kimci86";
|
2024-02-29 20:09:43 +00:00
|
|
|
repo = "bkcrack";
|
|
|
|
rev = "v${finalAttrs.version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-smDmnqmYuFT3ip3ULQfiiF5YxkwzPwPYBujqq9GUyMs=";
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.updateScript = nix-update-script { };
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
cmakeFlags = [
|
|
|
|
"-DBKCRACK_BUILD_TESTING=${if finalAttrs.doCheck then "ON" else "OFF"}"
|
|
|
|
];
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
postInstall = ''
|
2024-02-29 20:09:43 +00:00
|
|
|
mkdir -p $out/bin $out/share/doc/bkcrack $out/share/licenses/bkcrack
|
2022-12-02 08:20:57 +00:00
|
|
|
mv $out/bkcrack $out/bin/
|
|
|
|
mv $out/license.txt $out/share/licenses/bkcrack
|
2024-02-29 20:09:43 +00:00
|
|
|
mv $out/example $out/tools $out/readme.md $out/share/doc/bkcrack
|
2022-12-02 08:20:57 +00:00
|
|
|
'';
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2022-12-02 08:20:57 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Crack legacy zip encryption with Biham and Kocher's known plaintext attack";
|
|
|
|
homepage = "https://github.com/kimci86/bkcrack";
|
|
|
|
license = licenses.zlib;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ erdnaxe ];
|
2024-02-29 20:09:43 +00:00
|
|
|
mainProgram = "bkcrack";
|
2022-12-02 08:20:57 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|