|
|
|
|
@ -19,6 +19,7 @@ import pwndbg.gdblib.arch
|
|
|
|
|
import pwndbg.gdblib.elf
|
|
|
|
|
import pwndbg.gdblib.events
|
|
|
|
|
import pwndbg.gdblib.file
|
|
|
|
|
import pwndbg.gdblib.info
|
|
|
|
|
import pwndbg.gdblib.memory
|
|
|
|
|
import pwndbg.gdblib.qemu
|
|
|
|
|
import pwndbg.gdblib.remote
|
|
|
|
|
@ -216,6 +217,19 @@ def address(symbol: str) -> int:
|
|
|
|
|
if all(x not in str(e) for x in skipped_exceptions):
|
|
|
|
|
raise e
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
# Unfortunately, `gdb.lookup_symbol` does not seem to handle all
|
|
|
|
|
# symbols, so we need to fallback to using `info address`. See
|
|
|
|
|
# https://sourceware.org/pipermail/gdb/2022-October/050362.html
|
|
|
|
|
address = pwndbg.gdblib.info.address(symbol)
|
|
|
|
|
if address is None or not pwndbg.gdblib.vmmap.find(address):
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
return address
|
|
|
|
|
|
|
|
|
|
except gdb.error:
|
|
|
|
|
return None
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
# TODO: We should properly check if we have a connection to the IDA server first
|
|
|
|
|
address = pwndbg.ida.LocByName(symbol)
|
|
|
|
|
|