forked from Gallopsled/pwntools
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue Gallopsled#1273, make gdb.debug() respect exe param
This feature currently only works for context.native, i.e for LOCAL debugging on 'i386' or 'amd64' Implementation Challenges and solution: 1. `gdbserver` has no immediate support for manipulating argv[0] * Use the `--wrapper` flag, to execve the binary * Note that it must be an execve and not an fork+execve, since otherwise gdbserver doesn't attach 2. In python3 `os.execve` doesn't allow empty argv[0]. * Use `ctypes` to effectively call the execve function from Libc via python * `_generate_execve_script` generates this script and stores in a temp file * `gdbserver --wrapper python script.py -- dummy` to call it
- Loading branch information
Showing
1 changed file
with
132 additions
and
50 deletions.
There are no files selected for viewing
This file contains 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