Commit 4e3898b7 authored by Emily Trau's avatar Emily Trau Committed by Emily Trau
Browse files

ghidra-extensions.ghidraninja-ghidra-scripts: init at unstable-2020-10-07

parent 204a20a5
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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 { };
})
+36 −0
Original line number Diff line number Diff line
{ 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
    ];
  };
}