about summary refs log tree commit diff
path: root/pkgs/tools
diff options
context:
space:
mode:
authorEmily Trau <me@angus.ws>2022-12-26 19:52:43 +1100
committerEmily Trau <emily@downunderctf.com>2024-05-20 12:51:43 +1000
commit4e3898b79a5d8b4008d370b6518d6c5cec1a1977 (patch)
treeeaf36358e70c829ecbd39a7c8adc81ba897378a4 /pkgs/tools
parent204a20a512c28d9ae70d3706975e2ba669016760 (diff)
ghidra-extensions.ghidraninja-ghidra-scripts: init at unstable-2020-10-07
Diffstat (limited to 'pkgs/tools')
-rw-r--r--pkgs/tools/security/ghidra/extensions.nix2
-rw-r--r--pkgs/tools/security/ghidra/extensions/ghidraninja-ghidra-scripts/default.nix36
2 files changed, 38 insertions, 0 deletions
diff --git a/pkgs/tools/security/ghidra/extensions.nix b/pkgs/tools/security/ghidra/extensions.nix
index a5b2f0a643643..2f3669c797a90 100644
--- a/pkgs/tools/security/ghidra/extensions.nix
+++ b/pkgs/tools/security/ghidra/extensions.nix
@@ -2,4 +2,6 @@
 
 lib.makeScope newScope (self: {
   inherit (callPackage ./build-extension.nix { inherit ghidra; }) buildGhidraExtension buildGhidraScripts;
+
+  ghidraninja-ghidra-scripts = self.callPackage ./extensions/ghidraninja-ghidra-scripts { };
 })
diff --git a/pkgs/tools/security/ghidra/extensions/ghidraninja-ghidra-scripts/default.nix b/pkgs/tools/security/ghidra/extensions/ghidraninja-ghidra-scripts/default.nix
new file mode 100644
index 0000000000000..6c5e2ec2ea2af
--- /dev/null
+++ b/pkgs/tools/security/ghidra/extensions/ghidraninja-ghidra-scripts/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, fetchFromGitHub
+, buildGhidraScripts
+, binwalk
+, swift
+, yara
+}:
+
+buildGhidraScripts {
+  pname = "ghidraninja-ghidra-scripts";
+  version = "unstable-2020-10-07";
+
+  src = fetchFromGitHub {
+    owner = "ghidraninja";
+    repo = "ghidra_scripts";
+    rev = "99f2a8644a29479618f51e2d4e28f10ba5e9ac48";
+    sha256 = "aElx0mp66/OHQRfXwTkqdLL0gT2T/yL00bOobYleME8=";
+  };
+
+  postPatch = ''
+    # Replace subprocesses with store versions
+    substituteInPlace binwalk.py --replace-fail 'subprocess.call(["binwalk"' 'subprocess.call(["${binwalk}/bin/binwalk"'
+    substituteInPlace swift_demangler.py --replace-fail '"swift"' '"${swift}/bin/swift"'
+    substituteInPlace yara.py --replace-fail 'subprocess.check_output(["yara"' 'subprocess.check_output(["${yara}/bin/yara"'
+    substituteInPlace YaraSearch.py --replace-fail '"yara "' '"${yara}/bin/yara "'
+  '';
+
+  meta = with lib; {
+    description = "Scripts for the Ghidra software reverse engineering suite";
+    homepage = "https://github.com/ghidraninja/ghidra_scripts";
+    license = with licenses; [
+      gpl3Only
+      gpl2Only
+    ];
+  };
+}