diff --git a/pkgs/tools/security/ghidra/extensions.nix b/pkgs/tools/security/ghidra/extensions.nix index a94d6d290e50..d8b76862e743 100644 --- a/pkgs/tools/security/ghidra/extensions.nix +++ b/pkgs/tools/security/ghidra/extensions.nix @@ -31,4 +31,5 @@ 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 000000000000..b8c8eaff8001 --- /dev/null +++ b/pkgs/tools/security/ghidra/extensions/wasm/default.nix @@ -0,0 +1,43 @@ +{ + 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="; + }; + + nativeBuildInputs = [ ant ]; + + configurePhase = '' + runHook preConfigure + + # this doesn't really compile, it compresses sinc into sla + pushd data + 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 ]; + }; +}