Skip to content

Instantly share code, notes, and snippets.

@MUWASEC
Forked from nbulischeck/install-glibc-debug.sh
Last active September 27, 2021 17:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MUWASEC/81eaa91982230687a2f1a3e4fd9001d3 to your computer and use it in GitHub Desktop.
Save MUWASEC/81eaa91982230687a2f1a3e4fd9001d3 to your computer and use it in GitHub Desktop.
Install glibc debug symbols on Arch Linux for pwndbg heap analysis
#!/bin/bash
# Install Dependencies
sudo pacman -S git svn gd lib32-gcc-libs patch make bison fakeroot
# Checkout glibc source
svn checkout --depth=empty svn://svn.archlinux.org/packages
cd packages
svn update glibc
cd glibc/repos/core-x86_64
# Add current locale to locale.gen.txt
grep -v "#" /etc/locale.gen >> locale.gen.txt
# Enable debug build in PKGBUILD
sed -i 's#!strip#debug#' PKGBUILD
# Build glibc and glibc-debug packages
makepkg --skipchecksums --skippgpcheck
# Install glibc-debug
sudo pacman -U *.pkg.tar.*
sed '/^OPTIONS/ s/!debug/debug/g; /^OPTIONS/ s/strip/!strip/g' /etc/makepkg.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment