-
-
Notifications
You must be signed in to change notification settings - Fork 757
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
Adding support for mmap over qemu user #579
Conversation
Cool, we've been meaning to get better support, but this is too hacked in. Could you maybe abstract this out? Maybe we can have a global Maybe a |
Yes I agree, get_pid could check if it is using qemu and return the tid, I'm currently talking with people on qemu to see if maybe the gdbstub could be expanded a bit, in particular it would be nice to have file transfer. That would allow us to directly get /proc/pid/maps, among other things. Copying libs aswell. |
I too like the patch a lot but very hack-ish (for good reason, mostly qemu limitation I admit).
That would be perfect, do you have a follow-up on that @nnewram ? Or maybe a link we could use for tracking ? Thanks |
I spoke with people from both gdb and qemu about this. Both gdb and qemu shifts blame on the other party, As stsquad suggests, it might already be possible to do, could be worth looking in to. |
…- which would not work on non 64b archs, we completely assumes that the debugged binary is emulated by qemu and therefore show the qemu mem maping. This allows for a clean and effective way to have the correct page permissions set in gef (and might help oneself who tries to escape the qemu process :) )
See #638 |
Adding support for mmap over qemu user
Description/Motivation/Screenshots
This patch allows vmmap to work on a local qemu user session. Previously pid was taken using get_pid() but because qemu gives 1 as a pid and the actual system pid as a tid, gef could not find the correct /proc/$TID/maps. This is fixed by using gdb.selected_thread().ptid[1] rather than get_pid()
https://imgur.com/V4rLF85
How Has This Been Tested?
make tests
Checklist
dev
branch, notmaster
.Comment on adding tests
I do not know if a test is suited here. I guess it would be possible to launch a qemu process and check against it, but then the user would have to have qemu-user installed.