Rust handles libraries that it links with in a somewhat "magical" way, in that if you want to link to
libpixman-1.so.0 you would just write:
println!("cargo:rustc-link-lib=pixman-1");I'm doing some ELF parsing and I need to simulate ld.so's lookup routine (man ld.so).
To do that, I need to grab RPATH as well as RUNPATH from binaries, so to test my tool
I naturally need to make some binaries with each of those. Here's how you do it.
cat <<EOF > /tmp/a.c
int main(){}
EOF| # sh <(curl -L https://nixos.org/nix/install) | |
| # nix-build https://github.com/LnL7/nix-darwin/archive/master.tar.gz -A installer | |
| # ./result/bin/darwin-installer | |
| # Go through installer, put this file where you want it | |
| # darwin-rebuild switch -I darwin-config=${HOME}/wherever/you/put/it/configuration.nix | |
| # There will probably be errors :) | |
| { config, pkgs, lib, ... }: | |
| let | |
| username = "novafacing"; |
| from pwn import * | |
| from subprocess import run, PIPE | |
| from pathlib import Path | |
| import re | |
| import random | |
| context.arch = "arm" | |
| context.bits = 64 | |
| PC_REG = r"\(void \(\*\)\(\)\) (0x[0-9a-f]+)" |