-
-
Save fasterthanlime/1632c7452d78e2ebae05506f99caaf60 to your computer and use it in GitHub Desktop.
Install glibc debug symbols on Arch Linux for pwndbg heap analysis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# Install glibc-debug | |
sudo pacman -U *.pkg.tar.xz | |
sed '/^OPTIONS/ s/!debug/debug/g; /^OPTIONS/ s/strip/!strip/g' /etc/makepkg.conf | |
sudo pacman -S gdb pwndbg | |
echo "Don't forget to add `source /usr/share/pwndbg/gdbinit.py` to your ~/.gdbinit" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment