feat: added second template for pwn

This commit is contained in:
Patrick Großmann 2023-10-08 15:17:31 +02:00
parent 182dd834a4
commit 1f3f080d27
Signed by: patrick
GPG key ID: 451F95EFB8BECD0F
6 changed files with 164 additions and 8 deletions

View file

@ -11,6 +11,10 @@
path = ./pwn; path = ./pwn;
description = "My pwn flake template"; description = "My pwn flake template";
}; };
pwn-ld = {
path = ./pwn-ld;
description = "template for loading libc in current folder";
};
}; };
}; };
} }

3
pwn-ld/.envrc Normal file
View file

@ -0,0 +1,3 @@
nix_direnv_watch_file ./devshell.nix
source_up_if_exists
use flake .

24
pwn-ld/devshell.nix Normal file
View file

@ -0,0 +1,24 @@
{
nixpkgs,
devshell,
...
}: system: let
pkgs = import nixpkgs {
inherit system;
overlays = [devshell.overlays.default];
};
shell = with pkgs; {
name = "devshell template";
env = [
{
name = "NIX_LD";
eval = "$PWD/ld-linux-x86-64.so.2";
}
{
name = "NIX_LD_LIBRARY_PATH";
eval = "$PWD/:\${NIX_LD_LIBRARY_PATH-""}";
}
];
};
in
pkgs.devshell.mkShell shell

112
pwn-ld/flake.lock Normal file
View file

@ -0,0 +1,112 @@
{
"nodes": {
"devshell": {
"inputs": {
"nixpkgs": "nixpkgs",
"systems": "systems"
},
"locked": {
"lastModified": 1695973661,
"narHash": "sha256-BP2H4c42GThPIhERtTpV1yCtwQHYHEKdRu7pjrmQAwo=",
"owner": "numtide",
"repo": "devshell",
"rev": "cd4e2fda3150dd2f689caeac07b7f47df5197c31",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "devshell",
"type": "github"
}
},
"flake-utils": {
"inputs": {
"systems": "systems_2"
},
"locked": {
"lastModified": 1694529238,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=",
"owner": "numtide",
"repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "flake-utils",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1677383253,
"narHash": "sha256-UfpzWfSxkfXHnb4boXZNaKsAcUrZT9Hw+tao1oZxd08=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9952d6bc395f5841262b006fbace8dd7e143b634",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixpkgs-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"nixpkgs_2": {
"locked": {
"lastModified": 1696604326,
"narHash": "sha256-YXUNI0kLEcI5g8lqGMb0nh67fY9f2YoJsILafh6zlMo=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "87828a0e03d1418e848d3dd3f3014a632e4a4f64",
"type": "github"
},
"original": {
"owner": "NixOS",
"ref": "nixos-unstable",
"repo": "nixpkgs",
"type": "github"
}
},
"root": {
"inputs": {
"devshell": "devshell",
"flake-utils": "flake-utils",
"nixpkgs": "nixpkgs_2"
}
},
"systems": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
},
"systems_2": {
"locked": {
"lastModified": 1681028828,
"narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=",
"owner": "nix-systems",
"repo": "default",
"rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e",
"type": "github"
},
"original": {
"owner": "nix-systems",
"repo": "default",
"type": "github"
}
}
},
"root": "root",
"version": 7
}

21
pwn-ld/flake.nix Normal file
View file

@ -0,0 +1,21 @@
{
description = "Patrick tolles flake template";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
devshell.url = "github:numtide/devshell";
};
outputs = {
self,
nixpkgs,
flake-utils,
devshell,
} @ inputs:
flake-utils.lib.eachDefaultSystem (
system: {
devShell = import ./devshell.nix inputs system;
}
);
}

View file

@ -30,14 +30,6 @@
]; ];
env = [ env = [
{
name = "NIX_LD";
eval = "$PRJ_ROOT/ld-linux-x86-64.so.2";
}
{
name = "NIX_LD_LIBRARY_PATH";
eval = "$PRJ_ROOT";
}
]; ];
}; };
in in