Unverified Commit a49ad52b authored by Michael Daniels's avatar Michael Daniels Committed by GitHub
Browse files

ghidra-extensions.ghidraninja-ghidra-scripts: add useSwift overridable boolean (#461604)

parents 6bf38b72 a4314b20
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
  binwalk,
  swift,
  yara,
  useSwift ? false,
}:

buildGhidraScripts {
@@ -20,11 +21,20 @@ buildGhidraScripts {

  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 "'
  '';
    substituteInPlace binwalk.py --replace-fail 'subprocess.call(["binwalk"' 'subprocess.call(["${lib.getExe binwalk}"'
    substituteInPlace yara.py --replace-fail 'subprocess.check_output(["yara"' 'subprocess.check_output(["${lib.getExe yara}"'
    substituteInPlace YaraSearch.py --replace-fail '"yara "' '"${lib.getExe yara} "'
  ''
  + (
    if useSwift then
      ''
        substituteInPlace swift_demangler.py --replace-fail '"swift"' '"${lib.getExe' swift "swift"}"'
      ''
    else
      ''
        rm swift_demangler.py
      ''
  );

  meta = {
    description = "Scripts for the Ghidra software reverse engineering suite";