|
|
|
@ -8,6 +8,7 @@ Uses IDA when available if there isn't sufficient symbol
|
|
|
|
information available.
|
|
|
|
information available.
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
import gdb
|
|
|
|
import gdb
|
|
|
|
|
|
|
|
import re
|
|
|
|
import pwndbg.elf
|
|
|
|
import pwndbg.elf
|
|
|
|
import pwndbg.ida
|
|
|
|
import pwndbg.ida
|
|
|
|
import pwndbg.memoize
|
|
|
|
import pwndbg.memoize
|
|
|
|
@ -69,10 +70,7 @@ def address(symbol):
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
result = gdb.execute('info address %s' % symbol, to_string=True, from_tty=False)
|
|
|
|
result = gdb.execute('info address %s' % symbol, to_string=True, from_tty=False)
|
|
|
|
result = result.split()
|
|
|
|
address = re.search('0x[0-9a-fA-F]+', result).group()
|
|
|
|
address = next(r for r in result if r.startswith('0x'))
|
|
|
|
|
|
|
|
address = address.split('-')[0]
|
|
|
|
|
|
|
|
address = address.rstrip('.')
|
|
|
|
|
|
|
|
return int(address, 0)
|
|
|
|
return int(address, 0)
|
|
|
|
except gdb.error:
|
|
|
|
except gdb.error:
|
|
|
|
return None
|
|
|
|
return None
|
|
|
|
|