Skip to content

Commit

Permalink
ghidra: add wasm extension (NixOS#349645)
Browse files Browse the repository at this point in the history
  • Loading branch information
philiptaron authored Nov 25, 2024
2 parents 7c18ea3 + 4167057 commit 091621c
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/tools/security/ghidra/extensions.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,5 @@ lib.makeScope newScope (self: {

sleighdevtools = self.callPackage ./extensions/sleighdevtools { inherit ghidra; };

wasm = self.callPackage ./extensions/wasm { inherit ghidra; };
})
43 changes: 43 additions & 0 deletions pkgs/tools/security/ghidra/extensions/wasm/default.nix
Original file line number Diff line number Diff line change
@@ -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 ];
};
}

0 comments on commit 091621c

Please sign in to comment.