Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arch Support - Roadmap #340

Open
klockeph opened this issue Sep 12, 2017 · 14 comments

Comments

Projects
None yet
6 participants
@klockeph
Copy link
Contributor

commented Sep 12, 2017

Hi,

pwndbg currently only supports Ubuntu and as stated in some other issues, help would be appreciated to make it compatible with other distros.

As I'm an arch user and pwndbg lover myself, I would like to contribute something to this - if I am able to.

The problem is, that I (and probably also other possible collaborators) don't know where to start. So I'm creating this issue to ask for a basic roadmap on what is needed for arch support (especially the heap stuff).

Could you provide a basic roadmap what issues exist?

@anthraxx

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

@disconnect3d

This comment has been minimized.

Copy link
Member

commented Sep 12, 2017

Someone pointed out somewhere (might have been @bennofs on IRC?) that it is possible to use heap when one has libc compiled with debug symbols.

@anthraxx I've reformatted your msg a bit; guess u write from the phone? ;p

@bennofs

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

I am using pwndbg on arch without much problems. For heap support, you need a glibc with debug symbols which you can get by following the steps in https://wiki.archlinux.org/index.php/Arch_Build_System to build glibc yourself after enabling debug in /etc/makepkg.conf. The main issue that doesn't work well is the type detection that just tries to parse include files, but I am not sure how many features rely on that one?

@disconnect3d

This comment has been minimized.

Copy link
Member

commented Sep 12, 2017

Maybe we should add a glibc-debug AUR package and add it as pwndbg and pwndbg-git dependency?

What do you guys think? I don't have any experience in AUR packaging.

@klockeph

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2017

A follow-up question: I've manually set up pwndbg (with git clone, make etc.), can I somehow uninstall it and reinstall it from the AUR then if this improves arch support? I didn't want to install it from AUR because the last update was from 2016.
(But maybe I misunderstood the last-update thing, and it's using the latest version, I'm not experienced with the AUR)

@klockeph

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2017

@bennofs could you elaborate on your answer a little bit more? I think I understand how to enable debugging in /etc/makepkg.conf but not how to rebuild glibc myself.

@bennofs

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2017

@KillPinguin

Assuming you have enabled DEBUG in /etc/makepkg.conf, do the following steps:

for 64 bit glibc debug symbols:
$ svn checkout --depth=empty svn://svn.archlinux.org/core arch-core
$ cd arch-core
$ svn update glibc
$ cd glibc/repos/core-x86_64/
$ makepkg
# pacman -Q glibc-*.pkg.tar.xz
for 32 bit glibc debug symbols:
$ svn checkout --depth=empty svn://svn.archlinux.org/community arch-community
$ cd arch-community
$ svn update lib32-glibc
$ cd lib32-glibc/repos/multilib-x86_64/
$ makepkg
# pacman -Q lib32-glibc-*.pkg.tar.xz

You will need to rebuilt these when the glibc version in the official repository changes.

@zachriggle

This comment has been minimized.

Copy link
Member

commented Sep 14, 2017

There are two official Arch packages:

https://aur.archlinux.org/packages/pwndbg/
https://aur.archlinux.org/packages/pwndbg-git/

My recommendation is to use the second package.

@klockeph

This comment has been minimized.

Copy link
Contributor Author

commented Sep 15, 2017

@zachriggle thank you for your comment. But don't I have to remove the current installation before installing it from AUR?

@disconnect3d

This comment has been minimized.

Copy link
Member

commented Sep 15, 2017

@KillPinguin pwndbg vs pwndbg-git packages? Probably AUR will tell you that they conflict and ask whether you want to remove pwndbg if you install pwndbg-git.

If you ask git clone+install vs AUR package then I think it doesn't really matter.
You just need proper path to the pwndbg you want to launch in source ... in ~/.gdbinit.

@Aloxaf

This comment has been minimized.

Copy link

commented Oct 19, 2018

A simple way to make pwndbg work on Arch Linux based on @bennofs 's solution

svn checkout --depth=empty svn://svn.archlinux.org/packages
cd packages
svn update glibc

# Build glibc (Fix #340)
cd glibc/repos/core-x86_64
echo en_US.UTF-8 UTF-8 >>locale.gen.txt
## For Chinese users
## echo zh_CN.UTF-8 UTF-8 >>locale.gen.txt
## sed -i 's#sourceware.org/git/glibc.git#gitee.com/Aloxaf/glibc.git#' PKGBUILD
# generate detached debugging symbols
sed -i 's#!strip#debug#' PKGBUILD
makepkg --skipchecksums
sudo pacman -U *.pkg.tar.xz


# Build gdb (Fix #535)
# --DELETED, NOT GDB'S PROBLEM--
@disconnect3d

This comment has been minimized.

Copy link
Member

commented Oct 19, 2018

@Aloxaf you mean to make pwndbg work with glibc/heap?

@anthraxx you might consider adding this to the distro packages.

@anthraxx

This comment has been minimized.

Copy link
Contributor

commented Oct 19, 2018

i don't see what recompiling GDB in Arch would achieve, it already links to pthread. And for glibc we need to wait for debug symbol support (which is being worked on)

@Aloxaf

This comment has been minimized.

Copy link

commented Oct 19, 2018

@disconnect3d Yes. But it's not something new, I just renewed the way to get debug symbols.
@anthraxx You are right, I haven't noticed that before and thought it was a problem with GDB.
It's great to hear that debug symbol support is being worked on, rebuild glibc everytime it updates is really troublesome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.