def check_thread(self): tid = ida_dbg.get_current_thread() if self.last_tid != tid: idaapi.refresh_debugger_memory() self.callback() self.last_tid = tid return self.timer_freq
def start(): process_is_suspended = False #check if process is suspended if idaapi.is_debugger_on(): if idaapi.get_process_state() == -1: process_is_suspended = True else: idaapi.warning("Please suspend the debugger!") else: idaapi.warning("Please run the process!") #then start a stack checking if process_is_suspended: is_success, call_list, call_addr_list = get_all_calls() if is_success and call_list is not None: curr_thread = ida_dbg.get_current_thread() title = "CallStack - thread: {}".format(curr_thread) idaapi.close_chooser(title) c = MyChoose(call_list, call_addr_list, title) c.Show() else: idaapi.warning( "Something wrong. There is no functions. Set DEBUG flag in the script and check what is going on" )
def main(): if not ida_idd.dbg_can_query(): print("The debugger must be active and suspended before using this script!") return # Save current thread id tid = ida_dbg.get_current_thread() # Iterate through all function instructions and take only call instructions result = {} for tid in idautils.Threads(): result[tid] = GetExceptionChain(tid) # Restore previously selected thread ida_dbg.select_thread(tid) # Build the graph g = SEHGraph("SEH graph", result) g.Show()
def main(): if not ida_dbg.is_debugger_on(): ida_kernwin.warning("Please run the process first!") return if ida_dbg.get_process_state() != -1: ida_kernwin.warning("Please suspend the debugger first!") return # get all debug namesp dn = ida_name.get_debug_names(ida_ida.cvar.inf.min_ea, ida_ida.cvar.inf.max_ea) # initiate a nearest name search (using debug names) nn = ida_name.NearestName(dn) ret, callstack = CallStackWalk(nn) if ret: title = "Call stack walker (thread %X)" % (ida_dbg.get_current_thread()) ida_kernwin.close_chooser(title) c = CallStackWalkChoose(title, callstack) c.Show(True) else: ida_kernwin.warning("Failed to walk the stack:" + callstack)