Merge branch 'dev'

pull/142/head
Zach Riggle 9 years ago
commit 9e91689be3

@ -36,6 +36,11 @@ class xint(with_metaclass(IsAnInt, builtins.int)):
value = value.cast(pwndbg.typeinfo.ulong)
else:
value = value.cast(pwndbg.typeinfo.long)
if isinstance(value, gdb.Symbol):
symbol = value
value = symbol.value()
if symbol.is_function:
value = value.cast(pwndbg.typeinfo.ulong)
return _int(_int(value, *a, **kw))
builtins.int = xint

@ -201,6 +201,13 @@ def address(symbol):
except:
pass
try:
symbol_obj = gdb.lookup_symbol(symbol)[0]
if symbol_obj:
return int(symbol_obj)
except Exception:
pass
try:
result = gdb.execute('info address %s' % symbol, to_string=True, from_tty=False)
address = re.search('0x[0-9a-fA-F]+', result).group()
@ -208,6 +215,13 @@ def address(symbol):
except gdb.error:
return None
try:
address = pwndbg.ida.LocByName(symbol)
if address:
return address
except Exception:
pass
@pwndbg.events.stop
@pwndbg.memoize.reset_on_start
def add_main_exe_to_symbols():

Loading…
Cancel
Save