diff --git a/pkgs/tools/security/ghidra/extensions.nix b/pkgs/tools/security/ghidra/extensions.nix index 60070a316a0f9..6cec3cef9b530 100644 --- a/pkgs/tools/security/ghidra/extensions.nix +++ b/pkgs/tools/security/ghidra/extensions.nix @@ -29,4 +29,6 @@ lib.makeScope newScope (self: { sleighdevtools = self.callPackage ./extensions/sleighdevtools { inherit ghidra; }; + wasm = self.callPackage ./extensions/wasm { inherit ghidra; }; + }) diff --git a/pkgs/tools/security/ghidra/extensions/wasm/default.nix b/pkgs/tools/security/ghidra/extensions/wasm/default.nix new file mode 100644 index 0000000000000..ff691939d4807 --- /dev/null +++ b/pkgs/tools/security/ghidra/extensions/wasm/default.nix @@ -0,0 +1,41 @@ +{ + lib, + fetchFromGitHub, + buildGhidraExtension, + ghidra, + ant, +}: +let + version = "2.3.1"; +in +buildGhidraExtension { + pname = "wasm"; + inherit version; + + src = fetchFromGitHub { + owner = "nneonneo"; + repo = "ghidra-wasm-plugin"; + rev = "v${version}"; + hash = "sha256-aoSMNzv+TgydiXM4CbvAyu/YsxmdZPvpkZkYEE3C+V4="; + }; + + # compile sleigh + configurePhase = '' + runHook preConfigure + + pushd data + ${ant}/bin/ant -f build.xml -Dghidra.install.dir=${ghidra}/lib/ghidra sleighCompile + popd + + runHook postConfigure + ''; + + meta = { + description = "Ghidra Wasm plugin with disassembly and decompilation support"; + homepage = "https://github.com/nneonneo/ghidra-wasm-plugin"; + downloadPage = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${version}"; + changelog = "https://github.com/nneonneo/ghidra-wasm-plugin/releases/tag/v${version}"; + license = lib.licenses.gpl3; + maintainers = [ lib.maintainers.BonusPlay ]; + }; +}