format_args: display fd path by disconnect3d · Pull Request #825 · pwndbg/pwndbg...
source link: https://github.com/pwndbg/pwndbg/pull/825
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
New issue
format_args: display fd path #825
Merged
Conversation
E.g. for calls like this:
► 0x555555554a57 <main+296> call ioctl@plt <ioctl@plt>
fd: 0x3
request: 0xae01
vararg: 0x0
We want to display the fd
as: fd: 0x3 (/some/path)
fetched fromreadlink -f /proc/$PID/fd/$FD
.
# Enhance args display
if arg.name == 'fd' and isinstance(value, int):
path = pwndbg.file.readlink('/proc/%d/fd/%d' % (pwndbg.proc.pid, value))
Does this fail gracefully for qemu-user?
That's why its not merged yet. I haven't checked that :P.
From https://github.com/pwndbg/pwndbg/blob/dev/pwndbg/file.py#L66-L135 it seems it should work with remote targets and with QEMU usermode.
It seems that for unsupported targets, we should get ''
path.
I am merging this for now and see a few cases if it works properly.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
No one assigned
None yet
No milestone
Successfully merging this pull request may close these issues.
None yet
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK