git.iko.soy/typeable/nixpkgs
on master help sign in
initial ghidra-9.0

I tested basic usage of tool CodeBrowser. The tool VersionTracking raises an error.

commit631faad148e516973554b78158cdded0976f574b authorChristian Kögler <ck3d@gmx.de> dateWed 6 Mar 2019, 13:00 (8 years ago) parent34aa254
2 files changed+56
pkgs/tools/security/ghidra/default.nix+54 pkgs/top-level/all-packages.nix+2
pkgs/tools/security/ghidra/default.nixnew file+54
@@ -0,0 +1,54 @@
1+{ stdenv, fetchurl, unzip, lib, makeWrapper, patchelf
2+, openjdk11, pam
3+}: let
4+
5+ pkg_path = "$out/lib/ghidra";
6+
7+in stdenv.mkDerivation {
8+
9+ name = "ghidra-9.0";
10+
11+ src = fetchurl {
12+ url = https://ghidra-sre.org/ghidra_9.0_PUBLIC_20190228.zip;
13+ sha256 = "3b65d29024b9decdbb1148b12fe87bcb7f3a6a56ff38475f5dc9dd1cfc7fd6b2";
14+ };
15+
16+ nativeBuildInputs = [
17+ makeWrapper
18+ patchelf
19+ unzip
20+ ];
21+
22+ dontStrip = true;
23+
24+ postPatch = ''
25+ for f in Ghidra/Features/Decompiler/os/linux64/* GPL/DemanglerGnu/os/linux64/*; do
26+ patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
27+ --set-rpath "${stdenv.cc.libc}/lib:${stdenv.cc.cc.lib}/lib" "$f"
28+ done
29+
30+ for f in Ghidra/Features/GhidraServer/os/linux64/*; do
31+ patchelf --set-rpath "${stdenv.cc.libc}/lib:${pam}/lib" "$f"
32+ done
33+ '';
34+
35+ installPhase = ''
36+ mkdir -p "${pkg_path}"
37+ cp -a * "${pkg_path}"
38+ '';
39+
40+ postFixup = ''
41+ mkdir -p "$out/bin"
42+ makeWrapper "${pkg_path}/ghidraRun" "$out/bin/ghidra" \
43+ --prefix PATH : ${lib.makeBinPath [ openjdk11 ]}
44+ '';
45+
46+ meta = with lib; {
47+ description = "A software reverse engineering (SRE) suite of tools developed by NSA's Research Directorate in support of the Cybersecurity mission";
48+ homepage = "https://ghidra-sre.org/";
49+ platforms = [ "x86_64-linux" ];
50+ license = licenses.asl20;
51+ maintainers = [ maintainers.ck3d ];
52+ };
53+
54+}
pkgs/top-level/all-packages.nix+2
@@ -1447,6 +1447,8 @@ in
14471447
14481448 gh-ost = callPackage ../tools/misc/gh-ost { };
14491449
1450+ ghidra-bin = callPackage ../tools/security/ghidra { };
1451+
14501452 gif-for-cli = callPackage ../tools/misc/gif-for-cli { };
14511453
14521454 gist = callPackage ../tools/text/gist { };