1{ lib
2, stdenv
3, fetchFromGitHub
4, rustPlatform
5, openssl
6, elfutils
7, makeBinaryWrapper
8, pkg-config
9, xz
10, Security
11}:
12
13rustPlatform.buildRustPackage rec {
14 pname = "pwninit";
15 version = "3.3.1";
16
17 src = fetchFromGitHub {
18 owner = "io12";
19 repo = "pwninit";
20 rev = version;
21 sha256 = "sha256-tbZS7PdRFvO2ifoHA/w3cSPfqqHrLeLHAg6V8oG9gVE=";
22 };
23
24 buildInputs = [ openssl xz ] ++ lib.optionals stdenv.isDarwin [ Security ];
25 nativeBuildInputs = [ pkg-config makeBinaryWrapper ];
26 postInstall = ''
27 wrapProgram $out/bin/pwninit \
28 --prefix PATH : "${lib.getBin elfutils}/bin"
29 '';
30 doCheck = false; # there are no tests to run
31
32 cargoHash = "sha256-J2uQoqStBl+qItaXWi17H/IailZ7P4YzhLNs17BY92Q=";
33
34 meta = {
35 description = "Automate starting binary exploit challenges";
36 mainProgram = "pwninit";
37 homepage = "https://github.com/io12/pwninit";
38 license = lib.licenses.mit;
39 maintainers = [ lib.maintainers.scoder12 ];
40 platforms = lib.platforms.all;
41 };
42}