def goto(shift=False): print("GhIDA:: [DEBUG] goto called") symbol = None ret = ida_kernwin.get_highlight(ida_kernwin.get_current_viewer()) if ret and ret[1]: symbol = ret[0] if not symbol: return False address = gl.get_address_for_symbol(symbol) if not address: return False print("OnDblClick, shift=%d, selection:%s, address:%s" % (shift, symbol, address)) # Update IDA DISASM view idaapi.jumpto(address) # Update IDA DECOMP view ea = gl.convert_address(address) print("GhIDA:: [DEBUG] update view to %s" % ea) DECOMP_VIEW.switch_to_address(ea) return True
def view_loc_changed(self, widget, curloc, prevloc): """ view_loc_changed is called each time the user clicks somwhere. This is used to synchronize the IDA DISASM view with the IDA DECOM view. The synchronization is active only when the decompile view has been created and the synch option has been selected in the pop-up menu. """ # Check if the selected address has changed # if curloc.plce.toea() != prevloc.plce.toea(): # return # Hooking the IDA DISASM view only if idaapi.get_widget_type(widget) != idaapi.BWN_DISASM: return # If the DECOMP view has already been created. if DECOMP_VIEW: # Get the new address ca = curloc.plce.toea() ea = gl.convert_address(ca) # This is a valid function address if ea: # The synch is active if GHIDA_CONF.disasm_tracker: # The address in DECOMP view is different if ea != DECOMP_VIEW.ea: # Update DECOMP view DECOMP_VIEW.switch_to_address(ea) # Update the selection return gl.highlight_symbol_in_DECOMP() # This is not a valid function address if not ea: # If the synch is active if GHIDA_CONF.disasm_tracker: DECOMP_VIEW.clear(msg="[!] Function not found.", do_show=False) return
def goto(shift=False): print("GhIDA:: [DEBUG] goto called") symbol = get_highlighted_identifier() if not symbol: return False address = gl.get_address_for_symbol(symbol) if not address: return False print("OnDblClick, shift=%d, selection:%s, address:%s" % (shift, symbol, address)) # Update IDA DISASM view idaapi.jumpto(address) # Update IDA DECOMP view ea = gl.convert_address(address) print("GhIDA:: [DEBUG] update view to %s" % ea) DECOMP_VIEW.switch_to_address(ea) return True