Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/target
/core
/dist
/result
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ We provide two types of releases for Windows (x64), Linux (x86-64 and arm64), an
"slim", which only contains the `srcdump` main executable. It will download uv and angr (as well as its dependencies) during runtime (requires Internet connection).
"full", which contains srcdump, uv, and a bundled virtual environment of angr (does not require Internet connection during runtime).

### Nix

srcdump can be built or run with Nix flakes. The package puts nixpkgs' uv on `PATH`, and srcdump provisions angr with it on first run.

```
$ nix run github:angr/srcdump -- ./program
$ nix develop # shell with the Rust toolchain and uv
```

## How it works

srcdump is a thin orchestrator written in Rust.
Expand Down
61 changes: 61 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
description = "srcdump: an objdump-like tool that prints decompiled code, backed by angr";

inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
};

outputs =
{
self,
nixpkgs,
flake-utils,
}:
flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = nixpkgs.legacyPackages.${system};
cargoToml = builtins.fromTOML (builtins.readFile ./Cargo.toml);

# srcdump itself. At runtime it provisions angr with uv, so put
# nixpkgs' uv on PATH instead of letting srcdump download one.
srcdump = pkgs.rustPlatform.buildRustPackage {
pname = "srcdump";
inherit (cargoToml.package) version;

src = pkgs.lib.cleanSource ./.;
cargoLock.lockFile = ./Cargo.lock;

nativeBuildInputs = [ pkgs.makeWrapper ];

postInstall = ''
wrapProgram $out/bin/srcdump \
--suffix PATH : ${pkgs.lib.makeBinPath [ pkgs.uv ]}
'';

meta = {
inherit (cargoToml.package) description homepage;
license = pkgs.lib.licenses.bsd2;
mainProgram = "srcdump";
};
};
in
{
packages = {
inherit srcdump;
default = srcdump;
};

apps.default = flake-utils.lib.mkApp { drv = srcdump; };

devShells.default = pkgs.mkShell {
inputsFrom = [ srcdump ];
packages = with pkgs; [
cargo
rustc
rustfmt
clippy
rust-analyzer
uv
];
};
}
);
}
Loading