Gallopsled/pwntools — pull request #62 by zachriggle (2014-08-04 12:41:15+00:00)
Title: GDB resolution for modules

So the general criticism for the "ldd" approach is that it's inaccurate, and doesn't give us real base addresses. I agree, and generally resort to pulling things manually out of GDB.

This PR automates the process.

*N.B.*: This PR requires #59.

```
from pwn import *
shell = ssh(host='bandit.labs.overthewire.org',user='bandit0',password='bandit0')
libs = gdb.find_module_addresses(shell, '/bin/bash')
hex(libs[0].symbols['mmap'])
# '0x7ffff76df7a0'
```

Compare to:

```
(gdb) p/x &mmap
$2 = 0x7ffff76df7a0
```