7

format_args: display fd path by disconnect3d · Pull Request #825 · pwndbg/pwndbg...

 2 years ago
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.
neoserver,ios ssh client

New issue

format_args: display fd path #825

Merged

disconnect3d merged 2 commits into

dev

from

display-fd-path

on Aug 22, 2021

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 from
readlink -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.

Copy link

Member

Author

disconnect3d commented on Aug 22, 2021

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.

disconnect3d

merged commit fd3c6e2 into

dev on Aug 22, 2021

1 of 4 checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

No one assigned

Labels
None yet
Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK