Skip to content

Instantly share code, notes, and snippets.

@evanrichter
evanrichter / nixpkgs master
Created October 30, 2023 22:52
closure size of ffmpeg-full
> nix path-info --recursive --size --closure-size --human-readable -- ./result-bin
/nix/store/sdhmm56jv7r449hf7f57cl3pvnsy3cbg-xgcc-12.3.0-libgcc 139.1K 139.1K
/nix/store/4r64z7v5l40pg6r0hd169bcs85c8c42b-libunistring-1.1 1.8M 1.8M
/nix/store/w4djxksksd1p8m054k537plqnif5858k-libidn2-2.3.4 350.4K 2.1M
/nix/store/gqghjch4p1s69sv4mcjksb2kb65rwqjy-glibc-2.38-23 28.8M 31.1M
/nix/store/37gz8bz89lkppqdbby2wvmw19i8zwpiv-numactl-2.0.16 244.0K 31.3M
/nix/store/001lpbj4056r9h8fx9bwsas41rl8qy9a-lttng-ust-2.13.1 1.5M 32.8M
/nix/store/01550m4gj902l5q388zfb325fmv06r8w-ffmpeg-full-6.0-data 264.3K 264.3K
/nix/store/s5gzrzha72q79v92wqq61x9ir8xiwbxk-zlib-1.3 125.6K 31.2M
/nix/store/a46nf6mzygm6nv8dkis6mybm8363inhc-libpng-apng-1.6.40 249.3K 31.5M
@evanrichter
evanrichter / gdb.txt
Created February 17, 2022 04:58
mold coredump
gef➤ file /home/evan/projects/mold/mold
Reading symbols from /home/evan/projects/mold/mold...
gef➤ bt
#0 0x0000000000b24bfa in do_dlsym_private ()
#1 0x0000000000b26a48 in _dl_catch_exception ()
#2 0x0000000000b26b13 in _dl_catch_error ()
#3 0x0000000000b25339 in __libc_register_dl_open_hook ()
#4 0x0000000000aab908 in __dlopen ()
#5 0x000000000096db5f in tbb::detail::r1::global_symbols_link (library=<optimized out>, descriptors=<optimized out>, required=<optimized out>) at /mold/third-party/tbb/src/tbb/dynamic_link.cpp:390
#6 tbb::detail::r1::dynamic_link (library=0x7ffe46c21f60 "", descriptors=0xb2b9e0 <tbb::detail::r1::MallocLinkTable>, required=0x4, handle=0x0, flags=0x7) at /mold/third-party/tbb/src/tbb/dynamic_link.cpp:464
@evanrichter
evanrichter / absolute_call
Created February 16, 2022 18:45
absolute call mold bug
[evan@arch mold-break]$ cat absolute_call.c
#include <stddef.h>
int main(void) {
size_t x = 0x12340000;
void (*f)() = (void (*)())x;
f();
}
# here is current mold built with build-static.sh
@evanrichter
evanrichter / log
Created February 16, 2022 18:25
mold segfault
[evan@arch mold-break]$ /home/evan/projects/mold/mold -v
mold 1.0.3 (da48efe63ba2b073bff237daa5aa7d379764bba1; compatible with GNU ld)
[evan@arch mold-break]$ cat absolute_call.rs
pub fn main() {
unsafe {
let x: usize = 0x12340000;
let f: extern "C" fn() = std::mem::transmute(x);
f();
}
}
@evanrichter
evanrichter / log
Created February 15, 2022 03:22
mold miscompile i686 linux musl
[evan@arch asdf]$ rustc --emit=obj --target=i686-unknown-linux-musl -C opt-level=3 -C link-arg=-fuse-ld=/usr/bin/mold -C link-arg=-Wl,--image-base=0x40000,-v -C linker=/usr/bin/clang -C link-arg=-v src/main.rs
[evan@arch asdf]$ file main.o
main.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped
[evan@arch asdf]$ objdump -dr main.o
main.o: file format elf32-i386
Disassembly of section .text._ZN3std10sys_common9backtrace28__rust_begin_short_backtrace17h7e3e23934c3cb896E:

RITSEC 2021: Baby Graph

Points: 231

Category: Rev/Bin

Summary

We are presented with three files:

  • babygraph: the compiled binary, running on the challenge server
@evanrichter
evanrichter / Dockerfile
Created August 31, 2019 23:32
archlinux libsigrok build fail
from archlinux/base
run pacman -Syu --noconfirm
run pacman -S --noconfirm git gcc make autoconf autoconf-archive automake libtool pkg-config glib2 glibmm libzip libusb libftdi check doxygen python-numpy python-setuptools swig jdk8-openjdk
run git clone git://sigrok.org/libsigrok
workdir ./libsigrok
run ./autogen.sh
run ./configure
run make

Keybase proof

I hereby claim:

  • I am evanrichter on github.
  • I am evanrichter (https://keybase.io/evanrichter) on keybase.
  • I have a public key ASDvsn_5CGyvH1m0Vd1SAJUqqcCIXORutEv3K_uYSkhx0go

To claim this, I am signing this object: