@ -46,7 +46,7 @@ ida_timeout = pwndbg.config.add_param("ida-timeout", 2, "time to wait for ida xm
_ida : xmlrpc . client . ServerProxy | None = None
# to avoid printing the same exception multiple times, we store the last exception here
_ida_last_exception = None
_ida_last_exception : BaseException | None = None
# to avoid checking the connection multiple times with no delay, we store the last time we checked it
_ida_last_connection_check = 0
@ -79,6 +79,7 @@ def init_ida_rpc_client() -> None:
try :
_ida . here ( )
print ( message . success ( f " Pwndbg successfully connected to Ida Pro xmlrpc: { addr } " ) )
idc . _update ( )
except TimeoutError :
exception = sys . exc_info ( )
_ida = None
@ -119,7 +120,7 @@ def init_ida_rpc_client() -> None:
)
print (
message . notice ( " To disable IDA Pro integration invoke ` " )
+ message . hint ( " set i da-enabled off " )
+ message . hint ( " set i ntegration-provider none " )
+ message . notice ( " ` " )
)
@ -230,6 +231,13 @@ def GetFuncOffset(addr: int):
return rv
@withIDA
@takes_address
def GetFuncAttr ( addr : int , attr : int ) :
rv = _ida . get_func_attr ( addr , attr )
return rv
@withIDA
@takes_address
@pwndbg.lib.cache.cache_until ( " objfile " )
@ -446,6 +454,13 @@ def GetStrucSize(sid):
return _ida . get_struc_size ( sid )
@withIDA
@takes_address
@pwndbg.lib.cache.cache_until ( " stop " )
def GetFrameId ( addr ) :
return _ida . get_frame_id ( addr )
@withIDA
@pwndbg.lib.cache.cache_until ( " stop " )
def GetMemberQty ( sid ) :
@ -470,6 +485,12 @@ def GetMemberName(sid, offset):
return _ida . get_member_name ( sid , offset )
@withIDA
@pwndbg.lib.cache.cache_until ( " stop " )
def GetMemberOffset ( sid , member_name ) :
return _ida . get_member_offset ( sid , member_name )
@withIDA
@pwndbg.lib.cache.cache_until ( " stop " )
def GetMemberFlag ( sid , offset ) :
@ -483,12 +504,15 @@ def GetStrucNextOff(sid, offset):
class IDC :
query = " { k:v for k,v in globals()[ ' idc ' ].__dict__.items() if type(v) in (int,long )}"
query = " { k:v for k,v in globals()[ ' idc ' ].__dict__.items() if isinstance(v, int )}"
def __init__ ( self ) - > None :
if available ( ) :
data : Dict [ Any , Any ] = _ida . eval ( self . query )
self . __dict__ . update ( data )
self . _update ( )
def _update ( self ) - > None :
data : Dict [ Any , Any ] = _ida . eval ( self . query )
self . __dict__ . update ( data )
idc = IDC ( )
@ -554,8 +578,7 @@ class IdaProvider(pwndbg.integration.IntegrationProvider):
return Name ( addr ) or GetFuncOffset ( addr ) or None
return None
@pwndbg.decorators.suppress_errors ( )
@withIDA
@pwndbg.decorators.suppress_errors ( fallback = ( ) )
def get_versions ( self ) - > Tuple [ str , . . . ] :
ida_versions = get_ida_versions ( )