This commit is contained in:
nora 2023-11-08 20:56:14 +01:00
parent 4981d850f7
commit 66316bd3be
4 changed files with 17 additions and 19 deletions

1
.envrc Normal file
View file

@ -0,0 +1 @@
use nix

16
shell.nix Normal file
View file

@ -0,0 +1,16 @@
{ pkgs ? import <nixpkgs> { } }: pkgs.mkShell {
buildInputs = with pkgs; [
rustup
gcc
clang_16
llvmPackages_16.bintools
];
shellHook = ''
export PATH=$PATH:''${CARGO_HOME:-~/.cargo}/bin
'';
packages = (with pkgs; [
gef
rust-bindgen
shellcheck
]);
}

16
test.c
View file

@ -1,16 +0,0 @@
#include <stdio.h>
#define __USE_GNU
#include <dlfcn.h>
#include <elf.h>
void *get_eh_frame(void *addr)
{
struct dl_find_object out;
int ret = _dl_find_object(addr, &out);
if (ret != 0)
{
return NULL;
}
return out.dlfo_eh_frame;
}

View file

@ -1,3 +0,0 @@
fn main() {
panic!();
}